IIS Server - iis application name

This is Interesting: Free IT Magazines  
Home > Archive > IIS Server > December 2005 > iis application name





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author iis application name
jmcfetridge@coast.com

2005-12-02, 5:53 pm

is there a way to obtain the IIS application name from a running asp.net page.
Kristofer Gafvert

2005-12-02, 5:53 pm

Hello,

You are probably looking for the AppFriendlyName property:

http://msdn.microsoft.com/library/e...1cfb8ebda36.asp


Yes, you can obtain this property programmatically using ADSI or WMI, but
the user identity used must have at least read access to the metabase. And
i doubt that the ASP.NET default identity has this.

More information is available in the IIS SDK:

http://msdn.microsoft.com/library/e...6359ff427ce.asp

--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info


jmcfetridge@coast.com wrote:

>is there a way to obtain the IIS application name from a running asp.net
>page.

Chris Crowe [MVP 1997 -> 2006]

2005-12-02, 5:53 pm

Yes and No

Yes - There is a ServerVariable that you can check to get the IIS Instance
ID that the web site is running in and the metabase path.

string InstanceID = Request.ServerVariables("INSTANCE_ID");
string MetabasePath = Request.ServerVariables("INSTANCE_META_PATH");

INSTANCE_ID=1388032739
INSTANCE_META_PATH=/LM/W3SVC/1388032739

Now in order to read the Metabase to get the IIS Application you would need
to be an Administrator which means that the code that does the Metabase
lookup needs to be running as a Local Administrator.

This has security ramifications.

--

Cheers

Chris Crowe [IIS MVP 1997 -> 2006]
http://blog.crowe.co.nz
------------------------------------------------


"jmcfetridge@coast.com" <jmcfetridgecoastcom@discussions.microsoft.com>
wrote in message news:9FC378C0-3672-4BC5-A216-B02BB3C82864@microsoft.com...
> is there a way to obtain the IIS application name from a running asp.net
> page.



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com