Getting the Fully Qualified Domain Name

Got a problem you cannot solve? Try here.
Post Reply
Kostya
Posts: 29
Joined: Tue Jul 25, 2017 8:09 am

Getting the Fully Qualified Domain Name

Post by Kostya »

Hello,

I need to get a fully qualified domain name (FQDN) if the computer is part of a domain, and a short computer name if not. Is it possible to do this using standard InstallAware commands?

Thanks,
Kostya
JohnGaver
Posts: 265
Joined: Mon Feb 05, 2024 6:15 pm

Re: Getting the Fully Qualified Domain Name

Post by JohnGaver »

The Get System Settings command is your friend.

Have you looked at the following parameters:

Logged on Computer Name
Logged on Domain Name
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installawa ... atform.htm
Kostya
Posts: 29
Joined: Tue Jul 25, 2017 8:09 am

Re: Getting the Fully Qualified Domain Name

Post by Kostya »

John, thanks for your reply! The thing is that when I tried the Get System Settings command, if the computer is not part of a domain, then the domain name is not empty, but the same as the computer name. Combining the computer and domain name values I would get "COMPUTER1.COMPUTER1". Although, in this case I need the computer name only.

So, I expected that with the Logged on Domain Name parameter it returns an empty value in the described case. If it does not, then can I be sure that if the values ​​I get when using the Logged on Computer Name and Logged on Domain Name parameters are the same, then the computer is not part of a domain and the obtained domain name can simply be discarded? I'm just afraid I'm missing a more correct way to determine this.
Kostya
Posts: 29
Joined: Tue Jul 25, 2017 8:09 am

Re: Getting the Fully Qualified Domain Name

Post by Kostya »

John, since this still remains unclear, let me ask you straight: was it intended and is it correct that if my computer is not part of a domain, the following command returns the computer name?

Code: Select all

Set Variable DOMAIN_NAME to 
Get System Setting Logged on Domain Name into DOMAIN_NAME
In this case, I will have to determine the "not part of a domain" case somehow differently, since I don't find any command for this.
JohnGaver
Posts: 265
Joined: Mon Feb 05, 2024 6:15 pm

Re: Getting the Fully Qualified Domain Name

Post by JohnGaver »

Oh I missed your reply from last week!

I have been able to confirm that this behavior is as designed - if the user hasn't been joined to a domain, the returned domain name is simply the name of the local device.

You could maybe compare the two values, and if they are equal - conclude that the computer has not been joined to a domain?
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installawa ... atform.htm
Kostya
Posts: 29
Joined: Tue Jul 25, 2017 8:09 am

Re: Getting the Fully Qualified Domain Name

Post by Kostya »

Got it, thanks for confirming! Yes, this way works.
Post Reply