How do I determine which network domain I am connected to from VB.Net?
Share
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.
To get the current domain name, you can use
Environment.UserDomainName(if the user in whose context the application is running is a domain user).Alternatively,
NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainNamewill return the domain name independent of the current user (or an empty string, if the PC is not member of a domain).