Friday, April 10, 2009

Tech Tips: Cannot run Exchange command in PowerShell, do this first...

If you're new to Microsoft PowerShell (PS) and Exchange 2007, you soon will realized that why you're not able to run any command in PS and keeps getting the error similar to the following:

(example:)
The term 'Move-Mailbox' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.
At line:1 char:13

Type in the following and you're good to go:

1. To check if the snapin has been installed:

PS C:\>Get-PSSnapin -Registered

Name : Microsoft.Exchange.Management.PowerShell.Admin
PSVersion : 1.0
Description : Admin Tasks for the Exchange Server

To manually add this to the current PowerShell session, use the Add-PSSnapin cmdlet:

PS C:\>Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin

This is just the command to allow the exchange snapin to integrate with the PS, for more info about the usage, hit the following link:

http://mcpmag.com/features/article.asp?EditorialsID=763


No comments: