-3

I have an OU called "InactiveUsers", to which I move all users that will be inactivated in my organization. And I'm trying to list all the groups in my domain, having at least one user OU (InactiveUsers) as a member.

But do not know how to do, someone could help me. Thanks.

Wesley
  • 245
  • 6
  • 13

1 Answers1

1
Get-ADUser -Filter * -SearchBase "<OU=InactiveUsers,etc..>" | Select -ExpandProperty Memberof | select -Unique | sort

That's the basic idea using the MS-provided AD Module.

jbsmith
  • 1,616
  • 13
  • 10