need help with OpenDSObject



I am writing an HTA that will allow me to add a domain user to the
local Administrators group and can be run even as a lowly user provided
local admin account and password are supplied. I get an error (No
network provider accepted the giver network path) on the "Set
objGroup =" line. Does anyone see what i am doing wrong?

Sub Promote
Set objDSO = GetObject("WinNT:")
Set objGroup = objDSO.OpenDSObject
("WinNT://./Administrators,group", frmRunAs.value, frmPassword.value, 1
AND 2)
Set objUser = GetObject("WinNT://" & frmUserID.value & ",user")
objGroup.Add (objUser.ADsPath)
objGroup.Setinfo
End Sub

.



Relevant Pages

  • Re: Question about group
    ... It would mean that domain user can log on to any computer and get admin rights to ... adding the built-in role "INTERACTIVE" to the local Administrators group. ...
    (microsoft.public.win2000.security)
  • RE: Remove domain user from local administrators group
    ... > domain user is assigned to local administrators group. ... Regards ...
    (Focus-Microsoft)
  • script to add multple users to local admin group on servers
    ... ' Script to add domain user to local administrators group ... Dim strUser, objUser, objGroup, objFSO, objTextStream ... ' Bind to local Administrators group on remote computer. ... On Error GoTo 0 ...
    (microsoft.public.windows.server.scripting)
  • RE: Add AD user to localgroup
    ... if your script runs locally on a Win2k or WinXP workstation, you can use the following code (please note that you can still use the ADSI WinNT: provider to access objects in an Active Directory domain): ... ' bind to the local Administrators group ... add the domain user to the local group ...
    (microsoft.public.scripting.vbscript)
  • Add domain user to local group script troubleshoot
    ... Set objGroup = GetObject _ ... Am I on the right track or is there another way to add a domain user to a local group? ...
    (microsoft.public.windows.server.scripting)

Loading