Yesterday I created a small powershell script which adds the FQDN of a host as a Task Sequence variable to a SCCM task sequence. See below the script:
$regkey = Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" $hostname = $regkey.Hostname $domain = $regkey.domain if($domain -eq "") { $HostFQDN = $hostname } else { $HostFQDN = $hostname+"."+ $domain } $TaskSeq_var = New-Object -COMObject Microsoft.SMS.TSEnvironment $TaskSeq_var.value("HostFQDN") = $HostFQDN
One thought on “SCCM 2012: Add FQDN of host as TS variable”