Windows – way to setup .net trust in Group policy

group-policywindows

We are using roaming profiles where our settings are stored on a mapped drive. Is there a way for me to set .net to trust this user profile path in group policy?

Best Answer

There is no specific Group Policy setting that allows you to manage .NET Trusts, however you can write startup scripts to use the caspol.exe utility to trust specific locations or Assemblies. Running .NET applications of file shares can cause some unusual and difficult to identify errors.

Trust a folder

set PATH=%PATH%;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\
caspol -quiet -m -ag 1.2 -url file://server/path/* FullTrust

Trust a specific assembly

set PATH=%PATH%;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\
CasPol -quiet -m -ag 1.2 -hash SHA1 -file \\server\path\asm.exe FullTrust

You will have to modify the path based upon the version of .NET you are using, and or adapt the above to VBScript or PowerShell depending on your environment and experience.