rov17
asked on
Script to convert users display name to sam id
Hi everyone,
I need a power shell, vbs script to check an excel sheet or even a csv file that has a display name for some users and convert them to SAMID and output the results in a text file.
Thanks
I need a power shell, vbs script to check an excel sheet or even a csv file that has a display name for some users and convert them to SAMID and output the results in a text file.
Thanks
ASKER
Hi Chris,
Thank for the script, actually the csv file as First name , last name.
Is there is away to get the script checks both First name and the last name ?
Thanks
Thank for the script, actually the csv file as First name , last name.
Is there is away to get the script checks both First name and the last name ?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you were to go with PowerShell, and had Quest's CmdLets there's not much more to it than this:
Import-CSV "YourCSVFile.csv" | `
%{ Get-QADUser $_.Name } | `
Select Name, sAMAccountName | `
Export-CSV "SomeNewFile.csv"
That assumes the CSV file has a column called Name. If it encounters a duplicate name in AD it will output all matches.
Chris