adding contact object DN to Managedby attribute of a group

Dipronil Dey 0 Reputation points
2024-06-27T06:26:17.1333333+00:00

Hello,

I am getting an error while adding a contact object DN to Managedby parameter of a group via powershell. I am doing the same with an user DN, it works fine, but in case of contact object, getting error as "set-adgroup -Identity 'TestGroup' -ManagedBy "CN=TestContact,OU=Contacts,OU=Business,DC=ultradey26,DC=club"

set-adgroup : Identity info provided in the extended attribute: 'ManagedBy' could not be resolved. Reason: 'Cannot find an object with identity:

'CN=TestContact,OU=Contacts,OU=Business,DC=ultradey26,DC=club' under: 'DC=ultradey26,DC=club'.'.

At line:1 char:1"

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,121 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Daisy Zhou 20,556 Reputation points Microsoft Vendor
    2024-06-27T10:42:44.6233333+00:00

    Hello

    Thank you for posting in Q&A forum.

    After running the command below, I get the same error.

    Set-ADGroup -Identity "TestGroup" -ManagedBy (Get-ADObject -Filter { Name -eq "TsetC" } | Select-Object -ExpandProperty DistinguishedName)

    User's image

    After running the command below:

    Set-ADGroup -Identity "CN=TestGroup,OU=OU1,DC=a,DC=com" -ManagedBy (Get-ADObject -Filter {Name -eq "CN=TsetC,OU=OU1,DC=a,DC=com" -and ObjectClass -eq "Contact"} | Select-Object -ExpandProperty DistinguishedName)

    User's image

    There is no error, but the setting is not added successfully.

    User's image

    From the link below, I understand the ManagedBy should be user or user group.

    User's image

    https://video2.skills-academy.com/en-us/powershell/module/activedirectory/set-adgroup?view=windowsserver2022-ps

    I hope the information above is helpful.

    If you have any questions or concerns, please feel free to let us know.

    Best Regards,

    Daisy Zhou

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments