twdeveloper
Programmer
Hello,
I could use some assistance on how to Remove Distribution Points (DPs) from my SCCM Packages.
I found the following article which seems to do, exactly what I am looking for. Unfortunately though I have run into some issues and need a little help troubleshooting.
I believe my issue is with the function:
Function GetSMSNameSpace(SiteServer)
On Error Resume Next
Dim colNameSpaceQuery, refitem, refWMI
Set refWMI = GetObject("winMgmts:\\" &SiteServer&"\root\sms")
If Err.number <> 0 Then
WScript.Echo "Error connecting to SMS namespace on " &SiteServer
WScript.Quit
End If
Set colNameSpaceQuery = refWMI.ExecQuery("select * from SMS_ProviderLocation")
For Each refitem in colNameSpaceQuery
GetSMSNameSpace = refitem.NamespacePath
Next
Set colNameSpaceQuery = Nothing
Set refitem = Nothing
Set refWMI = Nothing
End Function
When I run the Script as is with the 2 Arguments "MyCentralSiteServer" and "MyDistribution Point"
I receive a Error Running query:Access is denied message.
I do not have a "root\sms\ directory in winmgmt, however I do have a root\CIMV2\sms. So on the following line:
Set refWMI = GetObject("winMgmts:\\" &SiteServer&"\root\sms")
If I change to \root\CIMV2\sms I then receive Error connecting to on TEST-SERVER-SMS: 424
Any suggestions on what I need to do? I have also made sure that each Folder om winmgmt Security has the SMSAdmin Account added with Full Control.
I could use some assistance on how to Remove Distribution Points (DPs) from my SCCM Packages.
I found the following article which seems to do, exactly what I am looking for. Unfortunately though I have run into some issues and need a little help troubleshooting.
http://blogs.msdn.com/b/rslaten/archive/2006/03/01/removing-a-retired-dp-from-all-your-packages.aspx
I believe my issue is with the function:
Function GetSMSNameSpace(SiteServer)
On Error Resume Next
Dim colNameSpaceQuery, refitem, refWMI
Set refWMI = GetObject("winMgmts:\\" &SiteServer&"\root\sms")
If Err.number <> 0 Then
WScript.Echo "Error connecting to SMS namespace on " &SiteServer
WScript.Quit
End If
Set colNameSpaceQuery = refWMI.ExecQuery("select * from SMS_ProviderLocation")
For Each refitem in colNameSpaceQuery
GetSMSNameSpace = refitem.NamespacePath
Next
Set colNameSpaceQuery = Nothing
Set refitem = Nothing
Set refWMI = Nothing
End Function
When I run the Script as is with the 2 Arguments "MyCentralSiteServer" and "MyDistribution Point"
I receive a Error Running query:Access is denied message.
I do not have a "root\sms\ directory in winmgmt, however I do have a root\CIMV2\sms. So on the following line:
Set refWMI = GetObject("winMgmts:\\" &SiteServer&"\root\sms")
If I change to \root\CIMV2\sms I then receive Error connecting to on TEST-SERVER-SMS: 424
Any suggestions on what I need to do? I have also made sure that each Folder om winmgmt Security has the SMSAdmin Account added with Full Control.