do not restart on domain join with MDT

This commit is contained in:
2025-10-14 01:52:19 -05:00
parent 3f9175317c
commit 1ee5438c92

View File

@@ -66,14 +66,14 @@ if ($CompType -like "WKS") {
if ([boolean](get-variable "DomainOU" -ErrorAction SilentlyContinue)) { if ([boolean](get-variable "DomainOU" -ErrorAction SilentlyContinue)) {
try { try {
Add-Computer -DomainName technolog.net -Credential $DomainCredential -OUPath $DomainOU -Restart Add-Computer -DomainName technolog.net -Credential $DomainCredential -OUPath $DomainOU
} catch { } catch {
Write-Host "Couldn't join the domain with OU $DomainOU" Write-Host "Couldn't join the domain with OU $DomainOU"
} }
} }
else { else {
try { try {
Add-Computer -DomainName technolog.net -Credential $DomainCredential -Restart Add-Computer -DomainName technolog.net -Credential $DomainCredential
} catch { } catch {
Write-Host "Couldn't join the domain!" Write-Host "Couldn't join the domain!"
} }