0
votes

I use a simple Get-ADGroup on this top level of our networks Active Directory and I get back the error "get-adgroup : cannot find an object with identity 'GroupName' under: Domain

I have tried to query the group using "Find" in Active Directory Users and Computers and it is only able to be found if set to search for Organizational Units, however if I try a Get-ADOrganizationalUnit with the name of the OU nothing will populate.

2
"the name is spelled right and everything." - clearly not everything, or it would work. But I'm close voting for not enough detail, because except for listing every imaginable failure mode, and hoping to luck out and pick the right one, there's no way to answer this. Encoding issue? Invisible characters? Multiple domains? Not using -ExpandProperty and an object being converted to a string in an unexpected way? Stuck in a PSSession on a different domain controller? Custom security restrictions in AD? Who knows? - TessellatingHeckler
Is GroupName a property or is it Identity? I did a find on technet.microsoft.com/en-au/library/ee617196.aspx and groupname didn't come up. Get-AdGroup -Identity <nameofgroup>? - Tim Haintz
Ensure the group is not a local group - as get-adgroup will not recognise local groups. Also - is the group located in an OU that you have permissions to? - Itchydon

2 Answers

0
votes

Most of the time, the group name you see from your front-end is not actually what the group name is in ActiveDirectory.

I suggest you install Active Directory Users and Computers

Query the group based on the current group name you think it is.

Open the properties and see what the actual group name is.

The fact that Get-AdGroup returned that error means you have the wrong group name.

0
votes

For Get-ADGroup you have to use the objects GUID or the DistinguishedName. What I typically do with this is something like this:

Get-DistributionGroup -identity "GroupName" | select -Expand DistinguishedName | Get-ADGroup