echo off
rem 20070620/NH
rem Adds permissions to execute .NET application from an UNC name or network drive ("Intranet" zone)
rem     http://www.developersdex.com/asp/message.asp?p=2912&r=5168831
rem     http://www.dx21.com/HOME/ARTICLES/P2P/ARTICLE.ASP?CID=57
rem     http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfCodeAccessSecurityPolicyUtilityCaspolexe.asp
rem     http://www.gnonug.org/Support/FAQ/85.aspx
rem The files modified by these commands are:
rem     C:\WINNT\Microsoft.NET\Framework\v2.0.50727\CONFIG\security.config*
rem
rem Actual problem is that the UNC name might be mapped in the Internet_Zone (Internet Explorer properties, Security tab)
rem     Thanks for your hit. It appeared that on the PC's where the app didn't work
rem     the site was added to the trusted zone. After removing the site from the
rem     trusted zone, the app worked quite fine. Also giving the UNC Share FullTrust
rem     permissons to the Trusted Zone group (and the site back in the trusted sites)
rem     gave correct results.
rem
rem Testing the condition is done with the following:
rem     C:\WINNT\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -listgroups
rem     C:\WINNT\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -resolvegroup \\10.0.1.1\iis\wwwroots\travelfat_corporate\Corporate.aspx

rem C:\WINNT\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -quiet -machine -addgroup LocalIntranet_Zone -url \\10.0.1.1\iis\wwwroots\* FullTrust
rem C:\WINNT\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -quiet -machine -addgroup Trusted_Zone -url \\10.0.1.1\iis\wwwroots\* FullTrust
rem C:\WINNT\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -quiet -machine -addgroup Restricted_Zone -url \\10.0.1.1\iis\wwwroots\* FullTrust
rem 20070721/NH : remplaced .NET2.0 with .NET1.1 for TravelFAT DLL execution problems...
rem C:\WINNT\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -quiet -machine -addgroup Internet_Zone -url \\10.0.1.1\iis\wwwroots\* FullTrust
rem C:\WINNT\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -quiet -machine -addgroup Internet_Zone -url \\10.0.1.64\iis\wwwroots\* FullTrust
rem C:\WINNT\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -quiet -machine -addgroup Internet_Zone -url \\10.0.1.65\iis\wwwroots\* FullTrust
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\CasPol.exe -quiet -machine -addgroup Internet_Zone -url \\10.0.1.1\iis\wwwroots\* FullTrust
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\CasPol.exe -quiet -machine -addgroup Internet_Zone -url \\10.0.1.64\iis\wwwroots\* FullTrust
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\CasPol.exe -quiet -machine -addgroup Internet_Zone -url \\10.0.1.65\iis\wwwroots\* FullTrust
