Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $users = Get-ADUser -Filter * -Properties * -SearchBase "OU=something,DC=domain,DC=net"
- foreach ($user in $users) {
- $file = $user.Name + '_ACL'
- (Get-ADUser –Identity $user –Properties MemberOf).MemberOf -replace '^CN=([^,]+),OU=.+$','$1' | Out-File c:PSResults$file.txt
- }
- (&(&(&(&(objectCategory=user)(userAccountControl=512)))))
- $users = Get-ADUser -Filter * -Properties * -SearchBase "OU=something,DC=domain,DC=net"
- foreach ($user in $users) {
- $file = $user.Name + '_ACL'
- (Get-ADUser –Identity $user –Properties MemberOf).MemberOf -replace '^CN=([^,]+),OU=.+$','$1' | Export-CSV -path c:PSResults$file.csv -NoTypeInformation
- }
- Get-ADPrincipalGroupMembership USERNAME | Select Name | Export-CSV -path C:Tempfile.csv -NoTypeInformation
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement