<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.iis.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:cs="http://blogs.iis.net/"><channel><title>IIS7 - Configuration &amp; Scripting</title><link>http://forums.iis.net/1046.aspx</link><description>Forum aimed at understanding the system.Webserver or system.ApplicationHost using a text editor or scripting</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: what permission need to call Microsoft.Web.Administration namespace?</title><link>http://forums.iis.net/thread/1910181.aspx</link><pubDate>Mon, 13 Jul 2009 23:08:01 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1910181</guid><dc:creator>lextm</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1910181.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1046&amp;PostID=1910181</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I am not sure if the account you use to run this service has enough rights to access %windir%\system32\inetsrv\config\applicationHost.config.&lt;/p&gt;&lt;p&gt;If it can read that XML file, you can get almost all IIS settings from it.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>what permission need to call Microsoft.Web.Administration namespace?</title><link>http://forums.iis.net/thread/1910174.aspx</link><pubDate>Mon, 13 Jul 2009 22:03:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1910174</guid><dc:creator>eunicebiz</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1910174.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1046&amp;PostID=1910174</wfw:commentRss><description>&lt;p&gt;I have a windows service, which run through Network Service account. In this windows service, I have a method (c#) which call Microsoft.Web.Administration to get a physical path for a web application hosted on IIS 7 (win2k8 64bit server) :&lt;/p&gt;
&lt;p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Site&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; site = serverManager.Sites[&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Default Web Site&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;];&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;
&lt;p&gt;Application&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; app = site.Applications[&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/MyVirDir&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;];&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; s =&amp;nbsp;&lt;/font&gt;app.Path;&lt;/p&gt;
&lt;p&gt;However,&amp;nbsp;the&amp;nbsp;windows&amp;nbsp;service failed&amp;nbsp;due to permission issue, changing windows service Identity to Local System&amp;nbsp;made it work.&lt;/p&gt;
&lt;p&gt;However, I am not allowed to&amp;nbsp;raise security level on this windows service. Are there any other options to get physical path?&lt;/p&gt;
&lt;p&gt;Thank you in advance&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;</description></item></channel></rss>