disturbedone
Vendor
I have a Powershell script that users manually run to create new users. It prompts the user for values for name, phone number etc. It works without issue.
I have a CSV file of several hundred new users. One option is to manually run the current script and manually enter all values but that would take considerable time.
Is it possible to create a new script that imports the CSV, assigns values from the CSV, calls the original script and inputs them into specific fields?
For example, the original script has line saying:
where the user would normally manually type the new user's username.
I've previously used Powershell scripts to import CSV files using a command such as:
My CSV file has a column called ID so I'd like to import that and use it for the variable that is in the existing script as $LOGONALIAS (as above). There would obviously be other values for first name, surname etc.
Is such a thing possible? If so, how?
I have a CSV file of several hundred new users. One option is to manually run the current script and manually enter all values but that would take considerable time.
Is it possible to create a new script that imports the CSV, assigns values from the CSV, calls the original script and inputs them into specific fields?
For example, the original script has line saying:
Code:
$LOGONALIAS = Read-Host "What is the users USERNAME?"
I've previously used Powershell scripts to import CSV files using a command such as:
Code:
import-csv C:\CSVFile.csv | foreach {
$DistGroupName = $_.CSVColumnName
etc etc etc
My CSV file has a column called ID so I'd like to import that and use it for the variable that is in the existing script as $LOGONALIAS (as above). There would obviously be other values for first name, surname etc.
Is such a thing possible? If so, how?