This shows you the differences between two versions of the page.
userspace:windows7 [2011/11/21 13:51] Thomas_H |
userspace:windows7 [2021/08/23 08:37] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Domainjoin Windows 7 (32Bit) ====== | ||
- | ==== Domainjoin with a script ==== | ||
- | |||
- | 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 ' | ||
- | |||
- | 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 === | ||
- | <code winst> | ||
- | [INITIAL] | ||
- | Message = " | ||
- | |||
- | [Actions] | ||
- | DefVar $dom$ | ||
- | DefVar $user$ | ||
- | DefVar $password$ | ||
- | set $dom$ = GetProductProperty(" | ||
- | set $user$ = GetProductProperty(" | ||
- | set $password$ = GetProductProperty(" | ||
- | PatchTextFile_Create_powershell %scriptpath%\join.ps1 | ||
- | ShellBatch_JoinDom | ||
- | |||
- | |||
- | [PatchTextFile_Create_powershell] | ||
- | AddLine | ||
- | AddLine | ||
- | AddLine | ||
- | SaveToFile " | ||
- | |||
- | [ShellBatch_JoinDom] | ||
- | set-executionpolicy RemoteSigned | ||
- | powershell c: | ||
- | del c: | ||
- | </ | ||
- | |||
- | ---- | ||
- | ==== Domainjoin with a Samba PDC ==== | ||
- | |||
- | by chewbacca | ||
- | |||
- | tested by: // | ||
- | |||
- | Edit the / | ||
- | |||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | </ | ||
- | < | ||
- | < | ||
- | < | ||
- | </ | ||
- | </ | ||
- | </ | ||
- | |||
- | Domain means: the domain the client should be included\\ | ||
- | Password means: the password of the domainadmin, | ||
- | Username means: the name of the domainadmin.\\ | ||
- | |||
- | Beginners please note: if the domainadmin' | ||
- | |||
- | Create a file named " | ||
- | |||
- | === join.vbs === | ||
- | <code winst> | ||
- | Const JOIN_DOMAIN = 1 | ||
- | Const ACCT_CREATE = 2 | ||
- | Const ACCT_DELETE = 4 | ||
- | Const WIN9X_UPGRADE = 16 | ||
- | Const DOMAIN_JOIN_IF_JOINED = 32 | ||
- | Const JOIN_UNSECURE = 64 | ||
- | Const MACHINE_PASSWORD_PASSED = 128 | ||
- | Const DEFERRED_SPN_SET = 256 | ||
- | Const INSTALL_INVOCATION = 262144 | ||
- | |||
- | strDomain = " | ||
- | strPassword = "very secret" | ||
- | strUser = " | ||
- | |||
- | Set objNetwork = CreateObject(" | ||
- | strComputer = objNetwork.ComputerName | ||
- | |||
- | Set objComputer = GetObject(" | ||
- | strComputer & " | ||
- | strComputer & "'" | ||
- | |||
- | ReturnValue = objComputer.JoinDomainOrWorkGroup(strDomain, | ||
- | strPassword, | ||
- | JOIN_DOMAIN + ACCT_CREATE) | ||
- | | ||
- | Set WSHShell = WScript.CreateObject(" | ||
- | WshShell.Run " | ||
- | |||
- | Wscript.Quit | ||
- | </ | ||
- | |||
- | and copy it to / | ||
- | |||
- | Create a file name " | ||
- | |||
- | === default.reg === | ||
- | <code winst> | ||
- | Windows Registry Editor Version 5.00 | ||
- | |||
- | ;Insert Samba Patch | ||
- | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters] | ||
- | " | ||
- | " | ||
- | |||
- | ;join Domain at first start | ||
- | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce] | ||
- | " | ||
- | </ | ||
- | |||
- | and copy it to / | ||
- | |||
- | Create a file named " | ||
- | |||
- | === 21_reg.cmd === | ||
- | <code winst> | ||
- | rem --- Win7samba Patch and Join Script | ||
- | echo [%date% %time%] copy -s " | ||
- | copy " | ||
- | echo [%date% %time%] Executing: regedit /s " | ||
- | regedit /s " | ||
- | </ | ||
- | |||
- | and copy it to / | ||
- | |||
- | Set the rights of all three files to user opsiconfd: | ||
- | |||
- | Please note: At the moment this solution leaves the " | ||
- | ---- |