Notes for Powershell credentials
Here are some dirty ways to store user credentials in powershell.
Get-Credential | Export-Clixml C:\path\to\output\file.xml
The same user, on the same machine, that generates that file can retrieve the contents with
$credential = Import-Clixml C:\path\to\output\file.xml
Change password
2022-03-18
Set-ADAccountPassword -Identity bgstack15 -OldPassword (ConvertTo-SecureString -AsPlainText "OldPwGoesHere" -Force) -NewPassword (ConvertTo-SecureString -AsPlainText "NewPlainTextPw" -Force)
Windows 10 does not show Get-Credential graphical prompt
2025-03-10
I forget exactly where I found this on the www, but when the Get-Credential prompt fails to display from a Powershell session, you need to run an Out-Gridview or something similar.
Get-NetIPAddress | Out-GridView
And leave it running, so then you can capture a credential.
$creds = Get-Credential
Comments