Links on Common PowerShell Automation Questions
I've put together a list of articles which cover common questions on Exchange PowerShell Automation. These links cover issues from starting out to common problems. I hope they help. Please let me know if there are others you see as important.
Starting articles on automation:
Using Exchange Management Shell Commands with Managed Code
https://msdn.microsoft.com/en-us/library/bb332449.aspx
Windows PowerShell
https://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx
OUTBOX: Introduction to Exchange PowerShell Automation Part 1
OUTBOX: Introduction to Exchange PowerShell Automation Part 2
Samples:
Howto: Calling Exchange Powershell from an impersonated thead.
Handling results of calling Powershell - Multivalued and string arrays.
HOWTO: csharp - Exchange PowerShell - call get-StorageGroupCopyStatus with managed code.
HOWTO: csharp - PowerShell - call get-clusteredmailboxserverstatus with managed code.
Managing Exchange 2007 Recipients with C#
https://knicksmith.blogspot.com/2007/03/managing-exchange-2007-recipients-with.html
Scripting Exchange Web Services (2007) with VBS and Powershell
https://gsexdev.blogspot.com/2006/12/scripting-exchange-web-services-2007.html
Problems:
An application cannot impersonate a user and then run Windows PowerShell commands in an Exchange Server 2007 environment
https://support.microsoft.com/kb/943937/en-us
Call Dispose on client when calling COM+ objects.
KB: Automation Error 0x8007007f when Invoking Exchange 2007 Powershell Cmdlets
PowerShell commands for the Exchange 2007 Edge server role do not work as expected after you uninstall an update rollup or an interim update on the Edge server
https://support.microsoft.com/kb/949536
Installation:
How to Download Windows PowerShell 1.0
https://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx
How to Install Windows PowerShell and Download the Windows PowerShell SDK
https://msdn2.microsoft.com/en-us/library/Bb204630.aspx
How to Install the Exchange 2007 Management Tools
https://technet.microsoft.com/en-us/library/bb232090(EXCHG.80).aspx
How to Install Exchange 2007 SP1 Prerequisites on Windows Server 2008 or Windows Vista
https://technet.microsoft.com/en-us/library/bb691354(EXCHG.80).aspx
Installing Exchange 2007 Management Tools On a 32 Bit Operating System
https://support.microsoft.com/default.aspx/kb/555841
How to obtain the latest service pack or update rollup for Exchange 2007
https://support.microsoft.com/kb/937052
PowerShell Scripting Training:
Using the Exchange Server 2007 Management Console and Shell
TechNet Webcast: Introduction to Windows PowerShell Scripting in Exchange Server 2007 (Level 200)
White Paper: Exchange Management Shell
https://technet.microsoft.com/en-us/library/bb266977(EXCHG.80).aspx
Other:
The Windows PowerShell Toolbox
https://www.microsoft.com/technet/scriptcenter/topics/winpsh/toolbox.mspx
Avoiding Jitter: Jumpstarting the Exchange shell (makes PowerShell run faster)
https://msexchangeteam.com/archive/2008/08/01/449426.aspx
Additional Tips:
- When you run into a problem with automation code, see if it reproduces in the command shell. If it reproduces in then command shell then the issue is not with your .NET code. So, be sure to always test the same call from the command shell, otherwise you will be troubleshooting the wrong area.
- If the call the PowerShell cmdlet or script works in the command shell but not your .NET application then try calling a non-Exchange PowerShell cmdlet to see if it works. This is an extremely important test as it will tell if the issue is Exchange PowerShell cmdlet specific or it if its more of a general PowerShell automation issue. Exchange specific PowerShell automation issues are often tied to permissions.
- Always keep in mind that to do a PowerShell call that the .NET application needs to run under local admin privileges and that account used to make the PowerShell call to the Exchange server needs to have Exchange Admin privileges. Having anything less than those two won't work.
- If you run into an issue with script or automation code and think it should work, verify that you have the current service packs installed.
- To avoid possible issues with the console, be sure that the version of the tools running PowerShell code are at the same SP/fix level as the other servers.
- Don't try to do Local PowerShell calls or PowerShell 1 calls against Exchange 2010 and later - such calls are not supported and likely not to work.
Comments
- Anonymous
September 26, 2008
PingBack from http://blogs.msdn.com/webdav_101/archive/2008/09/25/howto-calling-exchange-powershell-from-an-impersonated-thead.aspx