PowerShell Export AD user properties to CSV file

This wiki is based on the forum question Need Help Extracting AD Users to CSV

Requirement

PowerShell Export AD user properties to CSV

 

Get-ADUser -Identity 'SamAccountName'

Returns

Try these codes:



  
                                  
Get-ADuser -identity 'SamAccountName' -Properties *          
    
Get-ADUser -Identity 'SamAccountName' | Select -Property Name , Mail | FL          
              
Get-ADUser -Identity 'SamAccountName' -Properties *| Select -Property Name , Mail | FL          
              
Get-ADUser -Identity 'SamAccountName' -Properties *| Select -Property Name , Mail , Title , Department , OfficePhone |          

Export-CSV C:\Temp\User.csv -NoTypeInformation -Encoding UTF8

Enjoy PowerShell :)