Scripting Question
K2000 Postinstall Powershell with credentials
Hi all,
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.
Kind regards,
Loei
Community Chosen Answer
Hi
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
-
We have tried this but when the script is executed during OSD we get the error that the domain (name) is not available.
We execute the script after the domainjoin.vbs script.-
The command line after booting the KBE is not helpful to test it.
You have to create a post-installation task that runs on an error. Then insert this task after the domain join task. The scripted installation must be set to stop at error. In the window that comes up, a command line can be opened. There you can try to ping the domain controller.
sorry, it's not easy to explain. Tomorrow i'll try to make some screenshots.
Comments