Answered by:
How to obtain Server Name

Question
-
User-377607679 posted
hi,
Can anyone suggest me that how can i get the derver name by using asp.net from the localhost computer. so that i can give the server name at LDAP://{servername}
thanks in advance
aks
Wednesday, July 4, 2007 8:32 AM
Answers
-
User-1567482218 posted
Use -
Request.ServerVariables["SERVER_NAME"]
or
Request.ServerVariables["LOCAL_ADDR"]
The list of Server Variables that you can extract info from, is here - http://www.w3schools.com/asp/coll_servervariables.asp- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, July 5, 2007 1:24 AM
All replies
-
User-1299008639 posted
try setting debugging on, then you see all kind of interesting servervariables :)
(dont know them exactly from memory)
Wednesday, July 4, 2007 8:42 AM -
User1588321482 posted
You don't need a server name as you can bind serverless. Either you can bind to the namespace of AD or you can bind to RootDSE and then get the well-known naming context of defaultnamingcontext
Wednesday, July 4, 2007 8:51 AM -
User-377607679 posted
hi paul,
Ya you right but not in the case when you are using local machine account.
Means You can't use it from local machine :)
any way, Thanks for your interest
Wednesday, July 4, 2007 11:57 PM -
User-1567482218 posted
Use -
Request.ServerVariables["SERVER_NAME"]
or
Request.ServerVariables["LOCAL_ADDR"]
The list of Server Variables that you can extract info from, is here - http://www.w3schools.com/asp/coll_servervariables.asp- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, July 5, 2007 1:24 AM