Hi In a single server Windows domain, does anyone know how to get the servername. For example, in my test environment, we have a single Windows Small Business Server 2008 called horatio, it is the domain controller for longtest.local.
I have played around with the system.dns (with no positive results) :
Dim myIP As IPHostEntry = Dns.GetHostEntry(My.Computer.Name)
Dim IPAddress As String = myIP.AddressList.GetValue(0).ToString
Dim myFullDomainName = Dns.GetHostEntry(IPAddress).HostName
Dim DomainParts() As String = myFullDomainName.Split("."c)
Dim DomainName As String = DomainParts(1)
However, I cannot seem to grab the servername, I need a function like :
GetDomainServer() that will return horatio (from the example above. Driving me a bit mad this one.
Regards Mark Harby Nottingham. UK