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)
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)
There is no error, but the setting is not added successfully.
From the link below, I understand the ManagedBy should be user or user group.
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.