0

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

1 Answers1

0

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.

Keith Hill
  • 194,368
  • 42
  • 353
  • 369
  • Sorry, I'm new to this, how do I switch the platform target? –  Apr 29 '14 at 08:57
  • is it done on the default.aspx page? - <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> –  Apr 29 '14 at 09:19
  • The modules I can see in both x32 and x64 directories using file explorer, are not visible when I browse via visual studio??? What am i missing? –  Apr 29 '14 at 13:38