|
-
Jan 24th, 2006, 03:58 AM
#1
Thread Starter
Member
plz help .. What the error in this code adding domain user
hi i wrote this code but it is not work plz how i correct hem
i want to add domain user to administrators local group :
user name : "zzb"
pass word : "123"
domain : "toto.com"
Const ADS_SECURE_AUTHENTICATION = 1
strComputer = "computer1"
Set oDSO = GetObject("WinNT:")
Set oComputer = oDSO.OpenDSObject("WinNT://" & strComputer _
, "Administrator", "semsem", ADS_SECURE_AUTHENTICATION)
Set colAccounts = GetObject("WinNT://" & strComputer & ",computer")
Set objUser = oComputer.Create("user", "zzb")
objUser.SetPassword "123"
objUser.SetInfo
Set objGroup = GetObject("WinNT://" & strComputer & "/administrators,group")
Set objUser = GetObject("WinNT://toto.com/zzb,user")
Set objUser = GetObject("WinNT://" & strComputer & "/zzb,user")
objGroup.Add (objUser.ADsPath)
objUser.SetInfo
any help plz
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|