boyemillar Posted March 19, 2008 Posted March 19, 2008 Does anyone know how to add Domain Users to a Goup Like the "Power Users Group" Usually i do this in a DOS batch file... (net localgroup "Power Users" "{mydomain}\Domain Users" /add)
PsaltyDS Posted March 19, 2008 Posted March 19, 2008 Does anyone know how to add Domain Users to a Goup Like the "Power Users Group"Usually i do this in a DOS batch file...(net localgroup "Power Users" "{mydomain}\Domain Users" /add)You could just put that in a Run() statement.Are you comfortable with COM objects? If so, you could do it with ADSI objects. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
boyemillar Posted March 19, 2008 Author Posted March 19, 2008 (edited) Do you mean run it like below where it just calls the batch file and tells it to run silent... Run(@ComSpec & "\\{myserver}\Folder\Batchfile.bat",'',@sw_hide) Edited March 19, 2008 by boyemillar
PsaltyDS Posted March 19, 2008 Posted March 19, 2008 Do you mean run it like below where it just calls the batch file and tells it to run silent... Run(@ComSpec & "\\{myserver}\Folder\Batchfile.bat",'',@sw_hide) Sort of, you don't have to put it inside a batch file: $sDomain = "MyDomain" $sDosCmd = 'net localgroup "Power Users" "' & $sDomain & '\Domain Users" /add' $RET = RunWait(@ComSpec & " /c " & $sDosCmd, @WorkingDir, @SW_SHOW) MsgBox(64, "Result", "Return code was: " & $RET) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
boyemillar Posted March 19, 2008 Author Posted March 19, 2008 Cheerz PsaltyDS I have changed it a little bit but you defo get top marks for the solution to my problem... RunWait(@ComSpec & " /c " & 'net localgroup "Power Users" "' & "Domain1" & '\Domain Users" /add', @WorkingDir, @SW_HIDE) RunWait(@ComSpec & " /c " & 'net localgroup "Power Users" "' & "Domain2" & '\Domain Users" /add', @WorkingDir, @SW_HIDE) RunWait(@ComSpec & " /c " & 'net localgroup "Power Users" "' & "Domain3" & '\Domain Users" /add', @WorkingDir, @SW_HIDE) Thanks again mate.
TPlanet Posted April 17, 2008 Posted April 17, 2008 HEy! You'll find better in http://www.autoitscript.com/forum/lofivers...php?t28868.htmlSee Ya
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now