Hi there, I am very much new to Powershell but thoroughly enjoying it so far.
I have a requirement to import a single attribute into AD for every user.
The script I have is here:
Import-Csv c:\temp\users.csv | ForEach-Object {
Set-QADUser $_.displayName -ObjectAttributes @{ExtensionAttribute1=($_.ExtensionAttribute1)}
}
In the CSV I have one column for the Display Name and one for the extensionattribute1.
The script works well except for one big problem.
We have lots of users that have special accounts so they have their normal "DisplayName" then they have a DisplayName with and extra character on the end, I will just say x
So we have accounts called "Joe Bloggs" and say "Joe Bloggsx" this isn't exactly what we use but you get the idea. The script works but when it happens upon Joe Bloggs it says ambiguious user as it matches the words in both accounts.
How can I get around this problem?
The list of names has been exported out of another system so I am unfortunately not able to use the samaccount name, it needs to be the display name or name etc.
Any advice would be greatly appreciated.
Cheers
Arry