Problems with GetAssignedSiteBySLP function

Apr 1, 2010 at 4:54 PM


We use BGInfo to write data to the desktop during OSD.  Part of that displayed information is the SMSDP OSD variable.  We have a single site with 93 DPs spread across 80 local offices, so displaying the SMSDP helps us ensure we've got the correct IP address ranges defined for each DP (so that offices always use their local DP and don't pull packages over the WAN).

I'm trying to implement your custom scripts so that we can stop advertising our task sequences to all (50,000+) machines.  Our task sequences are huge, generating 200+ policies per machine, per task sequence.  If we can avoid this, it will be a huge plus for us.  Thank you so much for making this available.


I've implemented the custom web service and created the customized boot media.  I initially used the GetAssignedSite function which queries AD, but we noticed that the SMSDP variable was always set to the same value, regardless of office location/IP address.  What I realized is that GetAssignedSite returns data based on the IP address of the server running the custom web service, not the IP address of the system running the task sequence.

To resolve that, I switched to using the GetAssignedSiteBySLP function, which returned the following:

> CHECKING the [GetAssignedSiteBySLP] section
> No parameters to include in the web service call were spcified
> Property SiteIP is now =
> Property SiteSubnet is now =
> Property SiteMACAddress is now = 00:0C:29:50:4E:86
> About to execute web service call using method POST to :
> ZTI ERROR - Unhandled error returned by ZTIMediaHook: The parameter is incorrect. (-2147024809  0x80070057)

It seems that error is caused by a bug in the GetAssignedSiteBySLP function in your customized ZTIMediaHook.wsf.  The line

>      oService.SectionName = "GetAssignedSiteBySLP"

needs to be changed to

>      oService.SectionName = "GetSCCMAssignedSiteBySLP"

in order to match the section [GetSCCMAssignedSiteBySLP] in SCCM_Bootstrap.ini.

After making that change, the web service call is successful, but a new error is returned:

> CHECKING the [GetAssignedSiteBySLP] section
> No parameters to include in the web service call were specified
> Property SiteIP is now =
> Property SiteSubnet is now =
> Property SiteMACAddress is now = 00:0C:29:50:4E:86
> About to execute web service call using method POST to http://uscnt2016/osd/SCCM.aasmx/GetAssignedSiteByIP: IPAddress=
> Response from web service: 200 OK
> Successfully executed the web service.
> ZTI ERROR - Unhandled error returned by ZTIMediaHook: Illegal assignment (501)

That error occurs when ZTIMediaHook.wsf hits this line in the GetAssignedSiteBySLP function:

>       GetAssignedSite = sAssignedSite

So that's where I'm stuck at the moment.  Hope I've explained things clearly and didn't go overboard with details.

Apr 5, 2010 at 4:16 PM

It seems to be another typo. please check the GetAssignedSiteBySLP function at the end you will find the following line:

GetAssignedSite = sAssignedSite

This needs to be

GetAssignedSiteBySLP = sAssignedSite

Regarding the first issue with the IP Adress. I've seen this only if the the requests came in using IPv6 only. The webservice takes the IP Adress of the request itself. If the Client used IPv6 it will try to resolve this to an IPv4 Address by querying DNS. If this also fails it will then use the IP Address of the local server to have at least one valid IP Address for processing. You can enable the tracing option to get more information on what exactly happens (see for details on this).

About the single site. Do you really have one single site only or a primary site with secondary sites per location/DP ? 

What Boot Media did you create? Are you using a Boot CD or PXE Boot? The Boot CD will always connect back to the Primary it has been created on, not matter what DP has been choosen in the dialog.

Apr 5, 2010 at 7:36 PM

Thank you, I've fixed the GetAssignedSiteBySLP function and it seems to be working properly.

I realize now that the SMSDP issue was my fault.  I generated a new boot image for this testing, and had not replicated the package to the local DPs, so the OSD variable was set to the unprotected DP at startup.  Once I replicated the boot image to the local DPs, this resolved it.

Yes, we are truly a single site.  This is per Microsoft's recommendations for our environment.  It's the "ideal" architecture, assuming you have the bandwidth to handle it, and they're going to be promoting a flatter architecture for most enterprises in v.Next.

The boot media is generated with ConfigMgr/MDT 2010 integration, and manually editing BOOT.WIM to run a custom winpeshl.ini file that calls BGInfo prior to the boot wizard.

Thanks again for sharing such a great toolset.

Apr 5, 2010 at 11:23 PM

Of course, now I realize the GetAssignedSite functions are unnecessary since we are a single site.  There are other sites on the WAN, so I've modified the script simply to query and compare it to the value in SCCM_Bootstrap.ini and log the results for potential troubleshooting.