I have been tasked with rolling out several hundred new computers.
The computers will all be imaged and will not be joined to the domain until they are physically on the clients desk. The trick is, I need to take some data from their local profile on their current machine, and migrate it to the new workstation.
So, I created a script to pull their data, and store it to a server until the new computer is added to the domain, and the user logs on with their Domain Account.
I read the solution here:
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_23091801.html, but I'd need the user's ID and Password. As it stands, an admin still has to logon when the new computer is booted up, so it can be added to the domain, and computer name changed.
I tried a solution where the registry keys that go along with the user's SID are created, but when the user logs on, Windows just overwrites the values with new information, and creates a profile folder called USERID123.DOMAINNAME. So, I tried modifying the folder path to create a profile folder called USERID123.DOMAINNAME, and again, it overwrote the registry keys and created a profile folder called USERID123... Yes, I wanted to slap myself multiple times about the face and neck, but I thought I might get canned for that. So I'm here asking for your help. I have no cookies though, sorry.
This is a working function I scraped together to try the above note.
Function createUserProfile(userSID,
userID)
Const HKLM = &H80000002
'userSID = "S-1-5-21-12345678-1234567
890-123456
7890-12345
"
'userID = "USERID123"
strKey = "Software\Microsoft\Window
s NT\CurrentVersion\ProfileL
ist"
strComputer = "."
Set oReg=GetObject("winmgmts:{
impersonat
ionLevel=i
mpersonate
}!\\" & strComputer & "\root\default:StdRegProv"
)
strUserKeyPath = strKey & "\" & userSID
oReg.CreateKey HKLM, strUserKeyPath
strUserPathKeyName = "ProfileImagePath"
strUserPathValue = "%SystemDrive%\Documents and Settings\" & userID
oReg.SetExpandedStringValu
e HKLM,strUserKeyPath,strUse
rPathKeyNa
me,strUser
PathValue
strUserFlagKeyName = "Flags"
strUserFlagValue = 1
oReg.SetDWORDValue HKLM,strUserKeyPath,strUse
rFlagKeyNa
me,strUser
FlagValue
Set oReg = Nothing
Set objFSO = CreateObject("Scripting.Fi
leSystemOb
ject")
userFolderPath = "C:\Documents and Settings\" & userID
objFSO.CreateFolder userFolderPath
objFSO.CreateFolder userFolderpath & "\Cookies"
objFSO.CreateFolder userFolderpath & "\Desktop"
objFSO.CreateFolder userFolderpath & "\Favorites"
objFSO.CreateFolder userFolderpath & "\My Documents"
objFSO.CreateFolder userFolderpath & "\Start Menu"
Set objFSO = Nothing
createUserProfile = "Successfully created profile for " & userID
End Function
What I'm really getting at is, I want to create the a local profile for a domain user before they ever log on, and without having to use their ID/Password credentials.
Anyone? Anyone? BUELLER?
If you read all that, thank you!