Page 1 of 1 1
Topic Options
#116770 - 2004-03-24 09:44 PM Add Domain Group to local Admin Group
CBehrent Offline
Fresh Scripter

Registered: 2003-08-18
Posts: 12
I am trying to write a Kix script that will add our '.aInternet' group to the local Administrators group on the Local PC.

I have tried the following:
SHELL '%ComSpec% /c net localGroup Administrators "$Domain\.aInternet" /Add'

That didn't seem to work.

Thanks

Top
#116771 - 2004-03-24 10:04 PM Re: Add Domain Group to local Admin Group
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Only Administrators cann add groups to the Administrators group.
_________________________
There are two types of vessels, submarines and targets.

Top
#116772 - 2004-03-25 01:14 AM Re: Add Domain Group to local Admin Group
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Try trapping the error code. What does this say?

Code:

SHELL '%ComSpec% /c net localGroup Administrators "$Domain\.aInternet" /Add'
@ERROR + " | " + @SERROR ?


Top
#116773 - 2004-03-25 03:56 PM Re: Add Domain Group to local Admin Group
morphus Offline
Fresh Scripter

Registered: 2004-03-25
Posts: 20
Thank for the info... However it still fail, doesn't complete execution... here is the code

Dim $EXEC
$EXEC = '%COMSPEC% /c \\s-netstorage\OfflineMigrationLog$\Tools\csccmd.exe /moveshare:\\' + $OLDSERVERNAME + '\' + $SHARENAME + '\' + @USERID + ' \\' + $NEWSERVERNAME + '\' + $SHARENAME + '\' + @USERID

? $EXEC
Shell $EXEC

Top
#116774 - 2004-03-25 03:57 PM Re: Add Domain Group to local Admin Group
morphus Offline
Fresh Scripter

Registered: 2004-03-25
Posts: 20
Give

0

Thank

ML

Top
#116775 - 2004-03-25 04:06 PM Re: Add Domain Group to local Admin Group
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
morphus,
Just how does your contribution relate to this thread?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#116776 - 2004-03-25 10:18 PM Re: Add Domain Group to local Admin Group
CBehrent Offline
Fresh Scripter

Registered: 2003-08-18
Posts: 12
I can get that script to work now. but I want to change it from 'Administrators' group to 'Power Users' group. I changed the name of the group to Power Users but it didn't work. How do I get the same script to work with the Power Users group.
Top
#116777 - 2004-03-25 10:44 PM Re: Add Domain Group to local Admin Group
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Probably just need to add quotes around it since there is a space.

Please post the code that you are currently trying so that we can see for ourselves.

Top
#116778 - 2004-03-25 11:40 PM Re: Add Domain Group to local Admin Group
CBehrent Offline
Fresh Scripter

Registered: 2003-08-18
Posts: 12
All fixed now, thanks for your help!
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 293 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.057 seconds in which 0.023 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