Sunday, February 27, 2011

How to deploy PowerShell script via group policy?


Question

PowerShell is a becoming a very powerful way to administrate Windows systems. If you want to deploy a PowerShell script on domain clients, how can you do it via group policy?

Answer
In Windows 7 and Windows Server 2008 R2, the UI in Group Policy Editor for Logon, Logoff, Startup, Shutdown scripts now has an extra tab for PowerShell scripts. You can simply add your PowerShell script to this tab to deploy it.

1.       Create or edit a GPO on Windows Server 2008 R2 or Windows 7 with RSAT.
2.       Navigate to
[Computer Configuration\Policies\Windows Settings\Scripts]
Or
[User Configuration\Policies\Windows Settings\Scripts]
3.       Double-click Startup/Shutdown or Logon/Logoff, switch to PowerShell Scripts tab and add PowerShell script files.

More Information
For more information about PowerShell, please refer to the following links:
Scripting with Windows PowerShell

Windows PowerShell Getting Started Guide

Applies to
Windows 7
Windows Server 2008 R2

No comments:

Post a Comment