Question

Hi can someone point out were i'm going wrong with my code

I receive errors like below upon invoking

  1. The Windows PowerShell snap-in 'Microsoft.Exchange.Management.PowerShell.Admin' is not installed on this machine.
  2. he term 'MailboxReport' 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

My server has the following modules and PSsnapin's

Path module pstcheck = C:\Windows\System32\WindowsPowerShell\v1.0\Modules\MailboxPSTCheck Path module exsession = C:\Windows\System32\WindowsPowerShell\v1.0\Modules\NewExchangeSession

Get-PSSnapin -Registered Name : Microsoft.Exchange.Management.PowerShell.E2010 PSVersion : 1.0 Description : Admin Tasks for the Exchange Server Name : Microsoft.Exchange.Management.PowerShell.Setup PSVersion : 1.0 Description : Setup Tasks for the Exchange Server Name : Microsoft.Exchange.Management.Powershell.Support PSVersion : 1.0 Description : Support Tasks for the Exchange Server

Was it helpful?

Solution

These problems are usually the result of your program running as a 64-bit process while the snapin is registered only under 32-bit PowerShell (or vice-versa). Try changing the Platform Target of your VB project to x86. If that doesn't fix it, try x64. Ultimately, whichever version of PowerShell has the Exchange snapins registered (x64 or x86) is the platform you want to target.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top