1

I want to get the site system servers associated with a boundary group in SSCM using Powershell.

There is a commandlet Get-CMDistributionPoint however there is no parameter to specify a boundary group.

David Klempfner
  • 195
  • 2
  • 13

2 Answers2

1

My answer may not be the best but can show what you want:

First, you need to use PowerShell to connect to CM site:

Import-Module "$($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1" # Import the ConfigurationManager.psd1 module 
Set-Location "CTS:" # Set the current location to be the site code.

Or you can just click below:

enter image description here

Code here to get what you want:

$BoundaryGroup = Get-CMBoundaryGroup -Name 'Test'
Get-WmiObject -Namespace root\sms\site_cts -Class SMS_BoundaryGroupSiteSystems | where {$_.groupid -eq $boundarygroup.GroupID} | select servernalpath, sitecode 

Replace Test to your boundary group name. You can output any properties in Select

Attention: You need to run the PowerShell lines on your site server because root\sms\site_cts is a WMI Namespace on your site server (CTS is site code).

  • I get an invalid namespace error even though I put in the correct site code. – David Klempfner Feb 20 '17 at 06:30
  • the WMI namespace root\sms\site_ is on your site server, thus you need to run the PowerShell commands on your site sierver. Or you can make a remote session by add -Computername. For example: `Get-WmiObject -ComputerName CAS -Namespace root\sms\site_cts -Class sms_boundarygroupsitesystems | where {$_.groupid -eq $boundarygroup.GroupID} | select servernalpath, sitecode `. I'll edit my answer. – Bifeng Dong - MSFT Feb 20 '17 at 07:11
  • Unfortunately I get RPC server unavailable. – David Klempfner Feb 21 '17 at 00:42
  • Basically, the PowerShell command is querying Server WMI Class [link](https://msdn.microsoft.com/en-us/library/hh442774.aspx) _SMS_BoundaryGroupSiteSystems._. I use `where` to filter the specific boundary group you need. Run the lines on your Primary Site Server, replace the site code, it will certainly work. – Bifeng Dong - MSFT Feb 21 '17 at 01:40
  • Have you got it worked? Any help needed on this? – Bifeng Dong - MSFT Feb 26 '17 at 14:09
0

That's not supported with the current Powershell commandlets. Have you considered using a custom SSRS report such as https://gallery.technet.microsoft.com/SCCM-2012-SSRS-report-7570a001 instead?

JaeBee
  • 136
  • 3