Secret-based Credentials for PowerShell Scripts
Overview
You can specify a secret to provide the default credentials for running all PowerShell scripts on a site. This allows sites in different data centers to have different default credentials. This applies to remote password changing, checkout hooks, and account discovery PowerShell scripts.
RunAs Secret Precedence
Remote Password Changing
The precedence order for which RunAs secret to use for remote password changing is:
-
Privileged account on the secret RPC tab
-
Secret site's RunAs secret
-
Secret
Secret Dependencies
The precedence order for which RunAs secret to use for PowerShell Secret dependencies is:
-
Privileged account on the dependency
-
Run As secret on the dependency group's site
-
Secret site's RunAs secret
-
Secret
Checkout Hooks
The precedence order for which RunAs secret to use for checkout hooks is:
-
Privileged account on the hook
-
Secret site's RunAs secret
-
Secret
Procedures
Setting the Default PowerShell Credential for a Site
To set a default PowerShell credential for a site:
-
Go to Admin > Distributed Engines > Manage Sites.
-
Select the desired site.
-
Click Edit.
-
Click the secret picker link on the Default PowerShell RunAs Secret field.
-
Click Save.
Using the Site PowerShell Credentials for Discovery
To use the site PowerShell credentials on a discovery scanner:
-
Add a PowerShell scanner to a discovery source or edit an existing scanner.
-
In the Edit dialog for the scanner, click to select the Use Site RunAs Secret checkbox.
-
Click Save.
If no RunAs secret is set on the site, you will get an error message when you try to save.