Jan 19 2024 02:16 AM
【I have a Exchange Online Hierarchical books below:】
Group1
╚Group2
╚Group3
╚Group4
【The group all create by powershell script below and work fine till today】
$objectDistriGroup = $null
$objectDistriGroup = Get-DistributionGroup - Identity $stringAlias 2>&1
#Check Alias
If($objectDistriGroup -eq $null){
$objectDistriGroup = Get-DistributionGroup - Identity $stringName 2>&1
#Check Name
If($objectDistriGroup -eq $null){
$objectDistriGroup = New-DistributionGroup -Name $stringName -Alias $stringAlias -Confirm:$false 2>&1
$objectDistriGroup | Set-Group -IsHierarchicalGroup $true - SeniorityIndex $stringSeniorityIndex
#Add to parent group
Add-DistributionGroupMember - Identity $stringParent -Member $stringAlias -Confirm:$false 2>&1
}
}
)
【Today I'm trying to add "Group5" in "Group1", but got the output below in my log file】
PS>error(Invoke-WebRequest): "{"error":{"code":"NotFound","message":"Error executing cmdlet","details":{"code":"Context","target":"","message":"{¥"ClassName¥":¥"Microsoft.Exchange.Configuration.Tasks.ManagementObjectNotFoundException¥",¥"Message¥":¥"....................................The operation couldn't be performed because object '{0}' couldn't be found on '{1}'...................................."internalexception":{"message":"Exception of type 'Microsoft.Exchange.Management.PSDirectInvoke.DirectInvokeCmdletExecutionException' was thrown."
【After some test, looks like "Get-DistributionGroup" cause these error message.】
But when I use cmdlet "Get-DistributionGroup - Identity Group5"
It return "Group5" information as normal.
DId I missed something update?
How to fix this error.
Thank you so much, Any information will be appreciated!
Jan 19 2024 09:13 AM
Have you tried using the full identity path for "Group5" within your script, like "Get-DistributionGroup -Identity Group1/Group5"? It might help resolve the object not found error. Double-checking the Invisible Text hierarchical structure and ensuring all dependencies are in place could also be beneficial. Good luck troubleshooting.
Aug 24 2024 11:16 PM - edited Aug 24 2024 11:16 PM
The "Get-DistributionGroup" error in Exchange Server often occurs when there is a misconfiguration in the permissions or when the Exchange Management Shell cannot retrieve the distribution group information. Common causes include insufficient user rights, corrupted Active Directory objects, or outdated PowerShell modules. To resolve this issue, ensure proper permissions, verify the group’s existence in Active Directory, and update your Exchange Management Shell. Regular maintenance and careful management of permissions can prevent such errors. Uses in Urdu
Sep 13 2024 04:05 AM
Sep 28 2024 04:51 AM