Guest User

Untitled

a guest
Jun 13th, 2017
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $xScripts = Select-String -Path "\\dc\SYSVOL\domain.com\scripts\*.bat" -Pattern "x:"
  2. $uScripts = Select-String -Path "\\dc\SYSVOL\domain.com\scripts\*.bat" -Pattern "u:"
  3.  
  4. ForEach($Script in $xScripts){
  5.     $filter = "{(scriptpath -eq `"$($Script.filename)`") -and (DistinguishedName -notlike `"UX`")}"
  6.     Get-ADUser -Filter $filter
  7.     }
  8. $xUsers
Advertisement
Add Comment
Please, Sign In to add comment