Login | |
|
 |
RE: Adding User account to the local PC - 12/13/2005 12:50:45 AM
|
|
 |
|
| |
ginolard
Posts: 1068
Score: 21
Joined: 8/10/2005
Status: offline
|
Actually, the above code will only add a LOCAL user to a local group. To add a domain user you need this code. strComputer="xxxxxx" strGroup="xxxxx" strDomain="xxxxx" strUser="xxxx" Set objGroupToUpdate = GetObject("WinNT://" & strComputer & "/" & strGroup & ",group") Set objUserToAdd = GetObject("WinNT://" & strDomain & "/" & strUser & ",user") objGroup.Add(objUserToAdd.ADsPath)
|
|
| |
|
|
|
 |
RE: Adding User account to the local PC - 12/13/2005 2:43:38 AM
|
|
 |
|
| |
Country73
Posts: 733
Score: 10
Joined: 8/25/2004
From: USA
Status: offline
|
Doh! Got me on that one, I posted my response without double checking the original question. Nice catch ginolard
|
|
| |
|
|
|
 |
RE: Adding User account to the local PC - 12/13/2005 6:44:26 AM
|
|
 |
|
| |
Country73
Posts: 733
Score: 10
Joined: 8/25/2004
From: USA
Status: offline
|
Change that last line from: objGroup.Add(objUserToAdd.ADsPath) To: objGroupToUpdate.Add(objUserToAdd.ADsPath)
|
|
| |
|
|
|
 |
RE: Adding User account to the local PC - 12/13/2005 7:43:36 PM
|
|
 |
|
| |
ginolard
Posts: 1068
Score: 21
Joined: 8/10/2005
Status: offline
|
No you can't. objGroupToUpdate is simply the name of the object. What exactly do you mean by "updating the user" anyway?
|
|
| |
|
|
|
 |
RE: Adding User account to the local PC - 12/15/2005 2:22:16 AM
|
|
 |
|
| |
ginolard
Posts: 1068
Score: 21
Joined: 8/10/2005
Status: offline
|
Then you have to delete them from the Adminstrator group and add them to the Power Users group
|
|
| |
|
|
|
| |
|
|
 |
|
 |
|
|