0

i would like to get list of AD groups a user is a primary owner of. i have gone through this question already. But its not giving me the attribute/property whether the user is a primary owner of secondary owner.

How to get the above requirement. the below code is for getting the memberonly. ( Please correct me , if i am wrong)

Import-Module ActiveDirectory
(Get-ADUser userName –Properties MemberOf | Select-Object MemberOf).MemberOf
  • 1
    Primary owner; I am unfamiliar with this term? Do you mean direct member? If so, then you what you have above is correct. – Semicolon Apr 08 '21 at 18:16
  • @semicolon do we have a property / attribute name called "Primary Owner" or ""Secondary Owner" , so that we can easily get user's Groups having him as the "Group Owner " – CoderAffection Apr 08 '21 at 19:27
  • 1
    A user has a primary group; a group can have a manager (which may or may not be able to update membership). But - unless you have custom attributes- there is nothing named primary/secondary owner. What are you looking for? Are you sure you’re not referring to direct membership ( user is in group) and indirect/nested membership ( a user is in a group that is then a member of a separate group)? – Semicolon Apr 08 '21 at 19:37

1 Answers1

0

Get-ADGroup -Filter 'managedby -eq ""'

Get-ADGroup -LDAPFilter '(managedby=)'