...
- Credentials are objects that include the specification of a user account and password that can be used for authenticattion:
- HTTP Authentication with a JobScheduler Master.
- HTTP Authentication with a Proxy.
- Credentials objects can be created once and can be re-used:
- Credentials can be created within a PowerShell session. The PowerShell built-in
Get-Credential
cmdlet can be used to specify credentials on the fly, e.g. prompting the user for input of the user account and password. - Credentials can be created outside of a PowerShell session and can be used in a PowerShell session. The
Get-JobSchedulerSystemCredentials
cmdlet can be used to retrieve an existing credentials object for authentification with the JobScheduler Master.
- Credentials can be created within a PowerShell session. The PowerShell built-in
...
Using the target name login_as_ap
from the above example allows the user who owns this credential to retrieve the credentials object.
- The
Get-JobSchedulerSystemCredentials
cmdlet accepts the target name of a system credentials object that is owned by the current user. This cmdlet returns a system credentials object. - The
Set-JobSchedulerCredentials
cmdlet expects a PowerShell credentials object, that is used for authentication when accessing the JobScheduler Master. - A conversion of system and PowerShell objects is required that can be achieved e.g. like this:
...
Explicit credentials can be specified with the Set-JobSchedulerCredentials
cmdlet like this:
Code Block | ||
---|---|---|
| ||
Set-JobSchedulerCredentials -Credentials $credentials |
...
Explicit credentials can be specified on-the-fly with the Set-JobSchedulerCredentials
cmdlet like this:
Code Block | ||
---|---|---|
| ||
Set-JobSchedulerCredentials -AskForCredentials |
...
- The cmdlet will prompt for input of the user account and password that are used for authentication with a proxy server.
Specifying credentials with the Web Service URL
Explicit credentials can be specified on-the-fly with the Use-JobSchedulerWebService
cmdlet -Url parametewr like this:
Code Block | ||
---|---|---|
| ||
Use-JobSchedulerWebService -Url http://root:root@localhost:4446 -Id scheduler111 |
Explanations
- The user account and password separated by a colon are preceeding the hostname and are separated by a @ character from the hostname.
- Specifying credentials like this is considered insecure.
Using the PowerShell profile to apply credentials
- Credentials can be added to the JobScheduler CLI by a PowerShell profile. Typically the profile is stored with a file
Microsoft.PowerShell_profile.ps1
.- A number of locations are available for profiles.
- Check the value of the
$Profile
built-in variable for the currently active locations of your profile.
- You can copy & paste the above example for use of the
Get-JobSchedulerSystemCredentials
cmdlet to your PowerShell profile. This allows to automatically use the specified credentials for the JobScheduler Master.
...