I have need to produce the same product as the request documented in the following post:
Export Exchange mailbox and delete account
I created everything per documentation, but every time that I run the export script, I get the following:
Run PowerShell script 'Export Mailbox' for the user
Get-MailboxExportRequest : The term 'Get-MailboxExportRequest' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:6 char:2 + Get-MailboxExportRequest -Name username | Remove-MailboxExportReques ... + ~~~~~~ + CategoryInfo : ObjectNotFound: (Get-MailboxExportRequest:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException .Exception.Message : The term '.Exception.Message' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:13 char:2 + .Exception.Message + ~~~~ + CategoryInfo : ObjectNotFound: (.Exception.Message:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
This appears to be an issue with the cmdlet not being available. I have tested my commands in a powershell window independently and the remote powershell to my exchange environment is functioning as expected, but if I run it in an automated fashion or in the powershell script editor on an AD object, it fails like this everytime.
Do you have any suggestions concerning what might cause the remote PS session to not work or what might cause the script to be executed outside of the context of the remote session?
Rob