
Granting Admin Rights on Lock-down PC
Hey Rick!
As an NT Network Administrator, I have had the need for this on several
occasions. What I have come up with is programmitically editing the remote
registry to "AutoLogon" as an Admin, set the "RunOnce" key to the
appropriate .bat, copy a small .bat to the local HDD, and issue a 'SHUTDOWN'
(reboot)command. When the machine reboots, it automatically logs in as the
Admin. The .bat file, when runs, maps a single network drive, where resides
my .exe file (so I can reuse the functionality), resets the "AutoLogon" key,
and starts the .exe. The final line of the .exe deletes the .bat file, and
reboots the machine.
So far, I have been able to remotely apply service packs and hotfixes, and
even install applications using the NT sysdiff tool.
I really can't give actual code at this time, because I am still testing the
process. However, I have found all of the information about sysdiff, remote
registry editing, AutoLogon, RunOnce, and Shutdown at MSDN,
http://www.mvps.org/vbnet/,
http://skyscraper.fortunecity.com/transmission/45/api/index.html,
http://www.netfokus.dk/vbadmincode/, TechNet, the NG's, and many, many more
sources (sorry if I haven't mentioned everyone, but Thanks and my deepest
respects to all of you helpful people). When I do get the app tested and
debugged, I would be more than happy to send it to someone who could clean
it up and post it for anyone who would need it (I am a VB novice, and
wouldn't want to show off my ignorance and crude methods too much).
HTH,
--
David Moore
Network Administrator
Parker Hannifin Corp.
(You know what to do with the address)
Quote:
> Our manufacturing line has locked down NT workstations for the users but
> certain tasks such as setting the time needs administrator rights.
> Does anyone know how I can shell a program and grant my admin rights?
What
> I would like to do is write a little program, pass in the admin account
name
> and password then launch an exe with those rights.
> Can it be done? Any source code laying around?
> Many thanks, Rick