|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
MapiExceptionLowLevelInitializationFailure in C# with powershellWhen I'm executing the powershell command Disable-Mailbox in c# i get this exception: MapiExceptionLowLevelInitializationFailure: Unable to load exrpc32.dll or one of its dependent DLLs (extrace.dll, exchmem.dll, msvcr80.dll, etc) The mailbox is removed ok, butI get this exception. If I run the exact command in powershell, everything runs fine without exceptions. I'm running the code on a Vista x32 machine agains a Exchange 2007 x64 server. Some powershell commands runs ok withou exceptions, but with commands like Disable-Mailbox I get this exception. Does anyone have any clue why this is happening? /Mathias Hi Mathias,
> When I'm executing the powershell command Disable-Mailbox in c# i get this What happens when you run your code on the Exchange Server itself?> exception: > MapiExceptionLowLevelInitializationFailure: Unable to load exrpc32.dll or > one of its dependent DLLs (extrace.dll, exchmem.dll, msvcr80.dll, etc) > > The mailbox is removed ok, butI get this exception. > If I run the exact command in powershell, everything runs fine without > exceptions. > > I'm running the code on a Vista x32 machine agains a Exchange 2007 x64 > server. I suspect that you are using the 32-bit version of Exchange 2007 on your Vista box, right? Not sure if that is a supported environment. IIRC the 32-bit version is for testing only and unsupported. Are you using the same service pack level as your Exchange Server? -- SvenC Hi!
I haven't tried to run the code on the production environment, but I will test it. This is as you say the 32bit version of Exchange 2007 on my Vista machine. It is strange that the powershell command works on my client if I run it in a powershell window. It is only when I run it through c# that this problem occurs. Serveral other powershell commands works ok through c# I have the same path-level om my client as I have on the production server. Any more ideas on what can cause this? /Mathias Show quoteHide quote "SvenC" wrote: > Hi Mathias, > > > When I'm executing the powershell command Disable-Mailbox in c# i get this > > exception: > > MapiExceptionLowLevelInitializationFailure: Unable to load exrpc32.dll or > > one of its dependent DLLs (extrace.dll, exchmem.dll, msvcr80.dll, etc) > > > > The mailbox is removed ok, butI get this exception. > > If I run the exact command in powershell, everything runs fine without > > exceptions. > > > > I'm running the code on a Vista x32 machine agains a Exchange 2007 x64 > > server. > > What happens when you run your code on the Exchange Server itself? > > I suspect that you are using the 32-bit version of Exchange 2007 on your > Vista > box, right? Not sure if that is a supported environment. IIRC the 32-bit > version is > for testing only and unsupported. > > Are you using the same service pack level as your Exchange Server? > > -- > SvenC > > Hello Mathias,
Show quoteHide quote > Hi! I have ASP pages that run the Disable-Mailbox command via C# on a daily basis, > > I haven't tried to run the code on the production environment, but I > will > test it. > This is as you say the 32bit version of Exchange 2007 on my Vista > machine. > It is strange that the powershell command works on my client if I run > it in > a powershell window. It is only when I run it through c# that this > problem > occurs. > Serveral other powershell commands works ok through c# > I have the same path-level om my client as I have on the production > server. > > Any more ideas on what can cause this? > > /Mathias > > "SvenC" wrote: > >> Hi Mathias, >> >>> When I'm executing the powershell command Disable-Mailbox in c# i >>> get this >>> exception: >>> MapiExceptionLowLevelInitializationFailure: Unable to load >>> exrpc32.dll or >>> one of its dependent DLLs (extrace.dll, exchmem.dll, msvcr80.dll, >>> etc) >>> The mailbox is removed ok, butI get this exception. >>> If I run the exact command in powershell, everything runs fine >>> without >>> exceptions. >>> I'm running the code on a Vista x32 machine agains a Exchange 2007 >>> x64 server. >>> >> What happens when you run your code on the Exchange Server itself? >> >> I suspect that you are using the 32-bit version of Exchange 2007 on >> your >> Vista >> box, right? Not sure if that is a supported environment. IIRC the >> 32-bit >> version is >> for testing only and unsupported. >> Are you using the same service pack level as your Exchange Server? >> >> -- >> SvenC and this error does not occur. Show us your code, and perhaps we can figure this out Hi!
Here's my code: RunspaceConfiguration rsConfig = RunspaceConfiguration.Create(); PSSnapInException snapInException = null; PSSnapInInfo info = rsConfig.AddPSSnapIn("Microsoft.Exchange.Management.PowerShell.Admin", out snapInException); Runspace myRunSpace = RunspaceFactory.CreateRunspace(rsConfig); myRunSpace.Open(); Pipeline pipeLine = myRunSpace.CreatePipeline(); Command myCommand = new Command("Disable-Mailbox"); CommandParameter verbParam = new CommandParameter("Identity",username); myCommand.Parameters.Add(verbParam); verbParam = new CommandParameter("Confirm",false); myCommand.Parameters.Add(verbParam); pipeLine.Commands.Add(myCommand); Collection<PSObject> commandResults = pipeLine.Invoke(); I have also tried to use script call: Command("Disable-Mailbox -Identity " + username + " -Confirm:$false", true); Any ideas? /Mathias Show quoteHide quote "Karl Mitschke" wrote: > Hello Mathias, > > > Hi! > > > > I haven't tried to run the code on the production environment, but I > > will > > test it. > > This is as you say the 32bit version of Exchange 2007 on my Vista > > machine. > > It is strange that the powershell command works on my client if I run > > it in > > a powershell window. It is only when I run it through c# that this > > problem > > occurs. > > Serveral other powershell commands works ok through c# > > I have the same path-level om my client as I have on the production > > server. > > > > Any more ideas on what can cause this? > > > > /Mathias > > > > "SvenC" wrote: > > > >> Hi Mathias, > >> > >>> When I'm executing the powershell command Disable-Mailbox in c# i > >>> get this > >>> exception: > >>> MapiExceptionLowLevelInitializationFailure: Unable to load > >>> exrpc32.dll or > >>> one of its dependent DLLs (extrace.dll, exchmem.dll, msvcr80.dll, > >>> etc) > >>> The mailbox is removed ok, butI get this exception. > >>> If I run the exact command in powershell, everything runs fine > >>> without > >>> exceptions. > >>> I'm running the code on a Vista x32 machine agains a Exchange 2007 > >>> x64 server. > >>> > >> What happens when you run your code on the Exchange Server itself? > >> > >> I suspect that you are using the 32-bit version of Exchange 2007 on > >> your > >> Vista > >> box, right? Not sure if that is a supported environment. IIRC the > >> 32-bit > >> version is > >> for testing only and unsupported. > >> Are you using the same service pack level as your Exchange Server? > >> > >> -- > >> SvenC > > I have ASP pages that run the Disable-Mailbox command via C# on a daily basis, > and this error does not occur. > > Show us your code, and perhaps we can figure this out > > > Hello Mathias,
Sorry to take so long. Your code sample works flawlessly on my test bench (Exchange 2007 SP1 / RU7) Karl Show quoteHide quote > Hi! > > Here's my code: > > RunspaceConfiguration rsConfig = RunspaceConfiguration.Create(); > PSSnapInException snapInException = null; > PSSnapInInfo info = > rsConfig.AddPSSnapIn("Microsoft.Exchange.Management.PowerShell.Admin", > out > snapInException); > Runspace myRunSpace = RunspaceFactory.CreateRunspace(rsConfig); > myRunSpace.Open(); > Pipeline pipeLine = myRunSpace.CreatePipeline(); > Command myCommand = new Command("Disable-Mailbox"); > CommandParameter verbParam = new > CommandParameter("Identity",username); > myCommand.Parameters.Add(verbParam); > verbParam = new CommandParameter("Confirm",false); > myCommand.Parameters.Add(verbParam); > pipeLine.Commands.Add(myCommand); > Collection<PSObject> commandResults = pipeLine.Invoke(); > I have also tried to use script call: > Command("Disable-Mailbox -Identity " + username + " -Confirm:$false", > true); > Any ideas? > > /Mathias > > "Karl Mitschke" wrote: > >> Hello Mathias, >> >>> Hi! >>> >>> I haven't tried to run the code on the production environment, but I >>> will >>> test it. >>> This is as you say the 32bit version of Exchange 2007 on my Vista >>> machine. >>> It is strange that the powershell command works on my client if I >>> run >>> it in >>> a powershell window. It is only when I run it through c# that this >>> problem >>> occurs. >>> Serveral other powershell commands works ok through c# >>> I have the same path-level om my client as I have on the production >>> server. >>> Any more ideas on what can cause this? >>> >>> /Mathias >>> >>> "SvenC" wrote: >>> >>>> Hi Mathias, >>>> >>>>> When I'm executing the powershell command Disable-Mailbox in c# i >>>>> get this >>>>> exception: >>>>> MapiExceptionLowLevelInitializationFailure: Unable to load >>>>> exrpc32.dll or >>>>> one of its dependent DLLs (extrace.dll, exchmem.dll, msvcr80.dll, >>>>> etc) >>>>> The mailbox is removed ok, butI get this exception. >>>>> If I run the exact command in powershell, everything runs fine >>>>> without >>>>> exceptions. >>>>> I'm running the code on a Vista x32 machine agains a Exchange 2007 >>>>> x64 server. >>>> What happens when you run your code on the Exchange Server itself? >>>> >>>> I suspect that you are using the 32-bit version of Exchange 2007 on >>>> your >>>> Vista >>>> box, right? Not sure if that is a supported environment. IIRC the >>>> 32-bit >>>> version is >>>> for testing only and unsupported. >>>> Are you using the same service pack level as your Exchange Server? >>>> -- >>>> SvenC >> I have ASP pages that run the Disable-Mailbox command via C# on a >> daily basis, and this error does not occur. >> >> Show us your code, and perhaps we can figure this out >> Hello Mathias,
That is, I ran it on my mailbox server (Server 2k3, 64bit) I will try in XP 32 bit, once I install the Exchange Management tools. Karl Show quoteHide quote > Hello Mathias, > > Sorry to take so long. > > Your code sample works flawlessly on my test bench (Exchange 2007 SP1 > / RU7) > > Karl > >> Hi! >> >> Here's my code: >> >> RunspaceConfiguration rsConfig = RunspaceConfiguration.Create(); >> PSSnapInException snapInException = null; >> PSSnapInInfo info = >> rsConfig.AddPSSnapIn("Microsoft.Exchange.Management.PowerShell.Admin" >> , >> out >> snapInException); >> Runspace myRunSpace = RunspaceFactory.CreateRunspace(rsConfig); >> myRunSpace.Open(); >> Pipeline pipeLine = myRunSpace.CreatePipeline(); >> Command myCommand = new Command("Disable-Mailbox"); >> CommandParameter verbParam = new >> CommandParameter("Identity",username); >> myCommand.Parameters.Add(verbParam); >> verbParam = new CommandParameter("Confirm",false); >> myCommand.Parameters.Add(verbParam); >> pipeLine.Commands.Add(myCommand); >> Collection<PSObject> commandResults = pipeLine.Invoke(); >> I have also tried to use script call: >> Command("Disable-Mailbox -Identity " + username + " -Confirm:$false", >> true); >> Any ideas? >> /Mathias >> >> "Karl Mitschke" wrote: >> >>> Hello Mathias, >>> >>>> Hi! >>>> >>>> I haven't tried to run the code on the production environment, but >>>> I >>>> will >>>> test it. >>>> This is as you say the 32bit version of Exchange 2007 on my Vista >>>> machine. >>>> It is strange that the powershell command works on my client if I >>>> run >>>> it in >>>> a powershell window. It is only when I run it through c# that this >>>> problem >>>> occurs. >>>> Serveral other powershell commands works ok through c# >>>> I have the same path-level om my client as I have on the production >>>> server. >>>> Any more ideas on what can cause this? >>>> /Mathias >>>> >>>> "SvenC" wrote: >>>> >>>>> Hi Mathias, >>>>> >>>>>> When I'm executing the powershell command Disable-Mailbox in c# i >>>>>> get this >>>>>> exception: >>>>>> MapiExceptionLowLevelInitializationFailure: Unable to load >>>>>> exrpc32.dll or >>>>>> one of its dependent DLLs (extrace.dll, exchmem.dll, msvcr80.dll, >>>>>> etc) >>>>>> The mailbox is removed ok, butI get this exception. >>>>>> If I run the exact command in powershell, everything runs fine >>>>>> without >>>>>> exceptions. >>>>>> I'm running the code on a Vista x32 machine agains a Exchange >>>>>> 2007 >>>>>> x64 server. >>>>> What happens when you run your code on the Exchange Server itself? >>>>> >>>>> I suspect that you are using the 32-bit version of Exchange 2007 >>>>> on >>>>> your >>>>> Vista >>>>> box, right? Not sure if that is a supported environment. IIRC the >>>>> 32-bit >>>>> version is >>>>> for testing only and unsupported. >>>>> Are you using the same service pack level as your Exchange Server? >>>>> -- >>>>> SvenC >>> I have ASP pages that run the Disable-Mailbox command via C# on a >>> daily basis, and this error does not occur. >>> >>> Show us your code, and perhaps we can figure this out >>> Hello Mathias
I have verified that this code works fine on my Windows XP x86 box. Karl Show quoteHide quote > Hello Mathias, > > That is, I ran it on my mailbox server (Server 2k3, 64bit) > > I will try in XP 32 bit, once I install the Exchange Management tools. > > Karl > >> Hello Mathias, >> >> Sorry to take so long. >> >> Your code sample works flawlessly on my test bench (Exchange 2007 SP1 >> / RU7) >> >> Karl >> >>> Hi! >>> >>> Here's my code: >>> >>> RunspaceConfiguration rsConfig = RunspaceConfiguration.Create(); >>> PSSnapInException snapInException = null; >>> PSSnapInInfo info = >>> rsConfig.AddPSSnapIn("Microsoft.Exchange.Management.PowerShell.Admin >>> " >>> , >>> out >>> snapInException); >>> Runspace myRunSpace = RunspaceFactory.CreateRunspace(rsConfig); >>> myRunSpace.Open(); >>> Pipeline pipeLine = myRunSpace.CreatePipeline(); >>> Command myCommand = new Command("Disable-Mailbox"); >>> CommandParameter verbParam = new >>> CommandParameter("Identity",username); >>> myCommand.Parameters.Add(verbParam); >>> verbParam = new CommandParameter("Confirm",false); >>> myCommand.Parameters.Add(verbParam); >>> pipeLine.Commands.Add(myCommand); >>> Collection<PSObject> commandResults = pipeLine.Invoke(); >>> I have also tried to use script call: >>> Command("Disable-Mailbox -Identity " + username + " >>> -Confirm:$false", >>> true); >>> Any ideas? >>> /Mathias >>> "Karl Mitschke" wrote: >>> >>>> Hello Mathias, >>>> >>>>> Hi! >>>>> >>>>> I haven't tried to run the code on the production environment, but >>>>> I >>>>> will >>>>> test it. >>>>> This is as you say the 32bit version of Exchange 2007 on my Vista >>>>> machine. >>>>> It is strange that the powershell command works on my client if I >>>>> run >>>>> it in >>>>> a powershell window. It is only when I run it through c# that this >>>>> problem >>>>> occurs. >>>>> Serveral other powershell commands works ok through c# >>>>> I have the same path-level om my client as I have on the >>>>> production >>>>> server. >>>>> Any more ideas on what can cause this? >>>>> /Mathias >>>>> "SvenC" wrote: >>>>> >>>>>> Hi Mathias, >>>>>> >>>>>>> When I'm executing the powershell command Disable-Mailbox in c# >>>>>>> i >>>>>>> get this >>>>>>> exception: >>>>>>> MapiExceptionLowLevelInitializationFailure: Unable to load >>>>>>> exrpc32.dll or >>>>>>> one of its dependent DLLs (extrace.dll, exchmem.dll, >>>>>>> msvcr80.dll, >>>>>>> etc) >>>>>>> The mailbox is removed ok, butI get this exception. >>>>>>> If I run the exact command in powershell, everything runs fine >>>>>>> without >>>>>>> exceptions. >>>>>>> I'm running the code on a Vista x32 machine agains a Exchange >>>>>>> 2007 >>>>>>> x64 server. >>>>>> What happens when you run your code on the Exchange Server >>>>>> itself? >>>>>> >>>>>> I suspect that you are using the 32-bit version of Exchange 2007 >>>>>> on >>>>>> your >>>>>> Vista >>>>>> box, right? Not sure if that is a supported environment. IIRC the >>>>>> 32-bit >>>>>> version is >>>>>> for testing only and unsupported. >>>>>> Are you using the same service pack level as your Exchange >>>>>> Server? >>>>>> -- >>>>>> SvenC >>>> I have ASP pages that run the Disable-Mailbox command via C# on a >>>> daily basis, and this error does not occur. >>>> >>>> Show us your code, and perhaps we can figure this out >>>>
Other interesting topics
Exchange Web Services Migration
MAPI and Outlook Anywhere EWS and Exchange 2003 Retrive Email's From Exchange Server WebDAV connection using Forms Based Authentication Fails (Response asking for Basic Authntication?) Retrieving Tasks and Calendars from Exchange Server 2003 using .NE Auto reply from exchange using template (preserve the subject) EWS: Create meeting without accept or decline buttons How to close a message Using MAPI33 with Outlook 2007 installed?? |
|||||||||||||||||||||||