Scripting Question

KBE Powershell passing variable to post-install task

06/24/2015 2275 views

We are currently implementing Powershell within the KBE to run through a user creation script. 
As part of this script an Active Directory user is created and we would like to pass this through to a post-install task. 

Ultimately we are looking to automate the deployment, so that when it has been completed the user that was created is logged on. 

Please can someone advise if this has been done before, or offer some assistance with scripting?

Phil Rich 
0 Comments   [ + ] Show comments


All Answers

I would push your data to a text file that you put on the deployment drive, and then have a PO that reads the data from that file.  root/KACE would be a good location as it gets deleted during cleanup.

Answered 06/24/2015 by: cserrins
Red Belt

  • Thanks Corey, are you able to clarify what letter/drive the deployment drive is? If I write the file as a pre-install will the post-install task pick this up?

    As this is fairly new to me, is it an easy thing to pass data into the PO and what would I use (VBS, PS, BAT)?

    • Each of those languages allow you to output to a file, so it is fairly simple. You could of course hard code the drive letter of the deployed drive that would get windows, however, it would be better to read the EnvVars.xml file on x:\kace\engine\ for the system_drive
      You can do this as a preinstall, but only after you any partition/formatting tasks, otherwise it would get overwritten.