I have made a function for my friend Anders Bengtsson
that will do a Shutdown, Reboot or Log Off.
The function uses Win32Shutdown in the WMI object Win32_Operatingsystem.
Example:
Shutdown-Computer mysrv01 ‘Log Off’
or
Shutdown-Computer mysrv01 ‘Log Off’ other
The other option will open a credential form and then uses your input for credential.
The script can be found here.
A Shutdown function for local or remote computer, http://bit.ly/4FjxDU #PowerShell #WMI #Function #Computer
A Shutdown function for local or remote computer, http://bit.ly/4FjxDU
A Shutdown function for local or remote computer, http://bit.ly/4FjxDU #PowerShell #WMI #Function #Computer