w10install/tools/adjoin.cmd

29 lines
640 B
Batchfile
Raw Permalink Normal View History

2023-12-03 14:04:37 +01:00
@echo off
call check-for-admin
if %ERRORLEVEL% neq 0 exit /b
set TOOLS=c:\tools
set SCRIPT_SETTINGS=%TOOLS%\scripts\settings.cmd
2024-02-25 10:50:33 +01:00
set CUSTOM_SETTINGS=%TOOLS%\custom\settings.cmd
2023-12-03 14:04:37 +01:00
echo ####### %0 #######
if NOT EXIST %SCRIPT_SETTINGS% (
echo INFO: config file %SCRIPT_SETTINGS% NOT FOUND
) else (
call %SCRIPT_SETTINGS%
)
2024-02-21 11:58:08 +01:00
if NOT EXIST %CUSTOM_SETTINGS% (
echo INFO: config file %CUSTOM_SETTINGS% NOT FOUND
2023-12-03 14:04:37 +01:00
) else (
2024-02-21 11:58:08 +01:00
call %CUSTOM_SETTINGS%
2023-12-03 14:04:37 +01:00
)
echo JOINING domain ...
echo domain=%domain%
powershell -Command "Add-Computer -DomainName %domain% -Restart -Credential $env:UserName"
echo ####### %0 #######