Windows Scripts Using Simple PowerShell Commands

Windows Scripts Using Simple PowerShell Commands

Like many administrators, I have numerous scripts written as .BAT batch files that could use an update. Now that Windows Server 2008 R2 has PowerShell 2 installed by default, it is time.

Let’s take a few of the staples that we have put in .BAT files, and I’ll give you the PowerShell equivalent.

Reboot a remote computer

To perform a 10-second delay on a remote server (Server1), the following is entered in a batch file:

shutdown /r /m \\SERVER1 /f /t 10