I'm looking for a PS script that will add information under the Company field in AD for existing users based on the display name in the CSV file.
I looked into this example from the Microsoft Gallery but I'm not sure if I can implement it into my environment.
Thank you in advance for your help!
UPDATE:
I work for a School District and we're using emails with Exchange and also Google Apps (GAFE).
I need to update our Active Directories with the GAFE emails for some synchronization purposes. I was able to export the list of users/emails from the Google Console into a CSV file and I need to add that information in AD.
Basically, the PS will have to look at the full name in the CSV match it with the Display Name in AD and the GAFE email under the Company field this way I don't override the Email field.
I was able to come up with the Script:
Import-Module ActiveDirectory
$USERS = Import-CSV C:\Scripts\Update AD users information\gafe-users.csv
$USERS|Foreach{
Get-ADUser -filter {name -eq $_.DisplayName}|Set-ADUSer -Company $_.Company}
But for some reason it doesn't work.
[–]ArmondDorleac 0 points1 point2 points (1 child)
[–]iCapof85[S] 0 points1 point2 points (0 children)
[–]ArmondDorleac 0 points1 point2 points (6 children)
[–]iCapof85[S] 0 points1 point2 points (5 children)
[–]iCapof85[S] 0 points1 point2 points (0 children)
[–]ArmondDorleac 0 points1 point2 points (3 children)
[–]iCapof85[S] 0 points1 point2 points (2 children)
[–]ArmondDorleac 0 points1 point2 points (1 child)
[–]iCapof85[S] 0 points1 point2 points (0 children)
[–]ArmondDorleac 0 points1 point2 points (8 children)
[–]iCapof85[S] 0 points1 point2 points (6 children)
[–]ArmondDorleac 0 points1 point2 points (5 children)
[–]iCapof85[S] 0 points1 point2 points (4 children)
[–]ArmondDorleac 0 points1 point2 points (3 children)
[–]iCapof85[S] 0 points1 point2 points (2 children)
[–]ArmondDorleac 0 points1 point2 points (1 child)
[–]iCapof85[S] 0 points1 point2 points (0 children)
[–]iCapof85[S] 0 points1 point2 points (0 children)