Borgas
Posts: 60
Joined: Tue Jan 22, 2008 10:49 pm

Get FQDN name

When using property [ComputerName] i am not reciving the FQDN namn. Is there property to use to recive FQDN name?
Catalin
Posts: 7492
Joined: Wed Jun 13, 2018 7:49 am

Re: Get FQDN name

Hello Boris,

The "Fully Qualified Domain Name" consists of two parts: the hostname and the domain name. The [ComputerName] property is the computer name of the current system. The installer sets this property by a system call to "GetComputerName". In this case, the [ComputerName] property is only representing the hostname.

Unfortunately, there isn't any property which stores the FQDN.

In order to get the FQDN and save its value in a property, you can create a PowerShell script as it follows:
$myFQDN=(Get-WmiObject win32_computersystem).DNSHostName+"."+(Get-WmiObject win32_computersystem).Domain
AI_SetMsiProperty YOUR_PROPERTY $myFQDN
The above script will set the "YOUR_PROPERTY" property to the $myFQDN variable value (which is the FQDN)

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”