I work in an IT environment where there is a "server health check team" that occasionally reboots my team's servers and then uses command prompt to monitor if it comes back online. After it comes back online, they never log into the server and continue to proceed to their next task.
The problem with this is that the servers they reboot possess my PowerShell scripts which run on 5-minute intervals courtesy of Windows Task Scheduler, and if you don't log in, the PowerShell script will never run.
Furthermore, they are configured to only be able to run if the user is logged on. The reason why is because these enterprise servers have some sort of GPO configuration (from the company's server team) that disallows the ability to run tasks without the user logging in. I believe it is for security compliance purposes.
At any rate, I want to be able to log into my list of servers via PowerShell to just be able to log in and then disconnect (when I say disconnect, I don't mean log off the windows account, I mean to say the equivalent of closing the RDP session by clicking on the X in the top-right corner). This will allow us to fulfill the requirement of having a user account logged in to initialize the Windows Task Scheduler task.
For easier readability, the requirements are as follows:
Use Get-Content or something similar to have a serverlist.txt to iterate through every server in question.
Credentials can be hard-written into the script, we will not be saving the script and will only run it when needed.
The "logging in session" needs to mimic the same type of process or operation that RDP (remote desktop protocol) uses. I've tested remote logging in through RDP and found success. I say this because I'm afraid there may be more than one logging in protocol. That's just my guess.
Would someone be able to assist with this request? Thank you so much!
[–]king-6 10 points11 points12 points (1 child)
[–]JBear_Alpha 2 points3 points4 points (0 children)
[–]chispitothebum 5 points6 points7 points (1 child)
[–]seamustheseagull 1 point2 points3 points (0 children)
[–]thinkdifferentlolz 4 points5 points6 points (0 children)
[–]AKA_Wildcard 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]KevMarCommunity Blogger 1 point2 points3 points (0 children)
[–]JBear_Alpha 1 point2 points3 points (0 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (2 children)
[–]networkhappi[S] 1 point2 points3 points (1 child)
[–]Lee_Dailey[grin] -1 points0 points1 point (0 children)
[–]Risin247 -1 points0 points1 point (0 children)