none
warning message while running Add-MailboxPermission cmdlet RRS feed

  • Question

  • Hi I am receiving below warning message while running Add-MailboxPermission cmdlet and Remove-MailboxPermission cmdlets. I did some research with this error but couldn't figure-out the exact problem.

    One thing I could notice is, this is happening only from a few servers. This problem may be server specific. Anyone experienced similar thing or have any suggestions to understand this warning message?

    WARNING: The cmdlet extension agent with the index 0 has thrown an exception in OnComplete(). The exception is:

    System.InvalidOperationException: Operation is not valid due to the current state of the object.

       at Microsoft.Exchange.Data.Storage.ExchangePrincipal.get_ServerFullyQualifiedDomainName()

       at Microsoft.Exchange.Data.Storage.MailboxSession.Initialize(MapiStore linkedStore, LogonType logonType,

    ExchangePrincipal owner, DelegateLogonUser delegateUser, Object identity, OpenMailboxSessionFlags flags,

    GenericIdentity auxiliaryIdentity)

       at Microsoft.Exchange.Data.Storage.MailboxSession.<>c__DisplayClass12.<CreateMailboxSession>b__10(MailboxSession

    mailboxSession)

       at Microsoft.Exchange.Data.Storage.MailboxSession.InternalCreateMailboxSession(LogonType logonType,

    ExchangePrincipal owner, CultureInfo cultureInfo, String clientInfoString, IAccountingObject budget, Action`1

    initializeMailboxSession, InitializeMailboxSessionFailure initializeMailboxSessionFailure)

       at Microsoft.Exchange.Data.Storage.MailboxSession.CreateMailboxSession(LogonType logonType, ExchangePrincipal owner,

     DelegateLogonUser delegateUser, Object identity, OpenMailboxSessionFlags flags, CultureInfo cultureInfo, String

    clientInfoString, PropertyDefinition[] mailboxProperties, IList`1 foldersToInit, GenericIdentity auxiliaryIdentity,

    IAccountingObject budget)

       at Microsoft.Exchange.Data.Storage.MailboxSession.ConfigurableOpen(ExchangePrincipal mailbox, MailboxAccessInfo

    accessInfo, CultureInfo cultureInfo, String clientInfoString, LogonType logonType, PropertyDefinition[]

    mailboxProperties, InitializationFlags initFlags, IList`1 foldersToInit, IAccountingObject budget)

       at Microsoft.Exchange.Data.Storage.MailboxSession.OpenAsSystemService(ExchangePrincipal mailboxOwner, CultureInfo

    cultureInfo, String clientInfoString)

       at Microsoft.Exchange.ProvisioningAgent.MailboxLoggerFactory.XsoMailer.Log(AdminLogMessageData data,

    LogMessageDelegate logMessage)

       at Microsoft.Exchange.ProvisioningAgent.AdminLogProvisioningHandler.OnComplete(Boolean succeeded, Exception e)

       at Microsoft.Exchange.Provisioning.ProvisioningLayer.OnComplete(Task task, Boolean succeeded, Exception exception)


    Thanks,

    Sitaram Pamarthi

    Blog : http://techibee.com

    Follow on Twitter

    This posting is provided AS IS with no warranties or gurentees,and confers no rights

    Wednesday, July 18, 2012 10:46 AM

Answers

  • Ok, I figured out this.

    First of all, the procedure I am following to import Exchange cmdlets into normal powershell window is partially wrong. Along with importing snap-in there are two more other things I need to do.

    1. Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
    2. . $env:ExchangeInstallPath\bin\RemoteExchange.ps1 #The script is dot sourced here
    3. Connect-ExchangeServer -auto

    Source: http://www.mikepfeiffer.net/2010/02/managing-exchange-2010-with-remote-powershell/

    It solved my problem.


    Thanks,

    Sitaram Pamarthi

    Blog : http://techibee.com

    Follow on Twitter

    This posting is provided AS IS with no warranties or gurentees,and confers no rights


    • Marked as answer by pamarths Monday, July 23, 2012 3:27 PM
    • Edited by pamarths Monday, July 23, 2012 3:27 PM
    Monday, July 23, 2012 3:27 PM

All replies

  • Hello,

    Could you explain more detail for your question?

    What is your meaning of "this is happening only from a few servers"?

    If you mean this issue only occur on some servers, did you use the same account to logon the servers?

    You also can run this command to have a try:

    Set-AdminAuditLogConfig -AdminAuditLogEnabled $False

    Thanks,

    Evan


    Evan Liu

    TechNet Community Support

    Thursday, July 19, 2012 9:15 AM
    Moderator
  • Apologies for not being clear.

    >What is your meaning of "this is happening only from a few servers"?

    From a few servers where Exchange Management tools installed.

    >If you mean this issue only occur on some servers, did you use the same account to logon the servers?

    Yes, I used the same account.

    I will try your Set-AdminAuditLogConfig suggestion and update the details here.


    Thanks,

    Sitaram Pamarthi

    Blog : http://techibee.com

    Follow on Twitter

    This posting is provided AS IS with no warranties or gurentees,and confers no rights

    Monday, July 23, 2012 2:00 PM
  • Evan, I think I don't want to change the AdminAudit level as that is something global and affects everyone.

    While troubleshooting the issue, I noticed that, this warning message is appearing only if I try from a powershell window with Exchange Snap-in(Microsoft.Exchange.Management.PowerShell.E2010) added. I am not seeing any warnings when running the same command from Exchange Management Shell with same login on same host.

    Is this anything to do with the Exchange Snap-in? Exchange Shell uses different interface to talk to Exchange?

    Please advise.


    Thanks,

    Sitaram Pamarthi

    Blog : http://techibee.com

    Follow on Twitter

    This posting is provided AS IS with no warranties or gurentees,and confers no rights

    Monday, July 23, 2012 2:21 PM
  • Ok, I figured out this.

    First of all, the procedure I am following to import Exchange cmdlets into normal powershell window is partially wrong. Along with importing snap-in there are two more other things I need to do.

    1. Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
    2. . $env:ExchangeInstallPath\bin\RemoteExchange.ps1 #The script is dot sourced here
    3. Connect-ExchangeServer -auto

    Source: http://www.mikepfeiffer.net/2010/02/managing-exchange-2010-with-remote-powershell/

    It solved my problem.


    Thanks,

    Sitaram Pamarthi

    Blog : http://techibee.com

    Follow on Twitter

    This posting is provided AS IS with no warranties or gurentees,and confers no rights


    • Marked as answer by pamarths Monday, July 23, 2012 3:27 PM
    • Edited by pamarths Monday, July 23, 2012 3:27 PM
    Monday, July 23, 2012 3:27 PM
  • even after I run all three of the commanges above, I still receive the error. I am unable to find any additional resources addressing this situation. I know this thread is old, but anyone have any ideas?


    WARNING: The cmdlet extension agent with the index 5 has thrown an exception in OnComplete(). The exception is:
    System.InvalidOperationException: Operation is not valid due to the current state of the object.
       at Microsoft.Exchange.Data.Storage.ExchangePrincipal.get_ServerFullyQualifiedDomainName()
       at Microsoft.Exchange.Data.Storage.MailboxSession.Initialize(MapiStore linkedStore, LogonType logonType,
    ExchangePrincipal owner, DelegateLogonUser delegateUser, Object identity, OpenMailboxSessionFlags flags,
    GenericIdentity auxiliaryIdentity)
       at Microsoft.Exchange.Data.Storage.MailboxSession.<>c__DisplayClass12.<CreateMailboxSession>b__10(MailboxSession
    mailboxSession)
       at Microsoft.Exchange.Data.Storage.MailboxSession.InternalCreateMailboxSession(LogonType logonType,
    ExchangePrincipal owner, CultureInfo cultureInfo, String clientInfoString, IAccountingObject budget, Action`1
    initializeMailboxSession, InitializeMailboxSessionFailure initializeMailboxSessionFailure)
       at Microsoft.Exchange.Data.Storage.MailboxSession.CreateMailboxSession(LogonType logonType, ExchangePrincipal owner,
     DelegateLogonUser delegateUser, Object identity, OpenMailboxSessionFlags flags, CultureInfo cultureInfo, String
    clientInfoString, PropertyDefinition[] mailboxProperties, IList`1 foldersToInit, GenericIdentity auxiliaryIdentity,
    IAccountingObject budget)
       at Microsoft.Exchange.Data.Storage.MailboxSession.ConfigurableOpen(ExchangePrincipal mailbox, MailboxAccessInfo
    accessInfo, CultureInfo cultureInfo, String clientInfoString, LogonType logonType, PropertyDefinition[]
    mailboxProperties, InitializationFlags initFlags, IList`1 foldersToInit, IAccountingObject budget)
       at Microsoft.Exchange.Data.Storage.MailboxSession.OpenAsSystemService(ExchangePrincipal mailboxOwner, CultureInfo
    cultureInfo, String clientInfoString)
       at Microsoft.Exchange.ProvisioningAgent.MailboxLoggerFactory.XsoMailer.Log(AdminLogMessageData data,
    LogMessageDelegate logMessage)
       at Microsoft.Exchange.ProvisioningAgent.AdminLogProvisioningHandler.OnComplete(Boolean succeeded, Exception e)
       at Microsoft.Exchange.Provisioning.ProvisioningLayer.OnComplete(Task task, Boolean succeeded, Exception exception)

    Tuesday, December 18, 2012 2:51 PM
  • Doesn't work for me, too.

    Get-MailboxAutoReplyConfiguration user
    WARNING: An unexpected error has occurred and a Watson dump is being generated: Operation is not valid due to the
    current state of the object.
    
    Get-MailboxAutoReplyConfiguration : Operation is not valid due to the current state of the object.
    At line:1 char:34 + Get-MailboxAutoReplyConfiguration <<<<  user
    + CategoryInfo          : NotSpecified: (:) [Get-MailboxAutoReplyConfiguration], InvalidOperationException
    + FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.Exchange.Management.StoreTasks.GetMailboxAuto
       ReplyConfiguration

    Tuesday, February 19, 2013 2:34 PM
  • I am also having this issue. Had a great script setup that allowed our helpdesk to easily add/remove mailbox folder permissions. it just stopped working, with the Operation is not valid error...

    Tried the above suggestions to no avail.

    Wednesday, February 27, 2013 6:20 PM
  • I recently upgraded from Exchange 2010 SP to SP3 and getting similar errors.

    WARNING: The cmdlet extension agent with the index 5 has thrown an exception in OnComplete(). The exception is:
    System.InvalidOperationException: Operation is not valid due to the current state of the object.
       at Microsoft.Exchange.Data.Storage.ExchangePrincipal.get_ServerFullyQualifiedDomainName()
       at Microsoft.Exchange.Data.Storage.MailboxSession.Initialize(MapiStore linkedStore, LogonType logonType,
    ExchangePrincipal owner, DelegateLogonUser delegateUser, Object identity, OpenMailboxSessionFlags flags,
    GenericIdentity auxiliaryIdentity)
       at Microsoft.Exchange.Data.Storage.MailboxSession.<>c__DisplayClass12.<CreateMailboxSession>b__10(MailboxSession
    mailboxSession)
       at Microsoft.Exchange.Data.Storage.MailboxSession.InternalCreateMailboxSession(LogonType logonType,
    ExchangePrincipal owner, CultureInfo cultureInfo, String clientInfoString, IAccountingObject budget, Action`1
    initializeMailboxSession, InitializeMailboxSessionFailure initializeMailboxSessionFailure)
       at Microsoft.Exchange.Data.Storage.MailboxSession.CreateMailboxSession(LogonType logonType, ExchangePrincipal owner,
     DelegateLogonUser delegateUser, Object identity, OpenMailboxSessionFlags flags, CultureInfo cultureInfo, String
    clientInfoString, PropertyDefinition[] mailboxProperties, IList`1 foldersToInit, GenericIdentity auxiliaryIdentity,
    IAccountingObject budget)

    I even confirmed my "Scripting Agent" was set to disable like other forums has suggested.

    Has anyone gotten this resolved?

    Friday, October 11, 2013 4:20 PM