I am working on a bulk user import project, and I notice regardless whether the Home Directory column in the Excel spreadsheet contains a path of \dc1\Test%username% or \dc1\Test\ejohnson, it inserts the text in the To: box as is, but it does not create the folder. When using %username" variable, it does not reflect the actual username (ejohnson), and simply echos the variable name. I can remove \dc1\Test%username%, save the change, paste it back, and save it again and it reflects “\dc1\Test\ejohnson”. However, even when signing in as the user, the folder is not created. I am just wondering can the actual folder get created as part of the import script?
#Create AD User
New-ADUser -Name “$($user.‘First Name’) $($user.‘Last Name’)” -HomeDrive $user.'Home Drive'
-HomeDirectory $user.‘Home Directory’ `