About Me

My photo
HANUMANGARH, RAJASTHAN, India

Wednesday, 6 September 2023

Get user count from OU

 $allou = "DC=domain,DC=com"

$User = get-aduser -filter * -SearchBase $allou -SearchScope Subtree | Select @{Name="OU";Expression={$_.distinguishedName -match "cn=.*?,OU=(?<OU>.*)" | Out-Null;$Matches.OU}}

$User | Group -Property OU | Select Name,Count

No comments:

Post a Comment

Export contact from Justdial

  Extract Data From JustDial using Selenium Let us see how to extract data from Justdial using Selenium and Python. Justdial is a company th...