Tyler S
Tyler S

Reputation: 877

get-aduser to make list of properties

I dont understand why my code cant get this code to work. I am trying to do a get-aduser that lists the name, alias, and the homepage of all users in the active directory domain. Nowhere online explains what to use with get-aduser to get the extended properties of all the users in AD. i am using this as my code:

Get-ADuser -filter * -properties extended | FT name, homepage, identity

what am i doing wrong? any hrelp would be greatly appreciated. For exporting to an excel sheet i use.

 PS P:\> Get-ADuser -filter * -properties name,HomePage,userprincipalname | FT name,homepage,userprincipalname | out-file C:\scripts\AD.csv

This creates a list of all the AD users but it puts them under one column like so:

enter image description here

I need to have each section under a seperate column

Upvotes: 1

Views: 5843

Answers (1)

Paul
Paul

Reputation: 5871

you have to list the properties you want, for example:

Get-ADuser -filter * -properties EmailAddress,HomePage

Here is the documentation: Technet

Regarding csv export:

Get-ADuser -filter * -properties name,HomePage,userprincipalname | select name,homepage,userprincipalname | export-csv C:\scripts\AD.csv -notype

should yield the expected result. If you need to change the delimiter you can use the -delimiter parameter.

Upvotes: 3

Related Questions