Shutdown-Computer

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.

 image

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.

image

The script can be found here.

 

This entry was posted in PowerShell Blogs and tagged , , . Bookmark the permalink.

0 Responses to Shutdown-Computer

  1. Fredrik Wall says:

    A Shutdown function for local or remote computer, http://bit.ly/4FjxDU #PowerShell #WMI #Function #Computer

  2. Fredrik Wall says:

    A Shutdown function for local or remote computer, http://bit.ly/4FjxDU

  3. Fredrik Wall says:

    A Shutdown function for local or remote computer, http://bit.ly/4FjxDU #PowerShell #WMI #Function #Computer

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>