Slow performance when executing cmdlets through Powershell from a management server
We are trying to execute some management cmdlets to manage our distribution groups. We have a server having the Exchange Management Tools installed, not hosting any other Exchange Server roles. The command works well from an exchange server. When executing for example set-distributiongroup it takes some minutes to execute the command. It succeeds eventually . When running the command within a few minutes after the first try, it works fast. But when waiting for 5 or 6 minutes, it is slow again.
I ran the command with the verbose option, below you will find the output. The bold part is taking so long. This part is skipped when executing the command for the second time within some minutes:
Set-DistributionGroup <group-emailaddress> -AcceptMessagesOnlyFrom @{add=“<user-emailaddress>”} -verbose
VERBOSE: [13:03:12.395 GMT] Set-DistributionGroup : Runspace context: Executing user:
<executinguser>, Executing user organization: , Current
organization: , RBAC-enabled: Disabled.
VERBOSE: [13:03:12.399 GMT] Set-DistributionGroup : Active Directory session settings for
‘Set-DistributionGroup’ are: View Entire Forest: ‘True’,
VERBOSE: [13:03:12.399 GMT] Set-DistributionGroup : Beginning processing Set-DistributionGroup
VERBOSE: [13:03:12.406 GMT] Set-DistributionGroup : Instantiating handler with index 0 for cmdlet
extension agent “Rus Agent”.
VERBOSE: [13:03:12.406 GMT] Set-DistributionGroup : Instantiating handler with index 1 for cmdlet
extension agent “Admin Audit Log Agent”.
VERBOSE: [13:03:12.423 GMT] Set-DistributionGroup : Current ScopeSet is: { Recipient Read Scope:{{,
}}, Recipient Write Scopes:{{, }}, Configuration Read Scope:{{, }}, Configuration Write
Scope(s):{{, }, }, Exclusive Recipient Scope(s):{}, Exclusive Configuration Scope(s):{} }
VERBOSE: [13:03:12.431 GMT] Set-DistributionGroup : Searching objects
“<group-emailaddress>” of type “ADGroup” under the root “$null”.
VERBOSE: [13:03:12.437 GMT] Set-DistributionGroup : Previous operation run on global catalog server
‘<GCserver>’.
VERBOSE: [13:03:12.437 GMT] Set-DistributionGroup : Rereading object
“<groupadobject>” of type “ADGroup” under the root
“<cngroupadobject>“.
VERBOSE: [13:03:12.437 GMT] Set-DistributionGroup : Previous operation run on domain controller
‘<DC>’.
VERBOSE: [13:03:12.437 GMT] Set-DistributionGroup : Searching objects
“<useremailaddress>“ of type “ADRecipient” under the root “$null”.
VERBOSE: [13:03:12.453 GMT] Set-DistributionGroup : Previous operation run on global catalog server
‘<GCserver>’.
VERBOSE: [13:03:12.453 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] Update
Recipient object “<recipientadobject>“ with
ConfigurationDomainController “<null>”, DomainController “<DC>”, GlobalCatalog
“<null>”.
VERBOSE: [13:03:12.453 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] Read Address
List for organization “” from domain controller <DC>.
VERBOSE: [13:03:12.462 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] Found
Address List “”.
VERBOSE: [13:03:12.462 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] Found
Address List “”.
VERBOSE: [13:03:12.462 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] Found
Address List “Default Global Address List”.
VERBOSE: [13:03:12.469 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] Found
Address List “All Rooms”.
VERBOSE: [13:03:12.469 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] Found
Address List “xxxx”.
VERBOSE: [13:03:12.469 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] Found
Address List “xxxx”.
VERBOSE: [13:03:12.469 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] Found
Address List “All Contacts”.
VERBOSE: [13:03:12.469 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] Found
Address List “Public Folders”.
VERBOSE: [13:03:12.469 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] Found
Address List “All Distribution Lists”.
VERBOSE: [13:03:12.469 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] Found
Address List “External”.
VERBOSE: [13:03:12.485 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] Found
Address List “All Users”.
VERBOSE: [13:03:12.485 GMT] Set-DistributionGroup : Processing object
“<groupadobject>”.
VERBOSE: [13:03:12.485 GMT] Set-DistributionGroup : Admin Audit Log: Entered Handler:Validate.
VERBOSE: [13:03:12.493 GMT] Set-DistributionGroup : Admin Audit Log: Entered
ClassFactory:InitializeConfig.
VERBOSE: [13:07:03.950 GMT] Set-DistributionGroup : Admin Audit Log: Exited
ClassFactory:InitializeConfig.
VERBOSE: [13:07:03.966 GMT] Set-DistributionGroup : Admin Audit Log: Exited Handler:Validate.
VERBOSE: Setting distribution group “<group-emailaddress>”.
VERBOSE: [13:07:03.966 GMT] Set-DistributionGroup : Resolved current organization: .
VERBOSE: [13:07:03.966 GMT] Set-DistributionGroup : PreInternalProcessRecord on cmdlet extension
agent index ‘0’ returned object changed flag as ‘False’.
VERBOSE: [13:07:03.966 GMT] Set-DistributionGroup : PreInternalProcessRecord on cmdlet extension
agent index ‘1’ returned object changed flag as ‘False’.
VERBOSE: [13:07:03.966 GMT] Set-DistributionGroup : No properties changed for the object
“<groupadobject>”.
WARNING: The command completed successfully but no settings of
‘<groupadobject>’ have been modified.
VERBOSE: [13:07:03.966 GMT] Set-DistributionGroup : Saving object
“<groupadobject>” of type “ADGroup” and state “Unchanged”.
VERBOSE: [13:07:03.982 GMT] Set-DistributionGroup : Previous operation run on domain controller
‘<DC>’.
VERBOSE: [13:07:03.982 GMT] Set-DistributionGroup : Admin Audit Log: Entered Handler:OnComplete.
VERBOSE: [13:07:03.982 GMT] Set-DistributionGroup : Admin Audit Log: Exited Handler:OnComplete.
VERBOSE: [13:07:03.982 GMT] Set-DistributionGroup : Ending processing Set-DistributionGroup
Some got an idea what could be causing this delay?
Using the lastest Exchange 2019 versions with updates.
We are trying to execute some management cmdlets to manage our distribution groups. We have a server having the Exchange Management Tools installed, not hosting any other Exchange Server roles. The command works well from an exchange server. When executing for example set-distributiongroup it takes some minutes to execute the command. It succeeds eventually . When running the command within a few minutes after the first try, it works fast. But when waiting for 5 or 6 minutes, it is slow again. I ran the command with the verbose option, below you will find the output. The bold part is taking so long. This part is skipped when executing the command for the second time within some minutes:Set-DistributionGroup <group-emailaddress> -AcceptMessagesOnlyFrom @{add=“<user-emailaddress>”} -verboseVERBOSE: [13:03:12.395 GMT] Set-DistributionGroup : Runspace context: Executing user:<executinguser>, Executing user organization: , Currentorganization: , RBAC-enabled: Disabled.VERBOSE: [13:03:12.399 GMT] Set-DistributionGroup : Active Directory session settings for’Set-DistributionGroup’ are: View Entire Forest: ‘True’,VERBOSE: [13:03:12.399 GMT] Set-DistributionGroup : Beginning processing Set-DistributionGroupVERBOSE: [13:03:12.406 GMT] Set-DistributionGroup : Instantiating handler with index 0 for cmdletextension agent “Rus Agent”.VERBOSE: [13:03:12.406 GMT] Set-DistributionGroup : Instantiating handler with index 1 for cmdletextension agent “Admin Audit Log Agent”.VERBOSE: [13:03:12.423 GMT] Set-DistributionGroup : Current ScopeSet is: { Recipient Read Scope:{{,}}, Recipient Write Scopes:{{, }}, Configuration Read Scope:{{, }}, Configuration WriteScope(s):{{, }, }, Exclusive Recipient Scope(s):{}, Exclusive Configuration Scope(s):{} }VERBOSE: [13:03:12.431 GMT] Set-DistributionGroup : Searching objects”<group-emailaddress>” of type “ADGroup” under the root “$null”.VERBOSE: [13:03:12.437 GMT] Set-DistributionGroup : Previous operation run on global catalog server‘<GCserver>’.VERBOSE: [13:03:12.437 GMT] Set-DistributionGroup : Rereading object“<groupadobject>” of type “ADGroup” under the root“<cngroupadobject>“.VERBOSE: [13:03:12.437 GMT] Set-DistributionGroup : Previous operation run on domain controller‘<DC>’.VERBOSE: [13:03:12.437 GMT] Set-DistributionGroup : Searching objects“<useremailaddress>“ of type “ADRecipient” under the root “$null”.VERBOSE: [13:03:12.453 GMT] Set-DistributionGroup : Previous operation run on global catalog server'<GCserver>’.VERBOSE: [13:03:12.453 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] UpdateRecipient object “<recipientadobject>“ withConfigurationDomainController “<null>”, DomainController “<DC>”, GlobalCatalog”<null>”.VERBOSE: [13:03:12.453 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] Read AddressList for organization “” from domain controller <DC>.VERBOSE: [13:03:12.462 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] FoundAddress List “”.VERBOSE: [13:03:12.462 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] FoundAddress List “”.VERBOSE: [13:03:12.462 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] FoundAddress List “Default Global Address List”.VERBOSE: [13:03:12.469 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] FoundAddress List “All Rooms”.VERBOSE: [13:03:12.469 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] FoundAddress List “xxxx”.VERBOSE: [13:03:12.469 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] FoundAddress List “xxxx”.VERBOSE: [13:03:12.469 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] FoundAddress List “All Contacts”.VERBOSE: [13:03:12.469 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] FoundAddress List “Public Folders”.VERBOSE: [13:03:12.469 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] FoundAddress List “All Distribution Lists”.VERBOSE: [13:03:12.469 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] FoundAddress List “External”.VERBOSE: [13:03:12.485 GMT] Set-DistributionGroup : [Microsoft Cmdlet Extension Agent] FoundAddress List “All Users”.VERBOSE: [13:03:12.485 GMT] Set-DistributionGroup : Processing object”<groupadobject>”.VERBOSE: [13:03:12.485 GMT] Set-DistributionGroup : Admin Audit Log: Entered Handler:Validate.VERBOSE: [13:03:12.493 GMT] Set-DistributionGroup : Admin Audit Log: EnteredClassFactory:InitializeConfig.VERBOSE: [13:07:03.950 GMT] Set-DistributionGroup : Admin Audit Log: ExitedClassFactory:InitializeConfig.VERBOSE: [13:07:03.966 GMT] Set-DistributionGroup : Admin Audit Log: Exited Handler:Validate.VERBOSE: Setting distribution group “<group-emailaddress>”.VERBOSE: [13:07:03.966 GMT] Set-DistributionGroup : Resolved current organization: .VERBOSE: [13:07:03.966 GMT] Set-DistributionGroup : PreInternalProcessRecord on cmdlet extensionagent index ‘0’ returned object changed flag as ‘False’.VERBOSE: [13:07:03.966 GMT] Set-DistributionGroup : PreInternalProcessRecord on cmdlet extensionagent index ‘1’ returned object changed flag as ‘False’.VERBOSE: [13:07:03.966 GMT] Set-DistributionGroup : No properties changed for the object”<groupadobject>”.WARNING: The command completed successfully but no settings of'<groupadobject>’ have been modified.VERBOSE: [13:07:03.966 GMT] Set-DistributionGroup : Saving object”<groupadobject>” of type “ADGroup” and state “Unchanged”.VERBOSE: [13:07:03.982 GMT] Set-DistributionGroup : Previous operation run on domain controller'<DC>’.VERBOSE: [13:07:03.982 GMT] Set-DistributionGroup : Admin Audit Log: Entered Handler:OnComplete.VERBOSE: [13:07:03.982 GMT] Set-DistributionGroup : Admin Audit Log: Exited Handler:OnComplete.VERBOSE: [13:07:03.982 GMT] Set-DistributionGroup : Ending processing Set-DistributionGroup Some got an idea what could be causing this delay? Using the lastest Exchange 2019 versions with updates. Read More