Jump to content


Damien

Established Members
  • Posts

    125
  • Joined

  • Last visited

Everything posted by Damien

  1. sorry this is the link to the guide http://www.deploymentresearch.com/Research/tabid/62/EntryId/74/ADSI-plugin-for-WinPE-4-0.aspx#AddComment
  2. I follow this guide to integrate ADSI tools to the WIN PE 4 x64 boot image. CreateBootImage_x64.cmd batch file ran successfully but when I run the "Connect_to_DC_Sample.vbs" file from the X drive I get the following error :Line: 3 Char: 1, error: invalid syntax code:800401e4 saurce:null. I am running a server 2012 domain, is there anything I need to do on the domain before I try this? please help.
  3. Can someone please help me with the following. I want to create a custom page for UDI wizard, where I can input the computer description, so it will update the description for the computer account in AD.. Many thanks.
  4. I have the below HTA, This HTA was used in a different domain and now I want to impliment that in my test lab. which collect information like PC name, computer description, OU...etc at the PXE stage. the issue is i am getting an error when the HTA loads up at the beging of the task sequence Line 71 Char:1 error: invalid syntax code:0 if I say continue I get another error Line :110 Char:5 error: Object required: objCommand code:0 if I click continue the HTA loads up but computer sites, floor within sites and laptop model fields won't populate. I have pasted the saurce. can someone please help me with this? < html> < head> < title>Workstation Deployment</title> < HTA:APPLICATION ID="objDEPLOYMENT" APPLICATIONNAME="DEPLOYMENT" SCROLL="no" SINGLEINSTANCE="yes" WINDOWSTATE="MAXIMIZED" MaximizeButton = "no" MinimizeButton = "no" CloseButton = "no" SysMenu = "no" > <style type="text/css"> .style2 { font-size: medium; font-weight: bold; } .style3 { height: 54px; } .style4 { } .style5 { height: 52px; } .style7 { } .style9 { width: 235px; } .style10 { } .style11 { width: 200px; } .style12 { width: 250px; } </style> < /head> < SCRIPT LANGUAGE="VBScript"> '**Start Encode** strDomainName = "DJ" strDomainMaster = strDomainName & "\administrator" strDomainMasterPwd = "password" strDomainController = "DJDC" strMainCompOU = "OU=" & strDomainName & " Computers,DC=" & strDomainName & ",DC=DJ,DC=LOCAL" strLapUtilOU = "OU=Laptop Utils,OU=Application Groups,OU=" & strDomainName & " Groups,DC=" & strDomainName & ",DC=DJ,DC=LOCAL" Const ADS_SCOPE_SUBTREE = 2 Const ADS_SECURE_AUTHENTICATION = 1 Const ADS_SERVER_BIND = 200 Set objShell = CreateObject("Wscript.Shell") objShell.regWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1\1406", 0, "REG_DWORD" objShell.regWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\1406", 0, "REG_DWORD" Set objDomain = GetObject("LDAP:").OpenDSObject("LDAP://" & strDomainController & "/DC=" & strDomainName & ",DC=DJ,DC=LOCAL" , strDomainMaster , strDomainMasterPwd ,ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND) Set objConnection = CreateObject("ADODB.Connection") Set objCommand = CreateObject("ADODB.Command") objConnection.Provider = "ADsDSOObject" objConnection.Properties("User ID") = strDomainMaster objConnection.Properties("Password") = strDomainMasterPwd objConnection.Properties("Encrypt Password") = TRUE objConnection.Properties("ADSI Flag") = ADS_SERVER_BIND Or ADS_SECURE_AUTHENTICATION objConnection.Open "Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties("Page Size") = 1000 objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE Sub CheckKeys If window.event.altKey And window.event.keyCode = 115 then Call alert("please do not close this window") document.parentwindow.event.keyCode = 0 document.parentwindow.event.cancelBubble = true document.parentwindow.event.returnvalue = false End If End Sub Sub Window_onload 'On Error Resume Next Dim objProgressUI Dim arrSitesName() Dim arrSitesDesc() Set objProgressUI = CreateObject("Microsoft.SMS.TsProgressUI") objProgressUI.CloseProgressDialog window.resizeTo 800,600 Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "Select a computer site" dropdownNode.Value = "" ctrlComputerSite.Add(dropdownNode) objCommand.CommandText = "SELECT name FROM 'LDAP://" & strDomainController & "/" & strMainCompOU & "' WHERE objectCategory='organizationalUnit'" Set objRecordSet = objCommand.Execute i = 0 If objRecordSet.EOF then Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "No sites have been found" ctrlComputerSite.Add(dropdownNode) Else objRecordSet.MoveFirst Do Until objRecordSet.EOF strOUName = objRecordSet.Fields("name").Value If Len(strOUName) > 3 then objRecordSet.MoveNext Else i = i + 1 objRecordSet.MoveNext End If Loop ReDim arrSitesName(i) ReDim arrSitesDesc(i) i = 0 objCommand.CommandText = "SELECT name, description FROM 'LDAP://" & strDomainController & "/" & strMainCompOU & "' WHERE objectCategory='organizationalUnit'" Set objRecordSet = objCommand.Execute objRecordSet.MoveFirst Do Until objRecordSet.EOF strOUName = objRecordSet.Fields("name").Value If Len(strOUName) > 3 then objRecordSet.MoveNext Else arrSitesName(i) = strOUName If IsNull(objRecordSet.Fields("description").Value) Then strDesc = "" Else For Each strDesc in objRecordSet.Fields("description").Value If strDesc = "" then Exit For Else arrSitesDesc(i) = strDesc End If Next End If i = i + 1 objRecordSet.MoveNext End If Loop End If d = 0 Do While d < i Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = arrSitesName(d) & " - " & arrSitesDesc(d) dropdownNode.Value = arrSitesName(d) ctrlComputerSite.Add(dropdownNode) d = d + 1 Loop End Sub Sub Update_ctrlSiteFloor On Error Resume Next For Each dropdownNode in ctrlSiteFloor.Options dropdownNode.RemoveNode Next strComputerSite = ctrlComputerSite.value If strComputerSite = "" Then Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "Loading....." dropdownNode.Value = "" ctrlSiteFloor.Add(dropdownNode) intErrResult = MsgBox("You have not selected a computer site. Please select a computer site before proceeding",48,"Computer Site not Defined") Exit Sub End If strSiteOU = "LDAP://" & strDomainController & "/OU=" & strComputerSite & "," & strMainCompOU i = 0 Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "Select a Site Floor" dropdownNode.Value = "" ctrlSiteFloor.Add(dropdownNode) objCommand.CommandText = "SELECT name FROM '" & strSiteOU & "' WHERE objectCategory='organizationalUnit'" Set objRecordSet = objCommand.Execute If objRecordSet.EOF then Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "No sites have been found" ctrlComputerSite.Add(dropdownNode) Else objRecordSet.MoveFirst i = 0 Do Until objRecordSet.EOF strOUName = objRecordSet.Fields("name").Value If InStr("Desktop", strOUName) <> 0 or InStr("Laptop", strOUName) <> 0 or strOUName = strComputerSite then objRecordSet.MoveNext Else Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = strOUName dropdownNode.Value = strOUName ctrlSiteFloor.Add(dropdownNode) i = 1 objRecordSet.MoveNext End If Loop If i <> 1 then For Each dropdownNode in ctrlSiteFloor.Options dropdownNode.RemoveNode Next Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "Site has no floors" dropdownNode.Value = "N/A" ctrlSiteFloor.Add(dropdownNode) End If End If End Sub Sub Update_LaptopModel On Error Resume Next For Each dropdownNode in ctrlLaptopMod.Options dropdownNode.RemoveNode Next strComputerType = ctrlComputerType.value If strComputerType = "" then Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "Loading....." dropdownNode.Value = "" ctrlLaptopMod.Add(dropdownNode) intErrResult = MsgBox("You have not selected a computer type. Please select a computer type before proceeding",48,"Computer Type not Defined") Exit Sub End If If strComputerType = "Desktop" then Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "Desktop has been selected" dropdownNode.Value = "NA" ctrlLaptopMod.Add(dropdownNode) Else objCommand.CommandText = "SELECT Name FROM 'LDAP://" & strDomainController & "/" & strLapUtilOU & "' WHERE objectCategory='group'" Set objRecordSet = objCommand.Execute If objRecordSet.EOF Then Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "No Laptop Models have been identified" ctrlLaptopMod.Add(dropdownNode) Else objRecordSet.MoveFirst Do Until objRecordSet.EOF strGroupName = objRecordSet.Fields("Name").Value strGroupDesc = Mid(strGroupName, 5) intTempLen = Len(strGroupDesc) strGroupDesc = Left(strGroupDesc, intTempLen - 13) Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = strGroupDesc dropdownNode.Value = strGroupName ctrlLaptopMod.Add(dropdownNode) objRecordSet.MoveNext Loop End If End If End Sub Sub RunScript On Error Resume Next Set objTS = CreateObject("Microsoft.SMS.TSEnvironment") Set objFSO = CreateObject("Scripting.FileSystemObject") strComputerType = ctrlComputerType.value strComputerName = ctrlComputerName.value strComputerSite = ctrlComputerSite.value strSiteFloor = ctrlSiteFloor.value strDomainAccount = strDomainName & "\" & ctrlAccountUserName.value strDomainPassword = ctrlAccountPassword.value Set objDomain = GetObject("LDAP:").OpenDSObject("LDAP://" & strDomainController & "/DC=" & strDomainName & ",DC=WA,DC=GOV,DC=AU" , strDomainAccount , strDomainPassword ,ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND) Set objConnection = CreateObject("ADODB.Connection") Set objCommand = CreateObject("ADODB.Command") objConnection.Provider = "ADsDSOObject" objConnection.Properties("User ID") = strDomainAccount objConnection.Properties("Password") = strDomainPassword objConnection.Properties("Encrypt Password") = TRUE objConnection.Properties("ADSI Flag") = ADS_SERVER_BIND Or ADS_SECURE_AUTHENTICATION objConnection.Open "Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties("Page Size") = 1000 objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE If err.number <> 0 then intErrResult = MsgBox("You have supplied an invalid Username or Password. Please check your Username & Password and try again.",16,"Supplied credentials invalid") Exit Sub End If If strSiteFloor = "N/A" Then strDomainOU = "LDAP://OU=" & strComputerType & ",OU=" & strComputerSite & ",OU=" & strDomainName & " COMPUTERS,DC=" & strDomainName & ",DC=DJ,DC=LOCAL" Else strDomainOU = "LDAP://OU=" & strComputerType & ",OU=" & strSiteFloor & ",OU=" & strComputerSite & ",OU=" & strDomainName & " COMPUTERS,DC=" & strDomainName & ",DC=WA,DC=GOV,DC=AU" End If strLaptopMod = ctrlLaptopMod.value strComputerDesc = ctrlComputerDesc.value strServiceDeskJob = ctrlServiceDeskJob.value strFQDN = strDomainName & ".wa.gov.au" strPreviousCompName = ctrlPreviousComputerName.value i = 1 Do While i < 8 Select Case i Case 1 If strComputerName = "" Then intErrResult = MsgBox("You have not entered a computer name. Please enter a computer name before proceeding",48,"Computer name not Defined") Exit Sub Else 'If strComputerType = "Desktop" then ' If InStr(strComputerName, "PCD") = 0 Or InStr(strComputerName, "SV") = 0 then ' intErrResult = MsgBox("You have not entered a valid computer name. Please enter a valid computer name before proceeding",48,"Computer name not valid") ' Exit Sub ' End If 'End If End If i = i + 1 Case 2 If strComputerType = "" Then intErrResult = MsgBox("You have not selected a computer type. Please select a computer type before proceeding",48,"Computer Type not Defined") Exit Sub End If i = i + 1 Case 3 If strComputerSite = "" Then intErrResult = MsgBox("You have not selected a computer site. Please select a computer site before proceeding",48,"Computer Site not Defined") Exit Sub End If i = i + 1 Case 4 If strDomainName = "" Then intErrResult = MsgBox("You have not selected a PTA Domain. Please select a PTA Domain before proceeding",48,"Domain not Defined") Exit Sub End If i = i + 1 Case 5 If strDomainAccount = strDomainName & "\" Then intErrResult = MsgBox("You have not entered your username. Please enter your username before proceeding",48,"Username not Defined") Exit Sub End If i = i + 1 Case 6 If strDomainPassword = "" Then intErrResult = MsgBox("You have not entered your password. Please enter your password before proceeding",48,"Password not Defined") Exit Sub End If i = i + 1 Case 7 If strComputerDesc = "" Then intErrResult = MsgBox("You have not entered a computer description. Please enter a computer description before proceeding",48,"Computer Description not Defined") Exit Sub End If i = i + 1 End Select Loop objTS("OSDDomainName") = strFQDN objTS("OSDDomainOUName") = strDomainOU objTS("OSDJoinAccount") = strDomainAccount objTS("OSDJoinPassword") = strDomainPassword objTS("OSDNetworkJoinType") = "0" objTS("OSDJoinSkipReboot") = "false" objTS("OSDComputerName") = strComputerName Set objTxtWrite = objFSO.CreateTextFile("Y:\temp\" & strComputerName & ".txt") objTxtWrite.WriteLine(strDomainOU) objTxtWrite.WriteLine(strLaptopMod) objTxtWrite.WriteLine(strDomainAccount) objTxtWrite.WriteLine(strComputerDesc) objTxtWrite.WriteLine(strServiceDeskJob) objTxtWrite.WriteLine(strPreviousCompName) objTxtWrite.WriteLine(strSiteFloor) objTxtWrite.Close window.close End Sub < /SCRIPT> < body onkeydown="CheckKeys()"> <font face="Tahoma"><center> <table width=100%> <tr bgcolor="#2C7993" height=50> <td> <font color="#FFFFFF" face="Tahoma"><center class="style2"> Public Transport Authority System Centre Configuration Manager 2007 Image Deployment (CMR)</center></font> </td> </tr> <tr height=50> <td> Please enter the details for this new computer</td> </tr> </table> <table width=100%> <tr> <td class="style9"> Computer Name: </td> <td class="style12"> <input type="text" id="ctrlComputerName" name="ctrlComputerName" size="30" title="Enter the computer name. Example: PC100001"> </td> <td class="style11"> Service<font face="Tahoma"> Desk Job #:</font></td> <td> <font face="Tahoma"> <input id="ctrlServiceDeskJob" name="ctrlServiceDeskJob" type="text" size="30"/></font></td> </tr> <tr> <td class="style9"> <font face="Tahoma">Previous PC Name:</font></td> <td class="style12"> <font face="Tahoma"> <input id="ctrlPreviousComputerName" name="ctrlPreviousComputerName" size="30" type="text" value="N/A" /></font></tr> <td class="style10"> </tr> <td class="style10"> </tr> <tr> <td class="style9"> <font face="Tahoma">Computer Site:</font></td> <td class="style12"> <font face="Tahoma"> <select id="ctrlComputerSite" name="ctrlComputerSite" onchange="Update_ctrlSiteFloor"> </select></font></tr> <td> <font face="Tahoma">Computer Type:</font></tr> <td> <font face="Tahoma"> <select id="ctrlComputerType" name="ctrlComputerType" onchange="Update_LaptopModel"> <option selected>Select a computer type</option> <option value="Desktop">Desktop</option> <option value="Laptop">Laptop</option> </select></font></tr> <tr> <td class="style9"> <font face="Tahoma">Floor within Site:</font></td> <td class="style12"> <font face="Tahoma"> <select id="ctrlSiteFloor" name="ctrlSiteFloor" title="Only to be used for PTC, CIT and CLA Sites"> <option>Loading.....</option> </select></font></td> <td> <font face="Tahoma">Laptop Model:</font></td> <td> <font face="Tahoma"> <select id="ctrlLaptopMod" name="ctrlLaptopMod" title="Only to be used if machine is a laptop"> <option>Loading.....</option> </select></font></td> </tr> <tr> <td class="style4" colspan="4"> <hr /> </td> </tr> <tr> <td class="style5" colspan="4"> Please enter a description of this computer:</td> </tr> <tr> <td class="style9"> Computer Description:</td> <td colspan="3"> <input id="ctrlComputerDesc" name="ctrlComputerDesc" type="text" size="60" /></td> </tr> <tr> <td class="style7" colspan="4"> <font face="Tahoma"> <hr /> </font> </td> </tr> <tr> <td class="style3" colspan="4"> Please enter your admin account details to join this machine to the domain.</td> </tr> <tr> <td class="style9"> User Name: </td> <td colspan="3"> <input id="ctrlAccountUserName" name="ctrlAccountUserName" type="text" size="30" title="Enter your User Name. Example: wex103761a"/></td> </tr> <tr> <td class="style9"> Password:</td> <td colspan="3"> <input id="ctrlAccountPassword" name="ctrlAccountpassword" type="password" size="30" title="Enter your Password."/></td> </tr> </table> <table width=100%> <tr> <td height=80> <font face="Tahoma"> <center><input id=runbutton class="button" type="button" value="OK" name="run_button" onclick="RunScript"></center> </font> </td> </tr> </table> </center></font> < /body>
  5. Hi AnyWeb, I have the below HTA, This HTA was used in a different domain and now I want to impliment that in my test lab. which collect information like PC name, computer description, OU...etc at the PXE stage. the issue is i am getting an error when the HTA loads up at the beging of the task sequence Line 71 Char:1 error: invalid syntax code:0 if I say continue I get another error Line :110 Char:5 error: Object required: objCommand code:0 if I click continue the HTA loads up but computer sites, floor within sites and laptop model fields won't populate. I have pasted the saurce. can someone please help me with this? <html> <head> <title>Workstation Deployment</title> <HTA:APPLICATION ID="objDEPLOYMENT" APPLICATIONNAME="DEPLOYMENT" SCROLL="no" SINGLEINSTANCE="yes" WINDOWSTATE="MAXIMIZED" MaximizeButton = "no" MinimizeButton = "no" CloseButton = "no" SysMenu = "no" > <style type="text/css"> .style2 { font-size: medium; font-weight: bold; } .style3 { height: 54px; } .style4 { } .style5 { height: 52px; } .style7 { } .style9 { width: 235px; } .style10 { } .style11 { width: 200px; } .style12 { width: 250px; } </style> </head> <SCRIPT LANGUAGE="VBScript"> '**Start Encode** strDomainName = "DJ" strDomainMaster = strDomainName & "\administrator" strDomainMasterPwd = "password" strDomainController = "DJDC" strMainCompOU = "OU=" & strDomainName & " Computers,DC=" & strDomainName & ",DC=DJ,DC=LOCAL" strLapUtilOU = "OU=Laptop Utils,OU=Application Groups,OU=" & strDomainName & " Groups,DC=" & strDomainName & ",DC=DJ,DC=LOCAL" Const ADS_SCOPE_SUBTREE = 2 Const ADS_SECURE_AUTHENTICATION = 1 Const ADS_SERVER_BIND = 200 Set objShell = CreateObject("Wscript.Shell") objShell.regWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1\1406", 0, "REG_DWORD" objShell.regWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\1406", 0, "REG_DWORD" Set objDomain = GetObject("LDAP:").OpenDSObject("LDAP://" & strDomainController & "/DC=" & strDomainName & ",DC=DJ,DC=LOCAL" , strDomainMaster , strDomainMasterPwd ,ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND) Set objConnection = CreateObject("ADODB.Connection") Set objCommand = CreateObject("ADODB.Command") objConnection.Provider = "ADsDSOObject" objConnection.Properties("User ID") = strDomainMaster objConnection.Properties("Password") = strDomainMasterPwd objConnection.Properties("Encrypt Password") = TRUE objConnection.Properties("ADSI Flag") = ADS_SERVER_BIND Or ADS_SECURE_AUTHENTICATION objConnection.Open "Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties("Page Size") = 1000 objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE Sub CheckKeys If window.event.altKey And window.event.keyCode = 115 then Call alert("please do not close this window") document.parentwindow.event.keyCode = 0 document.parentwindow.event.cancelBubble = true document.parentwindow.event.returnvalue = false End If End Sub Sub Window_onload 'On Error Resume Next Dim objProgressUI Dim arrSitesName() Dim arrSitesDesc() Set objProgressUI = CreateObject("Microsoft.SMS.TsProgressUI") objProgressUI.CloseProgressDialog window.resizeTo 800,600 Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "Select a computer site" dropdownNode.Value = "" ctrlComputerSite.Add(dropdownNode) objCommand.CommandText = "SELECT name FROM 'LDAP://" & strDomainController & "/" & strMainCompOU & "' WHERE objectCategory='organizationalUnit'" Set objRecordSet = objCommand.Execute i = 0 If objRecordSet.EOF then Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "No sites have been found" ctrlComputerSite.Add(dropdownNode) Else objRecordSet.MoveFirst Do Until objRecordSet.EOF strOUName = objRecordSet.Fields("name").Value If Len(strOUName) > 3 then objRecordSet.MoveNext Else i = i + 1 objRecordSet.MoveNext End If Loop ReDim arrSitesName(i) ReDim arrSitesDesc(i) i = 0 objCommand.CommandText = "SELECT name, description FROM 'LDAP://" & strDomainController & "/" & strMainCompOU & "' WHERE objectCategory='organizationalUnit'" Set objRecordSet = objCommand.Execute objRecordSet.MoveFirst Do Until objRecordSet.EOF strOUName = objRecordSet.Fields("name").Value If Len(strOUName) > 3 then objRecordSet.MoveNext Else arrSitesName(i) = strOUName If IsNull(objRecordSet.Fields("description").Value) Then strDesc = "" Else For Each strDesc in objRecordSet.Fields("description").Value If strDesc = "" then Exit For Else arrSitesDesc(i) = strDesc End If Next End If i = i + 1 objRecordSet.MoveNext End If Loop End If d = 0 Do While d < i Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = arrSitesName(d) & " - " & arrSitesDesc(d) dropdownNode.Value = arrSitesName(d) ctrlComputerSite.Add(dropdownNode) d = d + 1 Loop End Sub Sub Update_ctrlSiteFloor On Error Resume Next For Each dropdownNode in ctrlSiteFloor.Options dropdownNode.RemoveNode Next strComputerSite = ctrlComputerSite.value If strComputerSite = "" Then Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "Loading....." dropdownNode.Value = "" ctrlSiteFloor.Add(dropdownNode) intErrResult = MsgBox("You have not selected a computer site. Please select a computer site before proceeding",48,"Computer Site not Defined") Exit Sub End If strSiteOU = "LDAP://" & strDomainController & "/OU=" & strComputerSite & "," & strMainCompOU i = 0 Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "Select a Site Floor" dropdownNode.Value = "" ctrlSiteFloor.Add(dropdownNode) objCommand.CommandText = "SELECT name FROM '" & strSiteOU & "' WHERE objectCategory='organizationalUnit'" Set objRecordSet = objCommand.Execute If objRecordSet.EOF then Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "No sites have been found" ctrlComputerSite.Add(dropdownNode) Else objRecordSet.MoveFirst i = 0 Do Until objRecordSet.EOF strOUName = objRecordSet.Fields("name").Value If InStr("Desktop", strOUName) <> 0 or InStr("Laptop", strOUName) <> 0 or strOUName = strComputerSite then objRecordSet.MoveNext Else Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = strOUName dropdownNode.Value = strOUName ctrlSiteFloor.Add(dropdownNode) i = 1 objRecordSet.MoveNext End If Loop If i <> 1 then For Each dropdownNode in ctrlSiteFloor.Options dropdownNode.RemoveNode Next Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "Site has no floors" dropdownNode.Value = "N/A" ctrlSiteFloor.Add(dropdownNode) End If End If End Sub Sub Update_LaptopModel On Error Resume Next For Each dropdownNode in ctrlLaptopMod.Options dropdownNode.RemoveNode Next strComputerType = ctrlComputerType.value If strComputerType = "" then Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "Loading....." dropdownNode.Value = "" ctrlLaptopMod.Add(dropdownNode) intErrResult = MsgBox("You have not selected a computer type. Please select a computer type before proceeding",48,"Computer Type not Defined") Exit Sub End If If strComputerType = "Desktop" then Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "Desktop has been selected" dropdownNode.Value = "NA" ctrlLaptopMod.Add(dropdownNode) Else objCommand.CommandText = "SELECT Name FROM 'LDAP://" & strDomainController & "/" & strLapUtilOU & "' WHERE objectCategory='group'" Set objRecordSet = objCommand.Execute If objRecordSet.EOF Then Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = "No Laptop Models have been identified" ctrlLaptopMod.Add(dropdownNode) Else objRecordSet.MoveFirst Do Until objRecordSet.EOF strGroupName = objRecordSet.Fields("Name").Value strGroupDesc = Mid(strGroupName, 5) intTempLen = Len(strGroupDesc) strGroupDesc = Left(strGroupDesc, intTempLen - 13) Set dropdownNode = document.createElement("OPTION") dropdownNode.Text = strGroupDesc dropdownNode.Value = strGroupName ctrlLaptopMod.Add(dropdownNode) objRecordSet.MoveNext Loop End If End If End Sub Sub RunScript On Error Resume Next Set objTS = CreateObject("Microsoft.SMS.TSEnvironment") Set objFSO = CreateObject("Scripting.FileSystemObject") strComputerType = ctrlComputerType.value strComputerName = ctrlComputerName.value strComputerSite = ctrlComputerSite.value strSiteFloor = ctrlSiteFloor.value strDomainAccount = strDomainName & "\" & ctrlAccountUserName.value strDomainPassword = ctrlAccountPassword.value Set objDomain = GetObject("LDAP:").OpenDSObject("LDAP://" & strDomainController & "/DC=" & strDomainName & ",DC=WA,DC=GOV,DC=AU" , strDomainAccount , strDomainPassword ,ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND) Set objConnection = CreateObject("ADODB.Connection") Set objCommand = CreateObject("ADODB.Command") objConnection.Provider = "ADsDSOObject" objConnection.Properties("User ID") = strDomainAccount objConnection.Properties("Password") = strDomainPassword objConnection.Properties("Encrypt Password") = TRUE objConnection.Properties("ADSI Flag") = ADS_SERVER_BIND Or ADS_SECURE_AUTHENTICATION objConnection.Open "Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties("Page Size") = 1000 objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE If err.number <> 0 then intErrResult = MsgBox("You have supplied an invalid Username or Password. Please check your Username & Password and try again.",16,"Supplied credentials invalid") Exit Sub End If If strSiteFloor = "N/A" Then strDomainOU = "LDAP://OU=" & strComputerType & ",OU=" & strComputerSite & ",OU=" & strDomainName & " COMPUTERS,DC=" & strDomainName & ",DC=DJ,DC=LOCAL" Else strDomainOU = "LDAP://OU=" & strComputerType & ",OU=" & strSiteFloor & ",OU=" & strComputerSite & ",OU=" & strDomainName & " COMPUTERS,DC=" & strDomainName & ",DC=WA,DC=GOV,DC=AU" End If strLaptopMod = ctrlLaptopMod.value strComputerDesc = ctrlComputerDesc.value strServiceDeskJob = ctrlServiceDeskJob.value strFQDN = strDomainName & ".wa.gov.au" strPreviousCompName = ctrlPreviousComputerName.value i = 1 Do While i < 8 Select Case i Case 1 If strComputerName = "" Then intErrResult = MsgBox("You have not entered a computer name. Please enter a computer name before proceeding",48,"Computer name not Defined") Exit Sub Else 'If strComputerType = "Desktop" then ' If InStr(strComputerName, "PCD") = 0 Or InStr(strComputerName, "SV") = 0 then ' intErrResult = MsgBox("You have not entered a valid computer name. Please enter a valid computer name before proceeding",48,"Computer name not valid") ' Exit Sub ' End If 'End If End If i = i + 1 Case 2 If strComputerType = "" Then intErrResult = MsgBox("You have not selected a computer type. Please select a computer type before proceeding",48,"Computer Type not Defined") Exit Sub End If i = i + 1 Case 3 If strComputerSite = "" Then intErrResult = MsgBox("You have not selected a computer site. Please select a computer site before proceeding",48,"Computer Site not Defined") Exit Sub End If i = i + 1 Case 4 If strDomainName = "" Then intErrResult = MsgBox("You have not selected a PTA Domain. Please select a PTA Domain before proceeding",48,"Domain not Defined") Exit Sub End If i = i + 1 Case 5 If strDomainAccount = strDomainName & "\" Then intErrResult = MsgBox("You have not entered your username. Please enter your username before proceeding",48,"Username not Defined") Exit Sub End If i = i + 1 Case 6 If strDomainPassword = "" Then intErrResult = MsgBox("You have not entered your password. Please enter your password before proceeding",48,"Password not Defined") Exit Sub End If i = i + 1 Case 7 If strComputerDesc = "" Then intErrResult = MsgBox("You have not entered a computer description. Please enter a computer description before proceeding",48,"Computer Description not Defined") Exit Sub End If i = i + 1 End Select Loop objTS("OSDDomainName") = strFQDN objTS("OSDDomainOUName") = strDomainOU objTS("OSDJoinAccount") = strDomainAccount objTS("OSDJoinPassword") = strDomainPassword objTS("OSDNetworkJoinType") = "0" objTS("OSDJoinSkipReboot") = "false" objTS("OSDComputerName") = strComputerName Set objTxtWrite = objFSO.CreateTextFile("Y:\temp\" & strComputerName & ".txt") objTxtWrite.WriteLine(strDomainOU) objTxtWrite.WriteLine(strLaptopMod) objTxtWrite.WriteLine(strDomainAccount) objTxtWrite.WriteLine(strComputerDesc) objTxtWrite.WriteLine(strServiceDeskJob) objTxtWrite.WriteLine(strPreviousCompName) objTxtWrite.WriteLine(strSiteFloor) objTxtWrite.Close window.close End Sub </SCRIPT> <body onkeydown="CheckKeys()"> <font face="Tahoma"><center> <table width=100%> <tr bgcolor="#2C7993" height=50> <td> <font color="#FFFFFF" face="Tahoma"><center class="style2"> Public Transport Authority System Centre Configuration Manager 2007 Image Deployment (CMR)</center></font> </td> </tr> <tr height=50> <td> Please enter the details for this new computer</td> </tr> </table> <table width=100%> <tr> <td class="style9"> Computer Name: </td> <td class="style12"> <input type="text" id="ctrlComputerName" name="ctrlComputerName" size="30" title="Enter the computer name. Example: PC100001"> </td> <td class="style11"> Service<font face="Tahoma"> Desk Job #:</font></td> <td> <font face="Tahoma"> <input id="ctrlServiceDeskJob" name="ctrlServiceDeskJob" type="text" size="30"/></font></td> </tr> <tr> <td class="style9"> <font face="Tahoma">Previous PC Name:</font></td> <td class="style12"> <font face="Tahoma"> <input id="ctrlPreviousComputerName" name="ctrlPreviousComputerName" size="30" type="text" value="N/A" /></font></tr> <td class="style10"> </tr> <td class="style10"> </tr> <tr> <td class="style9"> <font face="Tahoma">Computer Site:</font></td> <td class="style12"> <font face="Tahoma"> <select id="ctrlComputerSite" name="ctrlComputerSite" onchange="Update_ctrlSiteFloor"> </select></font></tr> <td> <font face="Tahoma">Computer Type:</font></tr> <td> <font face="Tahoma"> <select id="ctrlComputerType" name="ctrlComputerType" onchange="Update_LaptopModel"> <option selected>Select a computer type</option> <option value="Desktop">Desktop</option> <option value="Laptop">Laptop</option> </select></font></tr> <tr> <td class="style9"> <font face="Tahoma">Floor within Site:</font></td> <td class="style12"> <font face="Tahoma"> <select id="ctrlSiteFloor" name="ctrlSiteFloor" title="Only to be used for PTC, CIT and CLA Sites"> <option>Loading.....</option> </select></font></td> <td> <font face="Tahoma">Laptop Model:</font></td> <td> <font face="Tahoma"> <select id="ctrlLaptopMod" name="ctrlLaptopMod" title="Only to be used if machine is a laptop"> <option>Loading.....</option> </select></font></td> </tr> <tr> <td class="style4" colspan="4"> <hr /> </td> </tr> <tr> <td class="style5" colspan="4"> Please enter a description of this computer:</td> </tr> <tr> <td class="style9"> Computer Description:</td> <td colspan="3"> <input id="ctrlComputerDesc" name="ctrlComputerDesc" type="text" size="60" /></td> </tr> <tr> <td class="style7" colspan="4"> <font face="Tahoma"> <hr /> </font> </td> </tr> <tr> <td class="style3" colspan="4"> Please enter your admin account details to join this machine to the domain.</td> </tr> <tr> <td class="style9"> User Name: </td> <td colspan="3"> <input id="ctrlAccountUserName" name="ctrlAccountUserName" type="text" size="30" title="Enter your User Name. Example: wex103761a"/></td> </tr> <tr> <td class="style9"> Password:</td> <td colspan="3"> <input id="ctrlAccountPassword" name="ctrlAccountpassword" type="password" size="30" title="Enter your Password."/></td> </tr> </table> <table width=100%> <tr> <td height=80> <font face="Tahoma"> <center><input id=runbutton class="button" type="button" value="OK" name="run_button" onclick="RunScript"></center> </font> </td> </tr> </table> </center></font> </body>
  6. Do you have a SCCM 2012 supported task sequence for this? Thanks.
  7. Thanks for the advice, one more question, if I set configure the SCCM server on a Vlan and move it to another VLAN and change the IP of the server is that going to cause any problems?
  8. Hi Guys Currently we have sccm 2007 in production and we are thinking of setting up SCCM 2012 from the scratch. My question is PXE. How can I point production clients to SCCM 2007 and test clients to sccm 2012 during the testing period, when the both servers are on the same domain? Thanks for your help.
  9. Hi All, Can someone please help me with this the queries for these 2 collections? Assume, AD OU is "Software Install" Create a collection A who's membership rule is based on All computers in the OU, “Software Install"" Create a collection B who's membership rule is based on "All computers not in the OU "Software Install", but have software installed" Then, when computer join OU "Software Install", the software will be installed. And when the computer is removed from the OU "Software Install" it's status is "Not in the OU "Software Install", but have the software installed", thus this computer will be added to collection B and receive the software uninstall package to uninstall the software.
  10. in ZTI, say if you were to re-image an existing PC, how would you get the task sequence to assign the same PC name that it had there before ? (the name that's already in the AD,eg:PCD.....)
  11. Hi All, Is it possible to have LTI and ZTI both options on the same SCCM 2007 R3 Server? Thanks.
  12. Any place I could find more information about this? Thanks.
  13. Can anyone point me to the right direction, of how to initiate a Remote OSD? Basically management want to be able to initiate OSD on PCs after hours, so they’ll become ready the next morning. Thanks in advance.
  14. Is there a way to choose which server to PXE boot?
  15. Ok, here is the deal. We are using SCCM 2007 at the moment and the way Service desk deploy applications via AD groups. each application has 1 main collection and 3 sub collections as shown in the attachment: each collection has it own query by adding an app to the corresponding AD group populate the main collection and then get moved to the "install" collection, where it has the advert to install after the installation the PC get moved to the "installed" collection and will stay till you ununstall it. uninstallation is done by removing the pc from the ad group, which will remove the pc from the main collection and the pc will automatically moved to "uninstall" collection, where it has the advert to uninstall the app. how can I configure a similar setup with SCCM 2012, so the Service desk doesn't have to use the sccm console? Thanks.
  16. Hi Guys, Anyone know the answer to this? "We are creating user collections with the AD security group for the application and deploying the App-V application to this collection. However, the big question right now is how to remove App-V applications (delete shortcuts, etc) once the user is no longer a member of the AD security group that that application was deployed to. It appears that in SCCM 2007 you were able to remove the App-V application when it was no longer advertised (ie when the user was no longer a member of the AD group) but that doesn't seem possible in SCCM 2012." Thanks.
  17. Hi Peter, I am not sure what you mean, can you please explain that a bit more? Thanks.
  18. The SCCM 2007 is in production so I can't change that. what I want is, to boot test PCs with SCCM 2012 while SCCM 2007 is used for production.
  19. yes, deleted from 2007. and add that to SCCM 2012.
×
×
  • 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.