This is an old revision of the document!
Dieses Script fügt einen Client zu einer Domäne hinzu. Genutzt wird dazu das Powershell Tool Add-Computer
[INITIAL]
Message = "Rechner wird zur Domäne hinzugefügt!"
[Actions]
DefVar $dom$
DefVar $user$
DefVar $password$
set $dom$ = GetProductProperty("dom", " ")
set $user$ = GetProductProperty("user", " ")
set $password$ = GetProductProperty("password", " ")
PatchTextFile_Create_powershell %scriptpath%\join.ps1
ShellBatch_JoinDom
[PatchTextFile_Create_powershell]
AddLine "$secpasswd = ConvertTo-SecureString '$password$' -AsPlainText -Force"
AddLine '$mycreds = New-Object System.Management.Automation.PSCredential ("$user$", $secpasswd)'
AddLine 'Add-Computer -DomainName "$dom$" -credential $mycreds'
SaveToFile "c:\joinpatched.ps1"
[ShellBatch_JoinDom]
set-executionpolicy RemoteSigned
powershell c:\joinpatched.ps1
del c:\joinpatched.ps1