Phil, I do something similar like this in my environment cause I have alot of customization depending on the site location. So, I basically use a vb script that looks something like below. When the task sequence runs at the beginning, I get the content loctions of my boot image using "_SMSTSXXXXXXXX". I first create a new TS variable called "CurrentSite". I then get the DP return values of my boot image. I change everything to lower case just for simplicity and store in temp variable. If I find the name of a certain DP, I have figured out site location. I do this for each DP site location where I do imaging, an if statement for each location.
So, throughout my task sequence...I reference my TS variable "CurrentSite"
to do conditional steps based on the location.
Technically, this may appear like a static approach, but I really don't
reference the full name of my DP servers. I only check if there is a
certain string cause our servers our named using branch location naming
scheme. So...if a second DP or a different DP comes up for a certain
branch, my vb script is still dynamic enough to figure out the site
location. The only thing that is static is making sure I account for each
site location.
If there is an easier way to do this, great. This is the way I was doing it
from CM07 and still works in CM12. By the way, I was using the WshShell.run
for testing to make sure it was working correctly. You can ignore that.
On Error Resume Next
'Set WshShell = WScript.CreateObject("WScript.Shell")
Set env = CreateObject("Microsoft.SMS.TSEnvironment")
env("CurrentSite") = "NONE"
theLine = lcase(env("_SMSTSXXXXXXXX"))
'WshShell.run "cmd /c echo " & env("_SMSTSXXXXXXXX") & " > C:\DPSite.txt"
If Instr(theLine,"dpservername") then
env("CurrentSite") = "dpsitelocation"
End if
<repeat this if condition for each site location>
Elias
On Fri, Oct 11, 2013 at 9:03 AM, Schwan, Phil <[email protected]
> wrote:
> Well, the modification worked in the lab. I just need to see if it works
> in the client environment. If so, I’ll throw a blog post up about it.****
>
> ** **
>
> -Phil****
>
> ** **
>
> ** **
>
> ** **
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Chris Nackers
> *Sent:* Friday, October 11, 2013 8:44 AM
>
> *To:* [email protected]
> *Subject:* [MDT-OSD] RE: SMSDP Variable****
>
> ** **
>
> All know is I spent a bunch of time trying to get it to work in 2007,
> including talking with the MDT dev team at the time. Ultimately I quit
> using it, so take it as you will J****
>
> ** **
>
> *Chris Nackers*
>
> *Microsoft MVP – Enterprise Client Management*
>
> Email: [email protected]****
>
> *Nackers Consulting Services, LLC*
>
> ** **
>
> *From:* [email protected] [
> mailto:[email protected] <[email protected]>] *On
> Behalf Of *Schwan, Phil
> *Sent:* Friday, October 11, 2013 6:56 AM
> *To:* [email protected]
> *Subject:* [MDT-OSD] RE: SMSDP Variable****
>
> ** **
>
> I have a client who was leveraging that variable in their CM07 environment
> to differentiate between sites for the purpose of customization.
> Basically, using the DP to determine which CS.ini to process with the
> Gather, as well as some other tie-ins to OSDAppTree. I wanted to verify my
> understanding of how and where that variable came from before I break the
> news that there’s some re-engineering coming.****
>
> ** **
>
> Looking at the available variables, I do see that there is a corresponding
> *_SMSTSHTTPPS10000C** variable set to
> http://CM01.lab.local/SMS_DP_SMSPKG$/PS10000C*. So, in theory, if one
> were to modify the ZTIGather.wsf file to reference that variable instead of
> _SMSTSBootImageID for parsing the DP name, it should work.****
>
> ** **
>
> I’ll give it a run in the lab and see what happens.****
>
> ** **
>
> -Phil****
>
> ** **
>
> ** **
>
> ** **
>
> *From:* [email protected] [
> mailto:[email protected] <[email protected]>] *On
> Behalf Of *Chris Nackers
> *Sent:* Thursday, October 10, 2013 5:09 PM
> *To:* [email protected]
> *Subject:* [MDT-OSD] RE: SMSDP Variable****
>
> ** **
>
> It’s still there, but I wouldn’t use it with any but SMS 2003.. J ****
>
> ** **
>
> It’s “left-over” as far as I know… and it’s been a few years, but I know
> looked at using it in 2007 and it doesn’t work the same way that it did
> with 2003, so I stopped using it.****
>
> ** **
>
> What are you trying to accomplish as the total result, might be an easier
> way to do it?****
>
> ** **
>
> *Chris Nackers*
>
> *Microsoft MVP – Enterprise Client Management*
>
> Email: [email protected]****
>
> *Nackers Consulting Services, LLC*
>
> ** **
>
> *From:* [email protected] [
> mailto:[email protected] <[email protected]>] *On
> Behalf Of *Schwan, Phil
> *Sent:* Thursday, October 10, 2013 3:55 PM
> *To:* [email protected]
> *Subject:* [MDT-OSD] RE: SMSDP Variable****
>
> ** **
>
> To update, I’m looking at the ZTIGather.log file (the script is what sets
> the SMSDP variable), and it’s not retrieving the DP because the TS variable
> for the boot image doesn’t provide it…****
>
> ** **
>
> _SMSTSBootImageID = PS10000C and _SMSTSPS10000C = <blank> so ZTIGather
> doesn’t have anything to parse out.****
>
> ** **
>
> Any ideas why that would not be populating?****
>
> ** **
>
> -Phil****
>
> ** **
>
> *From:* [email protected] [
> mailto:[email protected] <[email protected]>] *On
> Behalf Of *Schwan, Phil
> *Sent:* Thursday, October 10, 2013 4:38 PM
> *To:* [email protected]
> *Subject:* [MDT-OSD] SMSDP Variable****
>
> ** **
>
> I know there’s a %SMSDP% variable usable in MDT integrated Task Sequences
> that basically returns the DP that the boot image was downloaded from
> (which would also typically correspond to the DP the machine would be
> downloading the rest of the content from).****
>
> ****
>
> Running through a TS in my lab (CM2012 SP1 CU3, MDT2012U1) it doesn’t
> appear this variable exists or is being populated. Can somebody verify that
> this is still a valid Task Sequence variable?****
>
> ****
>
> Thanks,****
>
> Phil****
>
> ****
>
> _________________________________________________________________****
>
> Phil Schwan | Technical Specialist, Enterprise Windows Services****
>
> *Project Leadership Associates** *|* *2000 Town Center, Suite 1900,
> Southfield, MI 48075****
>
> Lync: 312.756.1626 Mobile: 419.262.5133****
>
> www.projectleadership.net****
>
> *[image: Description: Description: Description: Arrow email]**Lead with
> Strategy. Leverage Technology. Deliver Results.*****
>
> [image: linkedin_logo-19x20] <http://www.linkedin.com/in/philschwan>[image:
> Twitter-Logo1-20x20] <https://twitter.com/philschwan> [image:
> wordpress-logo3] <http://myitforum.com/myitforumwp/author/philschwan>****
>
> ****
> ------------------------------
>
>
> PRIVILEGED AND CONFIDENTIAL. This email and any files transmitted with it
> are privileged and confidential and intended solely for the use of the
> individual or entity to whom they are addressed. If you have received this
> email in error please notify the sender. If you are not the named addressee
> you should not disseminate, distribute or copy this e-mail or any of its
> attachments.****
>
> ****
>
<<image001.jpg>>
<<image004.jpg>>
<<image002.jpg>>
<<image003.jpg>>
