Link to home
Start Free TrialLog in
Avatar of Ampletrix
AmpletrixFlag for Australia

asked on

List AD Users with PowerShell

Hello Everyone,

My PowerShell Skills are near non-existant.

I'm looking for a powershell script that will list all the users in my AD. All I need is a Firstname, Lastname and SamAccountName please?

Any help would be awesome thanks.
SOLUTION
Avatar of felo86
felo86

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ampletrix

ASKER

Thanks guys.

I'm getting errors using this script. I don't want to import any users.
All I'm looking for is a csv file with FirstName, LastName and SamAccount info.
What's the command that I must use?
Apology if I'm an ID10t.
:-)
ASKER CERTIFIED SOLUTION
Avatar of Will Szymkowski
Will Szymkowski
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of felo86
felo86

If you dont mind installing the FREE Quest cmdlets from here this could be as simple as

# For all properties
Get-QADUser -sl 0 -IncludeAllProperties -SerializeValues | export-csv <file> -noType

# For just the properties in your script
Get-QADUser -sl 0 -IncludeAllProperties -SerializeValues | select DisplayName,mailnickName,city | export-csv <file> -noType
Unfortunately I can't install the  FREE Quest cmdlets felo86, but thanks for the input.

Will - Have you tested your command? I'm getting an error.
Thanks guys. Will's solution was what I was looking for and managed to fix the syntax. Cheers guys.