我想使用Powershell获取与SSCM中边界组关联的站点系统服务器。
有一个命令行Get-CMDistributionPoint
但是没有参数来指定一个边界组。
目前的Powershell命令行程序不支持这个function。 您是否考虑过使用定制的SSRS报告,例如https://gallery.technet.microsoft.com/SCCM-2012-SSRS-report-7570a001 ?
我的答案可能不是最好的,但可以显示你想要的:
首先,您需要使用PowerShell连接到CM网站:
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.
或者你可以点击下面的:
代码在这里得到你想要的:
$BoundaryGroup = Get-CMBoundaryGroup -Name 'Test' Get-WmiObject -Namespace root\sms\site_cts -Class SMS_BoundaryGroupSiteSystems | where {$_.groupid -eq $boundarygroup.GroupID} | select servernalpath, sitecode
将testingreplace为您的边界组名称。 您可以在select中输出任何属性
注意:您需要在站点服务器上运行PowerShell行,因为root \ sms \ site_cts是站点服务器上的WMI命名空间(CTS是站点代码)。