Share via

Powershell script - import , compare and insert in AD

2022-02-07T15:14:07.9+00:00

I need to compare 2 worksheets. The first one with the employees' names and was sent by HR. The second with AD usernames. I need to compare the two and generate a third sheet or csv with the users who have the same in both sheets and also import the user registration field from the HR sheet. With the third worksheet with the user and registration number must be inserted in the AD in the description field with ; in front and thus separate this information from the existing one.

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

1 answer

Sort by: Most helpful
  1. Rich Matheisen 48,116 Reputation points
    2022-02-07T20:07:24.393+00:00

    Modifying the description property isn't difficult (as you would have found if you'd looked): append-to-ad-user-account-description-property

    Why do you need the 2nd spreadsheet? Just look for whatever it is that HR sent in the 1st one. If all HR sent was the names of the employees, good luck with that. There's no guaranty that names are unique, especially if you have a sizable organization. "John Smith", "Jose Ortiz", "Michael Schwartz", etc. Just for fun, why not use PowerShell to build a hash of names and count the number of times you find each combination of "Last, First" or "First Last" (if that's what you mean by "employee's names").

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.