E2007, management shell and impersonate requests RRS feed

  • Question

  • Hi folks,

    I have csharp code which use new-mailbox and add-mailboxpermission cmdlets. But by some reason during the invoke for the cmdlet "add-mailboxpermission" the code is crashing. From the event log I can find the following event:


    Event Type:   Error
    Event Source:  MSExchange Common
    Event Category: Devices
    Event ID:    4999
    Watson report about to be sent to dw20.exe for process id: 436, with parameters: E12, c-RTL-x86, 08.03.0137.000
    , w3wp, M.E.D.Directory, M.E.D.D.ConnectionPoolManager.BlockImpersonatedCallers, M.E.Common.FailFastException,
     e95e, 08.03.0157.000. ErrorReportingEnabled: False


    Strange thing is that I don't have this problem with enable-mailbox cmdlet.

    I have tried to get this fixed by adding the following lines into web.config:

        <legacyImpersonationPolicy enable="false" />
        <alwaysFlowImpersonationPolicy enable="true" />

    But that has been not helped. In the same web.config I have also to the following lines to get impersonating to work:

        <identity impersonate="true"/>
        <authentication mode="Windows"/>

    This is a domain's member server (W2003 32 bit) with Exchange management tools only (E2007 SP3 and update rollup 3 v2 installed). And powershell is version 2.0. So this server is not the domain controller nor having any Exchange server role.

    Application pool where this program is running use "network service" as identifier and the IIS application requires authentication, but so far only with plain text.

    In my mind this should be solved already on:

    Unfortunately I cannot any more details about the: "M.E.D.D.ConnectionPoolManager.BlockImpersonatedCallers" or it is hard to understand why "enable-mailbox" is working, but not "add-mailboxpermission".

    Anyone have any thoughts about this? Or can I setup mailbox permissions without using the cmdlets? I assume cmdlets are using also some undocumented .dlls :)



    Wednesday, June 22, 2011 8:53 AM

All replies

  • Petri,

      Did you ever get this solved, I am having a similar issue and I do not know why.

      I get this error when my script executes any exchange commend, but I do not get this error if I execute the same command from the same console by typing it in...


    Dave M
    Tuesday, November 15, 2011 5:08 PM
  • I added the -domaincontroller parameter and it seems to be working...
    Dave M
    Tuesday, November 15, 2011 9:27 PM

    Sorry, but I had troubles only with few cmdlets, and I still have. Funny thing is that I build up a test server. But on the production I'm unable to use "add-mailboxpermission" but "enable-mailbox" is working. On my test server "add-mailboxpermission"is working, but not "enable-mailbox". You have no idea how many grey hairs I have got because of this :-/

    Thursday, November 17, 2011 10:33 PM