RaymondA Posted August 7, 2013 Report post Posted August 7, 2013 Hi, I am investigating/considering to make an setup-screen in the OSD deployment. I am using VS.net C#. However, I am having major problems. The idea I have is to give the user the option to change the installation values, if he clicks inside the app (10 seconds delay). The application should displays: Computername, Bitlocker, default regional settings, program packages, etc. If he wants to change the computername, the program will help the user to make a name that’s unique and within Company Policy. However, I need to evaluate the existing %OSDComputerName% variable. I want to check if it is a SCCM generated name (“MININT-*“), if so the application should always stop and make the user create a computer name. This section of the code is as follows: TSEnvClass TSENVVAR = new TSEnvClass(); string sComputerName = ""; try { compName = TSENVVAR["OSDComputerName"]; this.textBoxComputername.Text = sComputerName; Log("OSDComputerName = " + sComputerName); } catch (Exception exc) { Logg(string.Format("ERROR OSDComputerName: {0}", exc)); } I also reads other settings, set by the Task Sequence prior to this step. My problem is as follows: I can read all variables, but the "default variables" are empty (zero length string). I obviously am missing out on something. When, in the task sequence, is the default variables set and ready to use? Or, am I doing something fundamentally wrong? Second question... Is there some exception handling I should know about? Quote Share this post Link to post Share on other sites More sharing options...
0 Peter van der Woude Posted August 19, 2013 Report post Posted August 19, 2013 It is correct that OSDComputerName is empty when it is not used. The name is actually stored in the read-only variable _SMSTSMachineName and that value will be overwritten with the value of OSDComputerName (when used). See also: http://technet.microsoft.com/en-us/library/bb632442.aspx Quote Share this post Link to post Share on other sites More sharing options...
Hi,
I am investigating/considering to make an setup-screen in the OSD deployment.
I am using VS.net C#.
However, I am having major problems.
The idea I have is to give the user the option to change the installation values, if he clicks inside the app (10 seconds delay).
The application should displays:
Computername, Bitlocker, default regional settings, program packages, etc.
If he wants to change the computername, the program will help the user to make a name that’s unique and within Company Policy.
However, I need to evaluate the existing %OSDComputerName% variable.
I want to check if it is a SCCM generated name (“MININT-*“), if so the application should always stop and make the user create a computer name.
This section of the code is as follows:
I also reads other settings, set by the Task Sequence prior to this step.
My problem is as follows:
I can read all variables, but the "default variables" are empty (zero length string).
I obviously am missing out on something. When, in the task sequence, is the default variables set and ready to use?
Or, am I doing something fundamentally wrong?
Second question... Is there some exception handling I should know about?
Share this post
Link to post
Share on other sites