Page 1 of 1 1
Topic Options
#144566 - 2005-08-01 03:35 PM Add local user with admin rights?
mbailey Offline
Lurker

Registered: 2005-08-01
Posts: 1
Would it be possible to write a script that could add a user profile to each machine with local admin rights? If so, does anyone have any examples?
Top
#144567 - 2005-08-01 03:49 PM Re: Add local user with admin rights?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You should never add users directly. Have you not heard of the UGLY principle?
Users
Global
Local
Y - cuz it's ugly

Put the computer names in an array and loop through it. You could use ADSI or the cusrmgr.exe utility.
Code:

For each $comp in $comps
Shell 'cusrmgr.exe -m \\'+$comp+' -alg administrators -u domain\global_group'
next



Of course this is simplified as there is no ping check to see if the comps are reachable and success is not logged.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#144568 - 2005-08-01 03:56 PM Re: Add local user with admin rights?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Sorry, missed the "local user" part. Why would you want local users? It is a security and management nightmare, not to mention that you would likely fail a Sarbanes-Oxley audit.

If you insist, ignore the UGLY stuff and substitute the user for the group.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.052 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org