Cookie Consent by Free Privacy Policy Generator
Privacy
Polipone
<ottobre 2024>
lunmarmergiovensabdom
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
Immagini

Powershell - Elenco utenti di un gruppo Active directory


Import-Module ServerManager
Add-WindowsFeature RSAT-AD-Powershell
$Root = [ADSI]''
$searcher = new-object System.DirectoryServices.DirectorySearcher($root)
$searcher.SearchScope = "Subtree"
$ADGroup=Get-ADGroup "My Group Name"
$ADGroupCN=$ADGroup.DistinguishedName
$searcher.filter = "(& (objectCategory=user)(memberOf=$ADGroupCN))"
$Users = $searcher.FindAll()
$Users.Properties.name
$Users.properties.samaccountname




Tutti gli attributi dell'oggetto utente di ADSI li potete trovare a questo link

Notifiche