Britt Priddy Jr
asked on
Copy Local Users From Windows 2003 to another Windows 2003 Server
I have 2 Windows 2003 Standard servers running. I have backed up / restored Windows Sharepoint Services. however, it did not copy the users accounts over. Is there a tool to copy local users (not apart of any domain) to the other Windows 2003 server? I've tried a few things and nothing is working. You'd think there would be a tool - if someone wanted to mirror or create a backup of a server - it would copy the local user accounts as well - even if the password was lost - its just too much data to manually enter.
Any ideas?
Any ideas?
ASKER
I've seen tons of those - but there has to be something that would export or allow transfer of local accounts to another Windows 2003 machine that is not AD... Experts? Throw me a bone! :P
I'm not too sure if it'll work, but have you tried possibly exporting the HKEY_USERS branch of the registry and merging that into the registry on the second server? Afrai I can't really test from here so not sure if its really even possible, or whether there'll be SID issues or anything like that. Just an idea...
ASKER
ok - I have gotten this far.
I've extracted the user names / full names and descriptions - imported them into a SQL Database. I found a script that will add users the local system.
And I thought I knew allot about ASP - if anyone can help get this code working - I'll up this to 300 points.
This is the ASP code I have - and it give me:
Active Directory error '80070005'
General access denied error
/public/addusers.asp, line 23
But note - I am not using Active Directory and this code example is from Microsoft TechNet - "Create a Local User Account" and supports Windows Server 20003 / Windows XP / Windows 2000 / Windows NT 4.0 / Windows 98.
If you know how to insert the Full name and Description - that would be a bonus!
As you can see - I loop through the usernames, etc - and attempt to add them using the Script code provided by Microsoft. I'm sure its a permission issue but that is not important as this is temporary and nobody has access to put code on this internal server.
Code:
'I know, I know - old school classic ASP :P
sqlCmd2 = "SELECT * FROM users99"
set cn2 = Session("cnMSSQL")
set RS2 = cn2.execute(sqlCmd2)
WHILE NOT RS2.EOF
username = RS2("Username")
fullname = RS2("Fullname")
Desc = RS2("Desc")
strComputer = "ISWEBSERVER"
Set ColAccounts = GetObject("WinNT://" & StrComputer & "")
Set ObjUser = ColAccounts.Create("user", username )
objUser.SetPassword "password"
objUser.SetInfo
RS2.MoveNext
WEND
I've extracted the user names / full names and descriptions - imported them into a SQL Database. I found a script that will add users the local system.
And I thought I knew allot about ASP - if anyone can help get this code working - I'll up this to 300 points.
This is the ASP code I have - and it give me:
Active Directory error '80070005'
General access denied error
/public/addusers.asp, line 23
But note - I am not using Active Directory and this code example is from Microsoft TechNet - "Create a Local User Account" and supports Windows Server 20003 / Windows XP / Windows 2000 / Windows NT 4.0 / Windows 98.
If you know how to insert the Full name and Description - that would be a bonus!
As you can see - I loop through the usernames, etc - and attempt to add them using the Script code provided by Microsoft. I'm sure its a permission issue but that is not important as this is temporary and nobody has access to put code on this internal server.
Code:
'I know, I know - old school classic ASP :P
sqlCmd2 = "SELECT * FROM users99"
set cn2 = Session("cnMSSQL")
set RS2 = cn2.execute(sqlCmd2)
WHILE NOT RS2.EOF
username = RS2("Username")
fullname = RS2("Fullname")
Desc = RS2("Desc")
strComputer = "ISWEBSERVER"
Set ColAccounts = GetObject("WinNT://" & StrComputer & "")
Set ObjUser = ColAccounts.Create("user",
objUser.SetPassword "password"
objUser.SetInfo
RS2.MoveNext
WEND
ASKER
wow - no takers? Where are the experts?
even if your coding works, you still are importing nothing but names, you then have no group assosciations and memberships - have nver seen a way nor know of anyone who has been able to import local accounts into AD - sometimes the answer is it cannot be done
good luck though i hope you get it figured out
good luck though i hope you get it figured out
ASKER
that is all you need - is a group of names ... note the wscript - it puts the username in the 'user' group on the local machine.
Note the question states - local accounts only - this has nothing at all to do with active directory. (Not apart of a domain)
Note the question states - local accounts only - this has nothing at all to do with active directory. (Not apart of a domain)
ah lol my bad - i am in so many diff Q's that i get confused sometimes i apologise about that
i see where you are going and it looks like it may work - i hope it does coz once you nail it this could be a usefull tool or a lot people, wish i could help with your script but i cant even spell script on most days... :)
i see where you are going and it looks like it may work - i hope it does coz once you nail it this could be a usefull tool or a lot people, wish i could help with your script but i cant even spell script on most days... :)
ASKER
I've figured it out.
Sub AddUser(strUser,strDomain, strFullnam e,strPassw ord,strDes c)
Dim Computer
Dim User
Set Computer = Getobject("WinNT://" & strDomain)
Set User = computer.create("User",str User)
User.fullname = strFullname
User.Description = strDesc
call User.SetPassword(strPasswo rd)
User.setinfo
Set User = nothing
Set computer = nothing
End sub
Then just loop through your records in the database with the username / fullname / description
and add a password.
In the WHILE NOT RS loop
just add:
adduser username, "COMPUTERNAME", Fullname, "password", Desc
movenext - then WEND it and its done.
Now how do I close this and reclaim the points? :)
Sub AddUser(strUser,strDomain,
Dim Computer
Dim User
Set Computer = Getobject("WinNT://" & strDomain)
Set User = computer.create("User",str
User.fullname = strFullname
User.Description = strDesc
call User.SetPassword(strPasswo
User.setinfo
Set User = nothing
Set computer = nothing
End sub
Then just loop through your records in the database with the username / fullname / description
and add a password.
In the WHILE NOT RS loop
just add:
adduser username, "COMPUTERNAME", Fullname, "password", Desc
movenext - then WEND it and its done.
Now how do I close this and reclaim the points? :)
ASKER
Any recommendations for what?
I created a solution to my own question.
I created a solution to my own question.
I agree to the PAQ'ing - may be useful in future
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
there are migration tools avaliable for domain environments but none that i know of for a local machine
Cheers!