User Tools

Site Tools


userspace:windows7

This is an old revision of the document!


Domainjoin Windows 7 (32Bit)

Dieses Script fügt einen Client zu einer Domäne hinzu. Genutzt wird dazu das Powershell Tool Add-Computer
This Script adds a client to a domain. Realized by the powershell-tool 'add-computer'

by tobias

Properties
  • dom - Domäne /domain
  • user - Benutzer zum hinzufügen in die Domäne / User with add-domain-rights
  • password - Passwort des Domänenbenutzers / password of domainadmin

join.ins

[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
userspace/windows7.1321876198.txt.gz · Last modified: 2021/08/23 08:37 (external edit)