Udostępnij za pośrednictwem


How to: Turn Security On and Off Using Caspol.exe

You can use the Code Access Security Policy tool (Caspol.exe) to turn security on and off. When code access security is disabled, all code access demands succeed. Disabling code access security makes the system vulnerable to attacks by malicious code such as viruses and worms. Turning off security gains some extra performance but should only be done when other security measures have been taken to help protect system security examples. Examples of other security precautions include disconnecting from public networks, physically securing computers, and so on.

Caution noteCaution

Turning off code access security is a computer-wide operation that terminates security checks for all managed code and for all users on the computer. Although the –list option shows that security is turned off, nothing else clearly indicates for other users that security has been turned off. If side-by-side versions of the common language runtime are installed, this command turns off security for every version of the runtime installed on the computer.

To turn off security

  • Type the following command at the command prompt:

    caspol –security off
    

To turn on security

  • Type the following command at the command prompt:

    caspol –security on
    

See Also

Reference

Caspol.exe (Code Access Security Policy Tool)

Concepts

Security Policy Model

Other Resources

Configuring Security Policy Using the Code Access Security Policy Tool (Caspol.exe)

Resolving Security Policy Issues Using Caspol.exe