Skip to content

CustomizeHydrationKit.ps1 doesn't update CM01 hostname in ConfigMgrUnattend.ini #31

@haakonwibe

Description

@haakonwibe

Long time fan here, but think I spotted an issue:

When using CustomizeHydrationKit.ps1 to rename server hostnames via OSDComputerName (e.g. CM01 → YOUR-PREFIX-CM01), the script correctly updates the task sequence INI files but misses the five FQDN references in DS\Applications\Install - ConfigMgr\ConfigMgrUnattend.ini.
Also affects ConfigMgrUnattendWithoutDP.ini

The domain replacement turns CM01.corp.viamonstra.com into CM01.subdomain.yourdomain.com, but the CM01 hostname portion is left unchanged.

ConfigMgr setup then fails with error 53 (network path not found) when trying to create a SQL alias against a hostname that doesn't exist.

Affected lines in ConfigMgrUnattend.ini:
SDKServer=CM01.domain
ManagementPoint=CM01.domain
DistributionPoint=CM01.domain
SQLServerName=CM01.domain
CloudConnectorServer=CM01.domain

Should become (example using HW-CM01):
SDKServer=HW-CM01.domain
ManagementPoint=HW-CM01.domain
DistributionPoint=HW-CM01.domain
SQLServerName=HW-CM01.domain
CloudConnectorServer=HW-CM01.domain

Error from ConfigMgrSetup.log:
CTool::ConfigureSQLAlias() failed to connect to the Registry with error 53
ERROR: Failed to configure SQL alias CM01.corp.example.com on server CM01.corp.example.com.

Suggested fix:
Add a $NewCM01ComputerName parameter and replacements targeting both files:

If($NewCM01ComputerName) {
    Update-HKContent -fileName "$HydrationSource\DS\Applications\Install - ConfigMgr\ConfigMgrUnattend.ini" `
        -orgValue "CM01.$NewDomainName" -newValue "$NewCM01ComputerName.$NewDomainName"
    Update-HKContent -fileName "$HydrationSource\DS\Applications\Install - ConfigMgr\ConfigMgrUnattendWithoutDP.ini" `
        -orgValue "CM01.$NewDomainName" -newValue "$NewCM01ComputerName.$NewDomainName"
}

If I'm not mistaken, this won't be an issue for the other servers since this is the only one which uses the unattend file specifically for SQL server and internal FQDN variables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions