PowerShell – Export AD Users to CSV

email me

Import-Module ActiveDirectory
Get-ADUser -Filter * -Properties * | Select-Object Name, DisplayName, Title, EmailAddress | export-csv -path c:\AD_Report\data.csv

 


Notes

Get-ADUser

AccountExpirationDate
accountExpires
AccountLockoutTime
AccountNotDelegated
AllowReversiblePasswordEncryption
AuthenticationPolicy
AuthenticationPolicySilo
BadLogonCount
badPasswordTime
badPwdCount
CannotChangePassword
CanonicalName
Certificates
City
CN
codePage
comment
Company
CompoundIdentitySupported
Country
countryCode
Created
createTimeStamp
Deleted
Department
departmentNumber
Description
DisplayName
DistinguishedName
Division
DoesNotRequirePreAuth
dSCorePropagationData
EmailAddress
EmployeeID
EmployeeNumber
employeeType
Enabled
Fax
fimPrefNameDisplay
fimWpoAcctCode
fimWpoAcctCodeName
fimWpoAddlDeptCd
fimwpoBusinessTitle
fimwpoBusinessUnit
fimwpoBusinessUnitDescription
fimWpoCompanyCode
fimWpoEmployeeStatus
fimWpoEmplRCD
fimWpoEmplType
fimWpoHireDate
fimWpoHomeCity
fimWpoJobCode
fimWpoJobFunction
fimWpoLocationNbr
fimWpoManagerLevel
fimWpoMgrEmployeeID
fimWpoMSSUser
fimWpoOriginalHireDate
fimWpoPerOrg
fimWpoPersonalMail
fimWpoPositionName
fimWpoPositionNumber
fimWpoPrefFirstName
fimWpoPrefLastName
fimWpoPrefMIddleName
fimWpoRegTemp
fimWpoRehireDate
fimWpoSState
fimWpoWebClockUser
GivenName
groupPriority
HomeDirectory
HomedirRequired
HomeDrive
HomePage
HomePhone
info
Initials
instanceType
internetEncoding
isDeleted
KerberosEncryptionType
L
LastBadPasswordAttempt
LastKnownParent
lastLogoff
lastLogon
LastLogonDate
lastLogonTimestamp
legacyExchangeDN
LockedOut
lockoutTime
logonCount
LogonWorkstations
mail
mailNickname
Manager
MemberOf
MNSLogonAccount
MobilePhone
Modified
modifyTimeStamp
mS-DS-ConsistencyGuid
msDS-User-Account-Control-Computed
msExchALObjectVersion
msExchPoliciesExcluded
msExchRecipientDisplayType
msExchVersion
msRTCSIP-ArchivingEnabled
msRTCSIP-FederationEnabled
msRTCSIP-InternetAccessEnabled
msRTCSIP-OptionFlags
msRTCSIP-PrimaryHomeServer
msRTCSIP-PrimaryUserAddress
msRTCSIP-UserEnabled
Name
nTSecurityDescriptor
ObjectCategory
ObjectClass
ObjectGUID
objectSid
Office
OfficePhone
Organization
OtherName
PasswordExpired
PasswordLastSet
PasswordNeverExpires
PasswordNotRequired
physicalDeliveryOfficeName
POBox
PostalCode
PrimaryGroup
primaryGroupID
PrincipalsAllowedToDelegateToAccount
ProfilePath
ProtectedFromAccidentalDeletion
proxyAddresses
pwdLastSet
SamAccountName
sAMAccountType
ScriptPath
sDRightsEffective
ServicePrincipalNames
showInAddressBook
SID
SIDHistory
SmartcardLogonRequired
sn
st
State
StreetAddress
Surname
targetAddress
telephoneNumber
Title
TrustedForDelegation
TrustedToAuthForDelegation
UseDESKeyOnly
userAccountControl
userCertificate
UserPrincipalName
uSNChanged
uSNCreated
whenChanged
whenCreated
wWWHomePage

 

tags: MrNetTek