AD Attributes

Hello Experts,

I have OU that contains all the users in the domain. The issue is that the users do not have address information and I would like to update the same information for every user at once. This is the first part of updating the constant information.

I would like to know how to do this in one shot.

The 2nd part is to know the attributes that needs updating user specific like mobile number, extension, manager, department info. I would like to download these attributes in CSV format and I need to know how to do this.

Thank you.
SR ZakNetwork Solutions Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


This is very easy to use but ideally you want to use PS .. One of the experts will help with that I'm sure .
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
The PowerShell way is almost the same - without the GUI. The key component is set-ADUser. Use get-help set-aduser -full for a complete set of options.
The first part is something like
Get-ADUser * -Resultsize Unlimited | Set-ADUser -Company 'My Company'

Open in new window

Reading from a CSV is like
Import-CSV C:\Scripts\Users.CSV |
  % { Set-ADUser $_.User -Phone $_.Phone }

Open in new window

The CSV needs to contain column headers, and those names have to be used in the code. User should best be the SAMAccountName.
SR ZakNetwork Solutions Author Commented:
lets say I want to export users in particular OU known as employees in excel first with all the attributes that I would like to update .

I first need to have the attributes in columns.  PLease note my current AD only has the user firstnam and last name and email that's it and I need to update all the users .

The Power shell command that will do that will be great. I don't have issue writing the script I just want to pull the ad users first and the Attributes that needs to be filled.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

SR ZakNetwork Solutions Author Commented:
I updated one user information in the AD and I am able to see all the attributes with Value . I want to now export that user information in a CSV.

Can you help me with a powershell script that will do that.

Thank you.
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
The first attempt is always
Get-ADUser OneUser -Properties * | Export-CSV -NoType C:\Scripts\UserExport.csv

Open in new window

This will export too much, but you see all available properties.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SR ZakNetwork Solutions Author Commented:
OneUser = sAmaccount . Right?

I was able to export the attributes for one user in excel.
SR ZakNetwork Solutions Author Commented:
I just want to export the attributes with a value for that OneUser. is that possible?
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
No. It would require a complex logic to do it, and more complex to apply back the changes.
But if you know the property names, you can enumerate them after -Properties to only get those.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.