1,050 pts.
 How do I add a local admin account via script?
We have just recently joined to our parent companies domain, and as such our old local admin account "administrator" name is not being used as an login anymore. Most of our machines have administrator as the local admin account. Since we want to get away from that name, we would like to add a local (machine) admin account via a script. Plus Windows 7 doesn't allow for that name to be used, another reason to get away from it. I found lots of ways to add an account that is part of the admin group on the domain to the local list. The issue is we want to use a username that is allready in the administrator group on our domain. The problem is we cant change that name or password. The password is 24 characters long and meant to run all the services that were running under the old "administrator" account. Since its so long, its not the best one to use for local admin access in safe mode. Plus it wasn't added to the machines when they were setup. Does anyone have a script that will add the user "user" with a password of "password" to the local computers account. So that it will show up in the users list as USERĀ  "name" DOMAIN "pcname" GROUP "administrator"

Software/Hardware used:
server 2003,windows 7 windows xp
ASKED: April 26, 2011  7:06 PM
UPDATED: May 2, 2011  10:47 PM

Answer Wiki:
Try the <a href="http://www.joeware.net/freetools/tools/lg/index.htm">LG utility from JoeWare.net</a> Of course test this before deploying in production environment. LG Usage lg /? LG V01.03.00cpp Joe Richards (joe@joeware.net) April 2010 Usage: LG Group SecPrin [switches] Group LocalGroup to work with Group can be specified in the following ways: o domainlocalgroup o \serverlocalgroup o localgroup If Group is specified as domain. or \server. localgroups at that location are enumerated If Group is specified as . the localgroups on the local machine are enumerated SecPrin Security Principal to add/remove from group Switches: (designated by - or /) -add Add SecPrin to Group. -remove Remove SecPrin from Group -cleargroup Remove all members from group -addgroup Add localgroup specified -removegroup Remove localgroup specified -sid Security principal(s) are specified as SIDs -sidsout Output SIDs instead of SecPrin member names -r computer Specify computer to resolve SIDs. [LOCALHOST] -comment Display LG Comments -setcomment Set Comment for addgroup -lu List Users (only used for . enumerate option) Ex1: lg domain. Enumerate localgroups on domain Ex2: lg domain. -lu Enumerate all localgroups and members on domain Ex3: lg \computer. Enumerate localgroups on computer Ex4: lg . -comment Enumerate localgroups and comments on localhost Ex5: lg users Enumerates members of localgroup users on localhost Ex6: lg \computerbob -addgroup -setcomment "bobs group" Create bob localgroup on computer with comment Ex7: lg bob -setcomment "bobs group" Sets comment for localgroup bob on localhost Ex8: lg users joe doug louise /add Adds joe, doug, and louise to localgroup users Ex9: lg \comp1users louise -add -r comp3 Adds SID resolved at comp3 for louise to localgroup users on comp1 Ex10: lg \comp1users S-1-5-567-678-89765-456 -sid -add Adds specified SID to localgroup users on comp1 Ex11: lg \comp1users -sidsout Lists members of localgroup users on comp1 in SID format Ex12: lg \comp1 -lu -sidsout Lists members of all localgroups on comp1 in SID format This software is Freeware. Use it as you wish at your own risk. If you have improvement ideas, bugs, or just wish to say Hi, I receive email 24x7 and read it in a semi-regular timeframe. You can usually find me at joe@joeware.net
Last Wiki Answer Submitted:  April 26, 2011  8:57 pm  by  Labnuke99   32,645 pts.
All Answer Wiki Contributors:  Labnuke99   32,645 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _