Join Domain and add Global Group in localadmin at same time

S

Svensson

hello !

m trying to scrip our computers to join domain and then add a globalgroup in
local admingroup ...it is no problem to just join domain but i unable to add
the global group until i have restarted an logged on and rersun the
script..i get an trust error ..i know that i wont have to restart because im
able to do it manually but then i get an logonprompt...

how can i make this happen with a script ?

this is the script i use

%TEMP%\netdom.exe REMOVE %COMPUTERNAME% /Domain:OUDOMAIN
/UserD:DOMAIN\adminuser /PasswordD:adminpassword > %TEMP%\netdom.log
%TEMP%\netdom.exe ADD %COMPUTERNAME% /Domain:OUDOMAIN
/UserD:DOMAIN\adminuser /PasswordD:adminpassword > %TEMP%\netdom.log
%TEMP%\netdom.exe JOIN %COMPUTERNAME% /Domain:OUDOMAIN
/UserD:DOMAIN\adminuser /PasswordD:adminpassword > %TEMP%\netdom.log
%TEMP%\netdom.exe VERIFY %COMPUTERNAME% /Domain:OUDOMAIN
/UserO:DOMAIN\adminuser /PasswordO:adminpassword > %TEMP%\netdom.log

%SYSTEM32%\net.exe localgroup administrators DOMAIN\GLOBALGROUP /ADD
 
R

Ron Oglesby [MVP]

Why not have your script that adds it to the domain, set the auto-login
keys, then add a runonce key to run the follow script to add in the domain
group to local admins

WE do followup like this on builds all the time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top