Tuesday, April 12, 2011

Provisioning Exchange 2010 Users with Remote Powershell in Windows XP/2003

Using Remote PowerShell to provisionin Exchange 2010 Users

Exchange 2010 provides us with some new features for PowerShell in order to run commands remotely to a CAS server. However, there are a few prerequisites you need to know in order to do this. First of all, the Windows 2003 or XP, out of the box does not provide this. You will have to download the "WINRM" update patch that installs Windows PowerShell. Here is the URL for the download:

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=F002462B-C8F2-417A-92A3-287F5F81407E


Also, you need to enable remote PowerShell on your Exchange 2010 CAS server with the following PS command, 'Enable-PSRemoting' . You can then choose "YES" to configure Firewall ports if necessary and then ensure that the 'WINRM" service is running on the CAS Server. There is a command to verify that the user you are logged in with has the necessary authority to run the commands and it is, 'get-user (username) | fl'.

Verify that “RemotePowerShellEnabled” is set to True. To set this, enter: ‘Set-User –identity (username) –RemotePowerShellEnabled $true’.

Finally, after ensuring that the Exchange server is accepting remote PS commands, there are a few more settings on the Windows 2003/XP machine prior to running.

Start the Windows Remote Management Service task from Services.MSC console

Then run Windows Powershell Command from Program\Accessories:

set-executionpolicy remotesigned

That's it! Have fun but be careful, this is pretty powerful.