Forum Discussion

alexrabbi's avatar
alexrabbi
Brass Contributor
Dec 22, 2022
Solved

powershell query

Hi All ,   I am using below command to get a list of all active users in AD, what should i add to this command to get UPN and Object ID ?   Get-ADUser -Filter {Enabled -eq $true} -properties * | ...
  • VasilMichev's avatar
    Dec 22, 2022
    List all the properties you want included in the CSV as part of the select-object cmdlet:

    Select-Object UserPrincipalName,ObjectId,samaccountname,givenname,surname,Enabled

Resources