Forum Discussion

JasonPPF's avatar
JasonPPF
Copper Contributor
Jan 19, 2024

Get-DistributionGroup error

【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!

  • danishseo036's avatar
    danishseo036
    Copper Contributor

     

     

    It seems you're encountering a Get-DistributionGroup error while trying to add "Group5" to "Group1." Double-check the identities of $stringParent, $stringAlias, and $stringName to ensure they’re correct. Also, verify your permissions and consider waiting a few minutes for changes to propagate. If issues persist, you may need to update your PowerShell module or consult Microsoft support, similar to how aluminum foil paper manufacturers manage their production processes for efficiency.

    JasonPPF 

  • danishseo036's avatar
    danishseo036
    Copper Contributor

    JasonPPF 

     

    Have you tried using the full file path for your project within Text , like selecting "Project1/Clip5" instead of just "Clip5"? It might help resolve the media not found error. Double-checking the Thecapcut structure and ensuring all media dependencies are intact could also be beneficial. Good luck troubleshooting!

     

  • arslan795's avatar
    arslan795
    Copper Contributor
    It seems you’re encountering a "NotFound" error when trying to add "Group5" to "Group1," despite being able to retrieve "Group5" using Get-DistributionGroup. This may indicate an issue with how the script handles the $stringParent variable, which should refer to "Group1." Ensure that $stringParent is set correctly and that "Group1" exists. Additionally, check for any recent updates or changes in permissions that might affect group operations. If the issue persists, consider running the script with detailed logging or error handling to capture more context about the failure.
    https://ggsaloncorvallis.com/hair_salon/


  • afzalyunas's avatar
    afzalyunas
    Copper Contributor

    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

  • jhoncarles725's avatar
    jhoncarles725
    Copper Contributor

    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.

    • greenhomeplan's avatar
      greenhomeplan
      Copper Contributor
      Sometimes, simply restarting your PowerShell session or reconnecting to your Exchange server can resolve temporary issues.
      If these steps don’t resolve the issue, consult the Microsoft documentation or reach out to Microsoft Support for further assistance.

Resources