commissar117 Posted March 20, 2015 Report post Posted March 20, 2015 Is there a way that I could create a variable that refers to the logged in user in SCCM TS here is an example where I want to use it Quote Share this post Link to post Share on other sites More sharing options...
BB24 Posted March 20, 2015 Report post Posted March 20, 2015 There are several ways to do that, how do you intend to input the logged in user name and are you doing this in WinPE or after the OS is installed? Outline of a couple script ways below. You can also create the variable within the TaskSequence through the Add - General - Set Task Sequence Variable; but I don't think that was your intent.... ---- .vbs file 'Setup the environment Set oTSEnv = CreateObject("Microsoft.SMS.TSEnvironment") strName = strInputName 'Write the TSVariable oTSEnv("genericTSvariablename") = strUserName Then call %genericTSvariablename% as you do in your example ----- .ps1 #Call SMS environment $Tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment $strName = $Tsenv.value("genericTSvariablename") Then call %genericTSvariablename% as you do in your example Quote Share this post Link to post Share on other sites More sharing options...
commissar117 Posted March 20, 2015 Report post Posted March 20, 2015 After OS installed Quote Share this post Link to post Share on other sites More sharing options...
BB24 Posted March 20, 2015 Report post Posted March 20, 2015 Ok. So how will you capture the username? Through an .hta? http://www.windows-noob.com/forums/index.php?/topic/3476-introducing-the-windows-noobcom-frontend-hta-ver-10/ Quote Share this post Link to post Share on other sites More sharing options...
commissar117 Posted March 27, 2015 Report post Posted March 27, 2015 No, I am not using HTAs. I was thinking maybe through the MDT Setting ini file. Quote Share this post Link to post Share on other sites More sharing options...
BB24 Posted March 27, 2015 Report post Posted March 27, 2015 Recommend looking at these if you are planning on using the customsettings.ini https://social.technet.microsoft.com/Forums/en-US/8fe17352-a20c-496c-83fd-cf9b9fdfa199/customsettingsini-bootstrapini-settings?forum=mdt https://anothermike2.wordpress.com/2012/04/21/back-to-basic-customsettings-ini-explained/ https://mdtguy.wordpress.com/2013/07/12/mdt-customsettings-ini-tips-tricks/ https://anothermike2.wordpress.com/2011/04/27/quick-and-dirty-testing-customsettings-ini-variables-in-mdt/ Quote Share this post Link to post Share on other sites More sharing options...