added property machineobjectou for directly joining into an organisation unit; check exitcode <> 0;

advice/description
This commit is contained in:
Dennis Trinks 2012-05-07 15:45:13 +02:00
parent f787fe5899
commit 5fdf4be5cc
3 changed files with 30 additions and 3 deletions

View File

@ -10,6 +10,7 @@ DefVar $domainname$
DefVar $joinadmin$
DefVar $joinadminpw$
DefVar $localadminpw$
DefVar $orgunit$
DefVar $joinstr$
DefVar $MsiId$
DefVar $UninstallProgram$
@ -26,7 +27,12 @@ Set $LogDir$ = "%SystemDrive%\tmp"
Set $domainname$ = GetProductProperty ("domainname","values")
Set $joinadmin$ = GetProductProperty ("joinadmin","values")
Set $joinadminpw$ = GetProductProperty ("joinadminpw","values")
Set $joinstr$ = "JOIN %PCName% /Domain:" + $domainname$ + " /UserD:" + $joinadmin$ + " /PasswordD:" + $joinadminpw$
Set $orgunit$ = GetProductProperty ("MachineObjectOU","values")
if not ($orgunit$ = "")
Set $joinstr$ = "JOIN %PCName% /Domain:" + $domainname$ + " /UserD:" + $joinadmin$ + " /PasswordD:" + $joinadminpw$ + " /OU:" + $orgunit$
else
Set $joinstr$ = "JOIN %PCName% /Domain:" + $domainname$ + " /UserD:" + $joinadmin$ + " /PasswordD:" + $joinadminpw$
endif
Set $localadminpw$ = GetProductProperty ("localadminpw","values")
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
@ -98,3 +104,15 @@ copy "%ScriptPath%\netdom.exe" %System%
net user Administrator $localadminpw$
netdom.exe $joinstr$
[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
comment "Looks good: setup program gives exitcode zero"
else
comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
isFatalError
endif

View File

@ -7,7 +7,7 @@ incremental: False
type: localboot
id: windows.domainjoin
name: windows.domainjoin
description: Package for domainjoin and setting local adminpassword
description: Package for joining domain (organisation unit optional) and setting local adminpassword
advice: ADVICE
version: VERSION
priority: PRIORITY
@ -39,6 +39,15 @@ description: Domain PC joins
values: [""]
default: ["DomainName"]
[ProductProperty]
type: unicode
name: MachineObjectOU
multivalue: False
editable: True
description: OU moving the new PC to. If empty, the default OU will be used.
values: [""]
default: [""]
[ProductProperty]
type: unicode
name: joinadmin

View File

@ -6,7 +6,7 @@ PN="windows.domainjoin"
VERSION="1"
RELEASE="1"
PRIORITY="0"
ADVICE="Mandatory items: domainname / joinadmin / joinadminpw / localadminpw"
ADVICE="Mandatory items: domainname / joinadmin / joinadminpw / localadminpw | Optional items: machineobjectou (RFC 1779)"
# TYPE - defines, if the install files are public or restricted.
# Valid value: restricted | public