Is there a way to get the Sharepoint server’s IP address?
This code below just retrieves the hostname but I need to know the IP address.
string hostName = SPServer.Local.Address;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Given a host name you can get the IP address of the host by using Dns.GetHostEntry in the
System.Netnamespace.You can get the first IPv4 address of a host name using this code:
The code will throw exceptions if either the host is unknown or if it doesn’t have an IPv4 address.