If you are running MOSS 2007 on Windows Server 2003 the you have to download and install PowerShell from http://support.microsoft.com/kb/968930. Windows Server 2008 natively supports PowerShell.
- Set the Execution Policy to ‘RemoteSigned’. You can check it by running ‘Get-ExecutionPolicy’ cmdlet
The default execution policy for PowerShell is “Restricted” (commands only, not scripts)
This means downloaded scripts must be signed by a trusted publisher before they can be run.
3. You need to load the SharePoint assemblies with the following command
A bunch of PowerShell scripts are available at http://www.powershell.nu/2009/09/08/moss-2007-script-collection