Skip to content

CustomizeHydrationKit.ps1 can create org name mismatch with NetBIOS domain name #32

@haakonwibe

Description

@haakonwibe

Follow up to #31, I think I found a new one later in the build process.

The script's $NewOrgName replacement does a blanket swap of VIAMONSTRA everywhere, including where it's used as a NetBIOS domain prefix (i.e. VIAMONSTRA).
This works in the default kit because ViaMonstra happens to be both the org name and the NetBIOS name. But unfortunately It breaks when they are different.

In this example: org name is FONTOSO, NetBIOS is HQ. The full domain name is then HQ.FONTOSO.COM.
The script turned VIAMONSTRA\Administrator into FONTOSO\Administrator instead of HQ\Administrator.

Affected files:
DS\Applications\Install - SQL Server 2019 Standard\ConfigurationFile.ini:

SQLSYSADMINACCOUNTS="VIAMONSTRA\Administrator" "BUILTIN\Administrators"
; becomes FONTOSO\Administrator — should be HQ\Administrator

DS\Applications\Install - SQL Server 2019 Standard\Install-HYDSQLServer2019.ps1:

$OriginalSQLSYSADMINACCOUNTS = "SQLSYSADMINACCOUNTS=`"VIAMONSTRA\Administrator`" `"BUILTIN\Administrators`""
; same problem, and this string must match ConfigurationFile.ini exactly or the replace silently fails

DS\Applications\Install - ConfigMgr Reporting Services Point\HYDCMRSPConfig.ps1:

$SSRSUsername = "VIAMONSTRA\CM_SR"
; becomes FONTOSO\CM_SR — should be HQ\CM_SR

Result: SQL Server setup fails because the domain account doesn't resolve. SSRS config fails for the same reason.

Suggested fix: Add a $NewNetBIOSName parameter and split the replacement logic. VIAMONSTRA\ (with trailing backslash, as a domain qualifier) should use $NewNetBIOSName.
The remaining VIAMONSTRA hits (display strings, OU paths, etc.) keep using $NewOrgName.

# New parameter
$NewNetBIOSName = "HQ"  # Default = VIAMONSTRA

# Replace domain-qualified references separately
If($NewNetBIOSName) {
    Update-HKContentRecurse -SourceFiles $sourceFiles -pattern 'VIAMONSTRA\' -NewValue "$NewNetBIOSName\" 
}

Quick way to find every affected line in a deployment share:

Get-ChildItem -Recurse "C:\CMLab\DS" -Include *.ini,*.ps1,*.wsf,*.xml | Select-String 'FONTOSO\\' | Select-Object Path, Line

Either way, can confirm it deploys like a charm after modifying the above-mentioned files :)

Thanks anyway for a pretty awesome customization script and Hydration Kit to begin with!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions