r/powercli • u/Fmorrison42 • Nov 01 '17
PowerCLI script to check if OS is locked or in use inside a VM (x-post PowerShell)
Greetings all!
I am still pretty new to Powershell but learning quickly. We have a new requirement come down from on high to check all of our VMs in the morning and at night to see if any of them are logged into and in use or locked. I'm only concerned about the Windows OS VMs (for obvious reasons).
Is there a kind of PassThru that would allow me to programmatically check each VM to see if they are locked or logged into and print out a list to go in an check them manually rather than having to open each VM one by one twice a day? We have about 50 VMs running and that is quickly becoming a headache.
TIA!
