Solved

Adding domain user to admin group

How can I add my domain user to administrators group when I am logged in with same domain user ID.
9 answers Last reply Best Answer
More about adding domain user admin group
  1. Best answer
    You can't. Talk to your corporate IT.
  2. This will need to be done the domain controller, not your client machine.

    If you have administrator access to your domain controller and know what O/S is running (it certainly wont be Windows 7), then we may be able to assist.
  3. even on my home laptop, I was trying to add a local user to admin group using below script but getting an error : Access denied on line 12

    Set oWshNet = CreateObject("WScript.Network" )
    sUser = "Ginnu"
    sNetBIOSDomain = oWshNet.UserDomain
    sComputer = oWshNet.ComputerName
    Set oGroup = GetObject("WinNT://" & sComputer & "/Administrators,group" )
    Set oUser = GetObject("WinNT://" & sNetBIOSDomain & "/" & sUser & ",user" )
    oGroup.Add(oUser.ADsPath)
  4. ursonly11 said:
    even on my home laptop, I was trying to add a local user to admin group using below script but getting an error : Access denied on line 12

    Set oWshNet = CreateObject("WScript.Network" )
    sUser = "Ginnu"
    sNetBIOSDomain = oWshNet.UserDomain
    sComputer = oWshNet.ComputerName
    Set oGroup = GetObject("WinNT://" & sComputer & "/Administrators,group" )
    Set oUser = GetObject("WinNT://" & sNetBIOSDomain & "/" & sUser & ",user" )
    oGroup.Add(oUser.ADsPath)

    Which is correct behavior if the script is not running with administrator rights.
  5. ex_bubblehead said:
    Which is correct behavior if the script is not running with administrator rights.


    But I am talking about home laptop where I am logged in with Admin ID only
  6. Ok so this is funny !
    My ID is a member of Admin group but I wasn't able to run script as mentioned above. But when I selected run as admin, function behaved properly without error.
    How is this possible that my ID being a part of admin group does not have complete rights
  7. Did you run the script by right clicking and choosing "Run as administrator"? If not, the script is not running with administrator rights.
  8. ursonly11 said:
    Ok so this is funny !
    My ID is a member of Admin group but I wasn't able to run script as mentioned above. But when I selected run as admin, function behaved properly without error.
    How is this possible that my ID being a part of admin group does not have complete rights

    Welcome to Windows 7. That's how administrator level accounts have behaved since the release of Vista.
  9. Best answer selected by ursonly11.
Ask a new question

Read More

Domain Windows 7