Reputation: 1966
These 2 properties appear to be set to the same values on a standard Windows domain environment. Can they be different? How can they be set to different values?
e.g.
$computer = Get-WMIObject Win32_ComputerSystem
$computer.Name
$computer.DNSHostName
Upvotes: 1
Views: 760
Reputation: 11
One difference is that 'Name' is limited by 15 chars (it works like GetComputerName() win32 API), while 'DNSHostName' is not (it works like GetComputerNameEx(ComputerNameDnsHostname) win32 API).
So 'Name' will contain truncated Computer Name if its length > 15 chars; but 'DNSHostName' will contain full Computer Name
Upvotes: 1
Reputation: 7087
They appear to be different properties, though presumably they will have the same value. Win32_ComputerSystem Doc
DNSHostName:
Name:
Document states both properties are read-only. Get-Member
suggests they are set-able, but I'd be skeptical.
Upvotes: 0