Clarifying Credential Confusion

Learn about two sets of credentials that you might need when renaming a scheduled task with the Rename-ScheduledTask.ps1 script.

Bill Stewart

October 24, 2011

1 Min Read
ITPro Today logo in a gray background | ITPro Today

There are two sets of credentials you might need when renaming a scheduled task using Rename-ScheduledTask.ps1:

  •   The -ConnectionCredential parameter specifies the credentials to use to connect to the schedule service on the computer where the task is stored (either the local computer or a remote computer). If you aren't a member of the Administrators group on the computer hosting the task, you can connect to the schedule service using administrator credentials.

  • The -TaskCredential parameter specifies the credentials for the task itself, if needed. Task credentials are needed only when the task's Run whether user is logged on or not option is selected and the Do not store password option is not selected. If credentials are required and you don't specify the -TaskCredential parameter, the script will prompt you for credentials.

Both the -ConnectionCredential and -TaskCredential parameters require a PSCredential object as their argument. A PSCredential object securely stores a username and password for use in security operations. However, there is an important caveat you need to know about: Rename-ScheduledTask.ps1 converts the secure passwords in PSCredential objects to plain text because the scripting object model doesn't support PSCredential objects.

You can easily create PSCredential objects by using the Get-Credential cmdlet. Run the command

Get-Help Get-Credential

 

at a PowerShell prompt for more information about PSCredential objects.

Back to main article.

 

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like