Quantcast
Channel: Configuration & Scripting
Viewing all articles
Browse latest Browse all 780

How to get connection string from virtual app

$
0
0

I have found that I can get the connection string from the website's web.config with this:

$connectionstrings = $iis.GetApplicationHostConfiguration().GetSection("connectionStrings","/www.myweb.com").getCollection()
$connectionstrings | select -ExpandProperty RawAttributes

But my site has virtual application running in user it that use different web.config files with different connection strings. I have tried 

$connectionstrings = $iis.GetApplicationHostConfiguration().GetSection("connectionStrings","/www.myweb.com/myapp").getCollection()

$connectionstrings | select -ExpandProperty RawAttributes

but it gives me the websites connection string instead of the individual application's. How can I access the connection string for /www.myweb.com/myapp?

Thanks!


Viewing all articles
Browse latest Browse all 780

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>