K2000 Postinstall Powershell with credentials
I would like to know if it is possible to create a post installation powershell script and run it with credentials.
The k1000 is capable of this and it would be great to do this right after a system image deployment.
Community Chosen Answer
You can write passwords in Powershell as a secure string to a file and reuse later.
If you upload the file to KACE SDA and call it in your Powershell script, you always have your Crendentials with you.
Create Secure String in cred.txt
PS C:\> read-host -assecurestring | convertfrom-securestring | out-file C:\cred.txt
Get it back to a password
PS C:\> $password = get-content C:\cred.txt | convertto-securestring
Create a credential object, which you can use in cmdlets
PS C:\> $credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist "myusername",$password