I am trying to move users from one OU to another OU using a simple powershell script. I want it to use both the first name and the last name from the csv file before it moves the user.<\/p>\n
I have a csv file with a column for first name and last name. Can i add both columns to one variable? as in<\/p>\n
$User= ._Firstname, ._Lastname<\/p>\n
If i have to define 2 variables how do i use it in an instance where I want it to move the ad object witht he identity flag? Can i add both variables there in this line?<\/p>\n
Move-ADObject -Identity $UserDN , $UserLN<\/p>\n
something like that? I need it to read both the first name and last name from the csv before it tries to move the user<\/p>","upvoteCount":4,"answerCount":6,"datePublished":"2020-04-10T13:47:42.000Z","author":{"@type":"Person","name":"spiceuser-ab41e","url":"https://community.spiceworks.com/u/spiceuser-ab41e"},"suggestedAnswer":[{"@type":"Answer","text":"
I am trying to move users from one OU to another OU using a simple powershell script. I want it to use both the first name and the last name from the csv file before it moves the user.<\/p>\n
I have a csv file with a column for first name and last name. Can i add both columns to one variable? as in<\/p>\n
$User= ._Firstname, ._Lastname<\/p>\n
If i have to define 2 variables how do i use it in an instance where I want it to move the ad object witht he identity flag? Can i add both variables there in this line?<\/p>\n
Move-ADObject -Identity $UserDN , $UserLN<\/p>\n
something like that? I need it to read both the first name and last name from the csv before it tries to move the user<\/p>","upvoteCount":4,"datePublished":"2020-04-10T13:47:43.000Z","url":"https://community.spiceworks.com/t/csv-file-use-in-powershell-with-variables/758659/1","author":{"@type":"Person","name":"spiceuser-ab41e","url":"https://community.spiceworks.com/u/spiceuser-ab41e"}},{"@type":"Answer","text":"
If you post code, please use the ‘Insert Code’ button. Please and thank you!<\/p>\n