Author | Klaas Vandenberghe (@PowerDBAKlaas) , Simone Bizzotto (@niphold) |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Resolve-DbaNetworkName on GitHub.
Want to see the Bill Of Health for this command? Check out Resolve-DbaNetworkName.
Returns information about the network connection of the target computer including NetBIOS name, IP Address, domain name and fully qualified domain name (FQDN).
Retrieves the IPAddress, ComputerName from one computer.
The object can be used to take action against its name or IPAddress.
First ICMP is used to test the connection, and get the connected IPAddress.
Multiple protocols (e.g. WMI, CIM, etc) are attempted before giving up.
Important: Remember that FQDN doesn't always match "ComputerName dot Domain" as AD intends.
There are network setup (google "disjoint domain") where AD and DNS do not match.
"Full computer name" (as reported by sysdm.cpl) is the only match between the two,
and it matches the "DNSHostName" property of the computer object stored in AD.
This means that the notation of FQDN that matches "ComputerName dot Domain" is incorrect
in those scenarios.
In other words, the "suffix" of the FQDN CAN be different from the AD Domain.
This cmdlet has been providing good results since its inception but for lack of useful
names some doubts may arise.
Let this clear the doubts:
So, if you need to use something, go with FullComputerName, always, as it is the most correct in every scenario.
Resolve-DbaNetworkName
[[-ComputerName] <DbaInstanceParameter[]>]
[[-Credential] <PSCredential>]
[-Turbo]
[-EnableException]
[<CommonParameters>]
PS C:\> Resolve-DbaNetworkName -ComputerName sql2014
Returns a custom object displaying InputName, ComputerName, IPAddress, DNSHostName, DNSDomain, Domain, DNSHostEntry, FQDN, DNSHostEntry for sql2014
PS C:\> Resolve-DbaNetworkName -ComputerName sql2016, sql2014
Returns a custom object displaying InputName, ComputerName, IPAddress, DNSHostName, DNSDomain, Domain, DNSHostEntry, FQDN, DNSHostEntry for sql2016 and sql2014
PS C:\> Get-DbaRegServer -SqlInstance sql2014 | Resolve-DbaNetworkName
Returns a custom object displaying InputName, ComputerName, IPAddress, DNSHostName, DNSDomain, Domain, DNSHostEntry, FQDN, DNSHostEntry for all SQL Servers returned by Get-DbaRegServer
PS C:\> Get-DbaRegServer -SqlInstance sql2014, sql2016\sqlexpress | Resolve-DbaNetworkName
Returns a custom object displaying InputName, ComputerName, IPAddress, DNSHostName, DNSDomain, Domain, DNSHostEntry, FQDN, DNSHostEntry for all SQL Servers returned by Get-DbaRegServer
The target SQL Server instance or instances.
This can be the name of a computer, a SMO object, an IP address or a SQL Instance.
Alias | |
Required | False |
Pipeline | true (ByValue) |
Default Value | $env:COMPUTERNAME |
Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).
Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported.
For MFA support, please use Connect-DbaInstance.
Alias | |
Required | False |
Pipeline | false |
Default Value |
Resolves without accessing the server itself. Faster but may be less accurate because it relies on DNS only,
so it may fail spectacularly for disjoin-domain setups. Also, everyone has its own DNS (i.e. results may vary
changing the computer where the function runs)
Alias | FastParrot |
Required | False |
Pipeline | false |
Default Value | False |
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |