Executing custom scripts

In most cases, the permission to execute scripts is restricted. You can use the native PowerShell cmdlet Get-ExecutionPolicy to check whether you have permission to execute scripts using your current account credentials and the native Set-ExecutionPolicy cmdlet to specify an execution policy.

To check and update the execution policy for scripts

  1. Open the Centrify Audit Module for PowerShell.
  2. Verify you have permission to execute scripts.
  3. Run the Set‑ExecutionPolicy cmdlet to change the execution policy. For example:

    Set-ExecutionPolicy Unrestricted

    For more information about execution policies and the options available, use the get‑help function.

  4. Verify you are in the directory where your scripts are located.

  5. Execute the sample script.