Consolidating TS for multiple sites/domains using HTA frontend.
I want to consolidate my current task sequences into one master TS that will work on all sites and was hoping someone has tried this and will be able to give me some insight.
My SCCM infrastructure looks something like this. I have 4 domains (lets call them AA, B, C, D), AA is the root domain in the forest with 3 child domains and 4 SCCM sites 1 parent site and 3 child sites (1P, 2, 3, 4).
Domain AA contain no SCCM site.
Domain B contains the parent site (1P) and a child site (2)
Domain C contains child site (3)
Domain D contains child site (4)
I have got the TS consolidate to one were I use TS variables to query the default gateway they are in then apply the different windows settings needed. That's all good. To keep the helpdesk out of SCCM I use a boot image that loads in winPE and launches
the unknown computer HTA (albeit heavily modified) and adds the computer to a collection.
Now my problem is I have to generate a separate a boot image and HTA for each site. I was hoping that I could stick to master to save me updating each one when a change is made to the script.
I created a new HTA that adds the computer to a build collection on the parent site that works fine. I can add computers to this collection from any domain. I then have a the TS and advertisement on the parent site also. In domain C I load up the boot image,
add the computer to the collection (I can see it's there) then close the HTA and I get "Failed to run TS" "There is no TS available for this computer".
My first question is; is it possible to call a TS on a different domain? If not is there another way to do this?
December 14th, 2011 12:35pm
Nevermind, I've changed my HTA and added a function to look for the gateway address then assign the site settings and collection ID's based on the result. This way I have managed to consolidate 3 HTA's in 1 and 1 TS. Granted I have to create an advertisement
for each site but I can live that.
If it helps anyone the function I used to look for the default gateway address is:-
Function GetDefaultGateway
' Connect to the root\cimv2 namespace and execute a WMI query.
Dim cimv2Namespace, enabledNICs
Set cimv2Namespace = GetObject ("winmgmts:{impersonationLevel=impersonate," & "authenticationLevel=pktPrivacy}!\\.\root\cimv2")
Set enabledNICs = cimv2Namespace.ExecQuery ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
If Err <> 0 Then
Log ("Failed to get the enabled NICs on the machine.(" & Err.number & ")")
GetDefaultGateway = Err
LogExtendedError ()
Exit Function
End If
' Read the Default Gateway address on the last enabled NIC.
Dim item, DefaultGateway
For Each item in enabledNICs
If Not IsNull (item.DefaultIPGateway) And Not item.defaultIPGateway(0) = "0.0.0.0" Then
DefaultGateway = item.DefaultIPGateway(0)
Log ("Found Default Gateway Address")
Log ("of active NIC: " & DefaultGateway)
Exit For
End If
' Log ("Found Default Gateway Address of active NIC: " & DefaultGateway)
Next
GetDefaultGateway = DefaultGateway
End Function
Free Windows Admin Tool Kit Click here and download it now
December 15th, 2011 2:28pm