It can sometimes get clumbsy working with SMS NAL paths and having to figure out a routine to parse the data. Fortunately, there already exists a WMI method to do this for us -UnPackNALPath. Below is a simple vbscript that demonstrates how to use the method and how the data is returned.
Dim objSWbemLocatorDim objSWbemServicesDim objNALMethodsDim strNALPathDim arrDisplayQuals()Dim strNALTypeDim strNOSPathDim arrNOSQuals()Dim colResources, objResourceDim strQuery
Const wbemFlagReturnImmediately = 16Const wbemFlagForwardOnly = 32 'Connect to the SMS provider for remote server. Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator") Set objSWbemServices = objSWbemLocator.ConnectServer("Appalachian", _ "root\sms\site_MH2") Set objNALMethods = objSWbemServices.Get("SMS_NAL_Methods") Query = "SELECT * FROM SMS_SystemResourceList " & _ "WHERE RoleName = 'SMS Distribution Point'"Set colResources = objSWbemServices.ExecQuery(Query, , _ wbemFlagForwardOnly Or wbemFlagReturnImmediately) For Each objResource In colResources strNALPath = objResource.NALPath objNALMethods.UnPackNALPath strNALPath, arrDisplayQuals, _ strNALType, strNOSPath, arrNOSQuals Wscript.Echo "NALPath = " & strNALPath & vbCrLf & _ " Display = " & arrDisplayQuals(0) & vbCrLf & _ " Type = " & strNALType & vbCrLf & _ " NOSPath = " & strNOSPath & vbCrLf & _ " NOSQual = " & arrNOSQuals(0)Next
Const wbemFlagReturnImmediately = 16Const wbemFlagForwardOnly = 32
'Connect to the SMS provider for remote server. Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator") Set objSWbemServices = objSWbemLocator.ConnectServer("Appalachian", _ "root\sms\site_MH2")
Set objNALMethods = objSWbemServices.Get("SMS_NAL_Methods")
Query = "SELECT * FROM SMS_SystemResourceList " & _ "WHERE RoleName = 'SMS Distribution Point'"Set colResources = objSWbemServices.ExecQuery(Query, , _ wbemFlagForwardOnly Or wbemFlagReturnImmediately)
For Each objResource In colResources strNALPath = objResource.NALPath
objNALMethods.UnPackNALPath strNALPath, arrDisplayQuals, _ strNALType, strNOSPath, arrNOSQuals Wscript.Echo "NALPath = " & strNALPath & vbCrLf & _ " Display = " & arrDisplayQuals(0) & vbCrLf & _ " Type = " & strNALType & vbCrLf & _ " NOSPath = " & strNOSPath & vbCrLf & _ " NOSQual = " & arrNOSQuals(0)Next
When run, this script will have output similar to the following:
NALPath = ["Display=\\APPALACHIAN\"]MSWNET:["SMS_SITE=MH2"]\\APPALACHIAN\ Display = Display=\\APPALACHIAN\ Type = MSWNET NOSPath = \\APPALACHIAN NOSQual = SMS_SITE=MH2
Posted Monday, March 24, 2008 8:26 PM by dthomson | with no comments
The long awaited release of the Microsoft Deployment Toolkit (MDT) 2008 has finally arrived. Read about it on the Microsoft Deployment Team blog at http://blogs.technet.com/msdeployment/default.aspx. It can be downloaded from http://www.microsoft.com/downloads/details.aspx?familyid=3bd8561f-77ac-4400-a0c1-fe871c461a89&displaylang=en&tm.
Posted Thursday, March 20, 2008 5:44 PM by dthomson | with no comments