Today I’m writing about something fairly simple that is covered in a lot of places. I find myself searching for this every month or so so I figured I’d put it in my blog so I remember where to look.
How to create a Credential object in PowerShell without using get-credential. Every once in awhile I find I need a script to load alternate credentials internally. so here is how we do it:
New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList (‘Domain\Username’,(convertto-securestring -string password -asplaintext -force))
And that’s it for today.
Thanks for reading!