r/MDT • u/automation_atw • Mar 05 '20
DefaultGateway variable in Task Sequence
Hello friends,
I just finished the setup of MDT/WDS in our org and I am really excited to play further with it. Now for next step I want to implement it across multiple sites. And one of the wall I hit is with the application install based on location, is there any way to use DefaultGateway value in TaskSequence step "options" so it installs a particular app for particular site.I was actually able to achieve this using customsettings.ini and defining the apps there as mandatory apps, see below:
[Settings]
Priority=DefaultGateway, NY, SFO, Default
[DefaultGateway]
172.16.203.254=NY
10.30.1.1=SFO
[NY]
MachineObjectOU=OU=NY Workstations,OU=Computers,<redacted>
; ESET NY
;MandatoryApplications001={80a3773d-6579-4e0c-a96f-29c7e4a020ca}
[SFO]
MachineObjectOU=OU=SFO Workstations,OU=Computers,<redacted>
; ESET SFO
;MandatoryApplications001={80a3773d-6579-4e0c-a96f-29f34jkerwa}
[Default]
<redacted>
; Slack
MandatoryApplications001={23a6b7fa-f1b9-47c2-b83e-b46b3b9cb6be}
; Firefox
MandatoryApplications002={a8444ef9-c4b3-4c62-b15f-a193900b4304}
; Edge
MandatoryApplications003={6e40905b-8bea-4134-bc77-37f34f135ecd}However the issue with this is that it install ESET as the very first app and ideally I would like this to be as last step in Task Sequence.So I have two questions:
Is it possible to use DefaultGateway value in TaskSequence Step options, if so what is the "Task Sequence Variable" name for that? Because "DefautGateway" does not work
Is it possible to assign two values to a default gateway and then use those separately to perform tasks, e.g:
[Settings]
Priority=DefaultGateway, NY-OU, SFO-OU, Default, NY-APP, SFO-APP
[DefaultGateway]
172.16.203.254=NY-OU,NY-APP
10.30.1.1=SFO-OU, SFO-APP
[NY-OU]
MachineObjectOU=OU=NY Workstations,OU=Computers,<redacted>
[SFO-OU]
MachineObjectOU=OU=SFO Workstations,OU=Computers,<redacted>
[Default]
<redacted>
; Slack
MandatoryApplications001={23a6b7fa-f1b9-47c2-b83e-b46b3b9cb6be}
; Firefox
MandatoryApplications002={a8444ef9-c4b3-4c62-b15f-a193900b4304}
; Edge
MandatoryApplications003={6e40905b-8bea-4134-bc77-37f34f135ecd}
[NY-APP]
; ESET NY
;MandatoryApplications001={80a3773d-6579-4e0c-a96f-29c7e4a020ca}
[SFO-APP]
; ESET SFO
;MandatoryApplications001={80a3773d-6579-4e0c-a96f-29f34jkerwa}Will this work? I most likely will go with the Task Sequence step but just want to know this one for curiosity sake.Thanks in advance :)
1
u/kwatch Mar 06 '20
You're going to want to take this down and repost it with sanitized information.
1
u/automation_atw Mar 06 '20
I already redacted all sensitive info, is there anything I missed if that is what you are referring to?
1
u/kwatch Mar 06 '20
I wouldn't post your gateways' IPs. They may be local IPs, but I wouldn't post ANY information that is specific to my internal infrastructure on the internet.
1
2
u/juliuspiv Mar 06 '20
I see what you're trying to achieve here and I suspect there are probably at least a hundred ways to accomplish the goal.
To first answer your question about the gateway: There isd a variable you can reference and I think it's something like Gateway001. I'll have to check the logs on a machine to confirm it but I don't recommend going in that direction.
Your second question about using two values: While I have never tried that, I'm confident it's not going to work.
I'm a pretty hardcore CustomSettings.ini customizer which makes it really challenging for those who come behind me. That said, my approach would be to lay the groundwork for grouping sites within the CustomSettings.ini then do everything via the Task Sequence itself.
Then within the Task Sequence you would have a group for All Offices and then groups for each specific office which would be triggered by the Task Sequence variable 'Office' (e.g.: NY). This makes managing application installation order much easier and keeps the CS.ini pretty lean.
Depending on how many applications you need to lay down, you may want to consider using Application Bundles.