Last active
December 11, 2015 21:38
-
-
Save belotn/4663666 to your computer and use it in GitHub Desktop.
Récupérer rapidement les privilèges Citrix d'un compte ActiveDirectory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Searcher = New-Object DirectoryServices.DirectorySearcher | |
$Searcher.Filter = '(&(objectCategory=User)(sAMAccountName=MyUser))' | |
$Searcher.SearchRoot = 'LDAP://dc=ds,dc=example,dc=com' | |
$user = [adsi]$Searcher.FindAll()[0].Path | |
$groups = @($user.memberOf | % { ([adsi]"LDAP://$_").Cn }) | |
$admin = @(Get-xaadministrator | select AdministratorName | % { $_.AdministratorNAme.Split()[0] }) | |
$mygroup = compare-object $groups $admin -ExcludeDifferent -IncludeEqual -Passthru |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment