Re: XP users domain account to local admin group through script



Thank you for you answer, Iíi check in to your suggestions.

Regards
/Fredrik
--
AD/Exchange admin, 2003.


"maximillianx" skrev:

> If talking about a particular 'logged on user' the problem with the startup
> script is that the currently logged on user isn't known yet to the system,
> but I can see how the groups by OU could work out (according to the JSI
> tip).
>
> Fredrik -
>
> You'd almost have to have some sort of regkey or file where computer
> ownership information would be stored (i.e. - 'user_a' = 'computer_a').
> Then, you could write your script so it could query the information for the
> assigned username and add it that way.
>
> Logon scripts would be a problem, since this type of action would require
> the exact administrative privileges that you were trying to grant in order
> to grant them. Remember that there is a difference between logon scripts
> (which occur AFTER the user logs in using the user's credentials) and
> startup scripts (which occur BEFORE the user logs in using the local system
> credentials).
>
> One alternative may be to use something like cpau.exe (create process as
> user), which you can create encoded .job files that contain proper
> credentials to perform administrative tasks. I don't know how secure this
> would be, really...but it is an option. However, that being said, I believe
> that you would have to log out and back in again to fully take advantage of
> the admin rights that you just applied.
>
> Myself, I'd lean toward updating the local system registry with some sort of
> 'owner' information where the userid would be stored. Then, when you run a
> startup script (not logon) prior to the user logon process, it could query
> this info and add the username to the local admin group before the user
> enters their credentials.
>
> Hope this helps,
> Rob
>
> "Jerold Schulman" <Jerry@xxxxxxxxxx> wrote in message
> news:f5ujn151buqbvif93cmueo6q8aitee11qj@xxxxxxxxxx
> >
> > Either do it in a Startup script,
> > or use tip 5319 » How do I create a global group, so that it is a member
> > of the local administrators group on all workstations and member servers,
> > by using group policy restricted groups?
> > in the 'Tips & Tricks' at http://www.jsifaq.com
> >
> >
> >
> >
> > On Tue, 15 Nov 2005 06:36:04 -0800, "Frodd"
> > <Frodd@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> >
> >>Hi,
> >>I´m trying to place XP users domain account in the local administrators
> >>group through a login script in a GPO. There is some permission problem
> >>for
> >>the user to place their own user account in the local administrators group
> >>through the script. Is the anyone who can help me out to solve this
> >>issue?
> >>
> >>login script:
> >>
> >>Dim DomainName
> >>Dim objNet, strUserName
> >>Set objNet = CreateObject("Wscript.Network")
> >>strUserName =objNet.UserName
> >>Set net = WScript.CreateObject("WScript.Network")
> >>local = net.ComputerName
> >>DomainName = "business"
> >>set group = GetObject("WinNT://"& local &"/Administrators")
> >>on error resume next
> >>group.Add "WinNT://"& DomainName &"/"& strUserName &""
> >>CheckError
> >>sub CheckError
> >>if not err.number=0 then
> >>set ole = CreateObject("ole.err")
> >>MsgBox ole.oleError(err.Number), vbCritical
> >>err.clear
> >>else
> >>'MsgBox "Done."
> >>end if
> >>end sub
> >>
> >>Regards
> >>/Fredrik
> >
> > Jerold Schulman
> > Windows Server MVP
> > JSI, Inc.
> > http://www.jsiinc.com
> > http://www.jsifaq.com
>
>
>
.



Relevant Pages

  • Re: need to modify local group membership via VBscript
    ... A logon script runs with the credentials of the user, ... ' Bind to local Administrators group on remote computer. ... Wscript.Echo "Domain Admins already in Administrators on " & strComputer ...
    (microsoft.public.windows.server.scripting)
  • Re: need to modify local group membership via VBscript
    ... Admin run the script on all NT computers. ... script can add domain groups to the local Administrators group. ... how to add a domain group to local administrators account: ...
    (microsoft.public.windows.server.scripting)
  • Re: need to modify local group membership via VBscript
    ... domain admin credentials in the script, then run the script through the ... script would have to use alternate credentials or a third part RunAs tool. ... ' Bind to local Administrators group on remote computer. ...
    (microsoft.public.windows.server.scripting)
  • Re: need to modify local group membership via VBscript
    ... Admin run the script on all NT computers. ... script can add domain groups to the local Administrators group. ... how to add a domain group to local administrators account: ...
    (microsoft.public.windows.server.scripting)
  • Re: Redirect computers to a specific OU by IP Address
    ... Getting theIPaddress of the workstation is easy if you are running the ... script from the workstation. ... COMPLETELY lock them down until an admin put them into the rightOU. ... used for approx 180-240 days (as there is over 1000 computer accounts ...
    (microsoft.public.windows.server.active_directory)