Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove a DP from a SCCM Software Distribution Package

Status
Not open for further replies.

twdeveloper

Programmer
Mar 8, 2011
19
US
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top