Jump to content


  • 0
kkonovalov

Trying to add OU selection to the CM2012 Bitlocker FrontEnd HTA

Question

I have been trying to add an OU selection during my deployement in my HTA and JS files, But I cant seem to get the variable MachineObjectOU to get passed along. It keeps placing everything in the Computers OU... The code in question is below:

How do I write the correct javascript to pass the value?? I have MacineObejectOU = document.getElementById('MachineObjectOU').checked

That does not work though, anyone have suggestions?

<p><Select id=JoinDomain name=JoinDomain language=vbscript onchange="myfunction()" onpropertychange=ValidateDomainMembership accesskey=a>
      <option>Select Domain</option>
      <option value="Administrative">Administrative</option>
      <option value="Developement">Developement</option>
      <option value="External">External</option>
      <option value="IT">IT</option>
	  <option value="Restricted">Restricted</option>
	  <option value="Sales">Sales</option>
	  <option value="Service Computers">Service Computers</option>
			<label class=ErrMsg for=JoinDomain>* Required</label> 
			</p>
		</td>
	</tr>
<script type="text/javascript">

 function myFunction()
{

alert(JoinDomain.value);

	switch(JoinDomain.value)
	{
		case "Administrative":
			MachineObjectOU.value="OU=Administrative,OU=Workstations,DC=online,DC=com";
			break;
		case "Developement":
			MachineObjectOU.value="OU=Developement,OU=Workstations,DC=online,DC=com";
			break;
		case "External":
			MachineObjectOU.value="OU=External,OU=Workstations,DC=online,DC=com";
			break;
		case "IT":
			MachineObjectOU.value="OU=IT,OU=Workstations,DC=online,DC=com";
			break;
		case "Restricted":
			MachineObjectOU.value="OU=Restricted,OU=Workstations,DC=online,DC=com";
			break;
		case "Sales":
			MachineObjectOU.value="OU=Sales,OU=Workstations,DC=online,DC=com";
			break;
		case "Service Computers":
			MachineObjectOU.value="OU=Service Computers,OU=Workstations,DC=online,DC=com";
			break;	
	}
}


</script>
	<tr>
		<td colspan=2></td>
		<td>
		</td>
		<td id=PopupParent>
			<input type=text id=MachineObjectOU name=MachineObjectOU size=60 language=vbscript onpropertychange=ValidateDomainMembership accesskey=O>
			<input type="button" id=MachineObjectOUOptionalBtn hidefocus="1" value="▼" style="height:23; width:16; font-family: helvetica; font-size: 7pt; display: none;" onclick="JavaScript:HideUnHideComboBox();">
			
			<div id="PopupBox" style="position:absolute; display:none; z-index:10000; width: 240px; left: 250px;" >
			
				<select size="6" id="MachineObjectOUOptional" style="width: 100%; border-style: none"
				 onchange="JavaScript:MachineObjectOU.value = this.value;"
				 onclick="javascript:HideUnHideComboBox();">
				</select>

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
Set TSEnv = CreateObject("Microsoft.SMS.TSEnvironment")

ouname = JoinDomain.options(JoinDomain.selectedIndex).value
domainouname = "LDAP://" & ouname
TSEnv("OSDDomainOUName") = domainouname

Just create a new sub/function which will be executed on script exit. There is also no need for Switch in your script. Just add the OUs directly to the values of the drop down select.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.