I am trying to run a PS1 script using Exchange 2010 remote powershell and c#. I can connect and run the ps1 script but there are a few places in the script that use exchange cmdlets to update necessary user information. One cmdlet the script is using is update-recipient. The script runs fine until it trys to run this cmdlet and errors saying:
The term ‘update-recipient’ is not recognized as the name of a cmdlet, function, script file, or operable program.
Does anyone know if there are any restrictions on running cmdlets inside of PS1 scripts from c#?
Thanks
In order to run an Exchange 2010 powershell script from the command line, you need to load the Exchange components at the beginning of the powershell script. Add these 2 lines to your .ps1 file. Substitute your Exchange server’s name for EXCHANGESERVER in the first line.