
$TestCreds = Get-StoredCredential -Target 'TestCreds'Ĭleaning up old credentials is always great housekeeping. If you store this into a variable now you can use this variable for your credentials as you normally would. This will show the below but that does not help you. Using the stored Credentials Get-StoredCredential -Target 'TestCreds' No more having to deal with cred files, trying to remember what account created the txt file and fighting that mess.Ĭreating Stored Credentials New-StoredCredential -Comment 'Test_Creds' -Credentials $(Get-Credential) -Target 'TestCreds' Showing the Credentials in the Credential Manager. With these 4 commands you can now save credentials and call credentials from the credential manager. CredentialManager Module is a easy module to use, and simplistic with only 4 commands.

After doing some research and some digging and reading found this Gem of a Powershell module. I ran across a article somewhere reading on something else and remember someone saying something about saving credentials to the Windows Credential manager.

This works well but now you have to deal with actual txt files. In the past i had just been using the Import-Clixml and importing the creds saved from a txt file. I have done the whole just do Get-Credential and enter it every time I run the script but that is a great for one off scripts but not for scheduled tasks. I have been having trouble for a while dealing with credentials and how to store them when using them in scripts.
