List all AD enabled staff users

From MyWiki
Revision as of 13:21, 1 September 2016 by George2 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Get-ADUser   -LDAPFilter "(&(employeetype=staff)(!userAccountControl:1.2.840.113556.1.4.803:=2))"     -Properties office, sAMAccountName, givenName, sn, employeetype,uid | Select office, sAMAccountName, givenName, sn, employeetype, @{n="uid";e={[string]$_.uid}} |    Export-Csv -Path c:\Scripts\Users.csv -NoTypeInformation