Yes. It is possible to run the script. You should run the batch file for logon script. Below is the command to check the logon server:
set logonserver
If you run this command in the Command Prompt, it display something like: LOGONSERVER=\\<servername>
Based on the logon server, you can use the IF ELSE condition and GOTO condition in the script. Below is the sample script:
Code:
if not /i "%LOGONSERVER%"=="\\DC1" goto else
then [put commands here for DC1]
goto endif
:else
[put commands here for DC2]
:endif
Change the above script as per your needs.
Bookmarks