I have a strange issue with importing AD attributes from a .CSV file. It was working a couple of days ago. Now, when importing the data, it looks like all data is going through (no errors) but only the rows from the .csv file with numerals and symbols (#) are importing. String data like names, initials and home addresses and telephone numbers and not importing.
I’m using quest active roles free management shell for interaction with AD and the powershell ISE for testing.
Does the file look okay when you open it in Notepad? This one’s going to be hard to troubleshoot without being able to see the CSV file and the code that’s reading it.
I’m not sure if this is the only problem with this code, but one thing that jumps out at me is that you’re constantly overwriting the value of $Params.ObjectAttributes with new hashtables. When that happens, only the last value to be assigned will wind up getting passed on to Set-QADUser, which may be the problem here. Try this revision:
Here, you’re only assigning a value to $Params.ObjectAttributes once, with the hashtable that was built up in the $objectAttributes variable throughout the rest of the code.