This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
userspace:windows7 [2011/11/21 13:51] Thomas_H |
userspace:windows7 [2021/08/23 08:37] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Domainjoin Windows 7 (32Bit) | + | ====== Domainjoin Windows 7 ====== |
- | ==== Domainjoin with a script ==== | + | \\ |
+ | Tip: | ||
- | Dieses Script fügt einen Client zu einer Domäne hinzu. Genutzt wird dazu das Powershell Tool Add-Computer\\ | + | http:// |
- | This Script adds a client | + | Method : wmic |
+ | |||
+ | ===== Domainjoin via add-computer command (Opsi Package) ===== | ||
+ | |||
+ | This Script adds a client to a domain using powershell-tool ' | ||
+ | Dieses Script fügt einen Client zu einer Domäne hinzu. Genutzt wird dazu das Powershell Tool Add-Computer. | ||
+ | |||
+ | You are able to choose | ||
by tobias | by tobias | ||
- | == Properties == | + | === Properties === |
+ | Create a OPSI Package with the following product properties: | ||
* dom - Domäne /domain | * dom - Domäne /domain | ||
* user - Benutzer zum hinzufügen in die Domäne / User with add-domain-rights | * user - Benutzer zum hinzufügen in die Domäne / User with add-domain-rights | ||
Line 16: | Line 25: | ||
<code winst> | <code winst> | ||
[INITIAL] | [INITIAL] | ||
- | Message = " | + | ;Message = " |
+ | Message = "Join computer to the domain!" | ||
[Actions] | [Actions] | ||
Line 41: | Line 51: | ||
</ | </ | ||
- | ---- | + | \\ |
- | ==== Domainjoin with a Samba PDC ==== | + | \\ |
+ | |||
+ | ===== Domainjoin with an opsi-package ===== | ||
+ | |||
+ | This Script will show you how to make a Domainjoin in Windows7 with a selfmade opsi-product. | ||
+ | I choose this way because not every auto-installed Client must be a member of the Domain and you are more flexible by installing the Clients. | ||
+ | |||
+ | Script by Mike1987 | ||
+ | |||
+ | * **Tested with opsi 4.0.1** | ||
+ | * **Tested with opsi-winst 4.11.1.6** | ||
+ | * **Tested with win7-x64 4.0.1-5 (Windows7-x64 Professional)** | ||
+ | |||
+ | **THIS PRODUCT IS ABLE TO BE USED IN WINDOWS 7 32-Bit AND 64-Bit ARCHITECTURES!!!** | ||
+ | |||
+ | First of all you have to create a new opsi localboot product (description in Details in the opsi-manual) | ||
+ | In this example the name of the opsi-prodcut is windows7-domainjoin | ||
+ | |||
+ | Content of **setup.ins** | ||
+ | |||
+ | <code winst> | ||
+ | [Initial] | ||
+ | Message= Windows7-Domainjoin | ||
+ | SetLogLevel=6 | ||
+ | ExitOnError=false | ||
+ | ScriptErrorMessages=true | ||
+ | TraceMode=off | ||
+ | |||
+ | if FileExists64(" | ||
+ | |||
+ | Registry_install /64Bit | ||
+ | DosBatch_1 | ||
+ | else | ||
+ | Registry_install /32Bit | ||
+ | DosBatch_1 | ||
+ | endif | ||
+ | |||
+ | [Registry_install] | ||
+ | openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] | ||
+ | set " | ||
+ | set " | ||
+ | set " | ||
+ | |||
+ | [DosBatch_1] | ||
+ | %scriptpath%\join.cmd | ||
+ | </ | ||
+ | |||
+ | |||
+ | Content of **join.cmd** | ||
+ | |||
+ | <code winst> | ||
+ | copy " | ||
+ | copy " | ||
+ | copy " | ||
+ | C: | ||
+ | shutdown /r /f /t 0 | ||
+ | </ | ||
+ | |||
+ | Content of **join.vbs** | ||
+ | |||
+ | < | ||
+ | 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 = " | ||
+ | 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 | ||
+ | </ | ||
+ | |||
+ | Content of **domainjoin.reg** | ||
+ | |||
+ | < | ||
+ | Windows Registry Editor Version 5.00 | ||
+ | |||
+ | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters] | ||
+ | " | ||
+ | 00, | ||
+ | 77, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | |||
+ | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce] | ||
+ | @=" | ||
+ | </ | ||
+ | |||
+ | Content of **auto.reg** | ||
+ | |||
+ | < | ||
+ | Windows Registry Editor Version 5.00 | ||
+ | |||
+ | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | </ | ||
+ | |||
+ | |||
+ | All these files (a total of 5) have to be copied to the **/<PATH OF YOUR SELFMADE PRODUCTS>/ | ||
+ | |||
+ | The build the product with **opsi-makeproducfile** an install it with **opsi-package-manager -i windows7-domainjoin_1.0-1.opsi** | ||
+ | |||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | ===== Domainjoin with a Samba PDC ===== | ||
by chewbacca | by chewbacca | ||
Line 48: | Line 190: | ||
tested by: // | tested by: // | ||
- | Edit the / | + | Edit the / |
< | < | ||
Line 101: | Line 243: | ||
| | ||
Set WSHShell = WScript.CreateObject(" | Set WSHShell = WScript.CreateObject(" | ||
- | WshShell.Run " | + | WshShell.Run " |
+ | |||
+ | set shell = WScript.CreateObject(" | ||
+ | windir = shell.ExpandEnvironmentStrings(" | ||
+ | |||
+ | set filesys = CreateObject (" | ||
+ | set tempFile = filesys.Getfile(windir & " | ||
+ | tempfile.Delete | ||
Wscript.Quit | Wscript.Quit | ||
Line 141: | Line 290: | ||
Set the rights of all three files to user opsiconfd: | Set the rights of all three files to user opsiconfd: | ||
- | Please note: At the moment this solution leaves the " | ||
---- | ---- |