Get-CMSiteRole
Get a site role object.
Syntax
SearchByName (Default)
Get-CMSiteRole
[[-SiteSystemServerName] <String>]
[-AllSite]
[-RoleName <String>]
[-SiteCode <String>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[<CommonParameters>]
SearchByValue
Get-CMSiteRole
-InputObject <IResultObject>
[-AllSite]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[<CommonParameters>]
Description
Returns the roles installed on a Configuration Manager site system server. For example, a management point or distribution point.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.
Examples
Example 1: Get all roles from all sites
This example gets all roles for all sites in the hierarchy.
Get-CMSiteRole -AllSite
Example 2: Get all roles for a specific site
This example gets all roles from the site P01.
Get-CMSiteRole -SiteCode P01
Example 3: Get roles for a specific server
This example gets all roles installed on the site system cm01.contoso.local.
Get-CMSiteRole -SiteSystemServerName "cm01.contoso.local"
Example 4: Count all management points
This example gets all of the management points in the hierarchy, and displays the count.
$mp = Get-CMSiteRole -RoleName "SMS Management Point" -AllSite
$mp.Count
Example 5: List all roles by name
This example lists the role names for all sites in the hierarchy.
$allRoles = Get-CMSiteRole -AllSite
$allRoles.RoleName
Parameters
-AllSite
Include this parameter to get all of the roles for the site.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AllSites |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-InputObject
Returns the roles installed on a Configuration Manager site system server. For example, a management point or distribution point.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.
Parameter properties
| Type: | IResultObject |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
SearchByValue
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | True |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-RoleName
Specify a specific role name to get. The value is the string from the RoleName property on the SMS_SCI_SysResUse class. For example:
SMS Site SystemSMS Component ServerSMS Distribution PointSMS Management PointSMS Device Management PointSMS Software Update PointSMS Enrollment ServerSMS Enrollment Web SiteSMS Notification ServerSMS Certificate Registration PointSMS DM Enrollment ServiceSMS Site ServerSMS State Migration PointSMS ProviderSMS Cloud Proxy ConnectorSMS SQL ServerSMS Fallback Status PointAI Update Service PointSMS SRS Reporting PointSMS Endpoint Protection PointData Warehouse Service PointSMS Dmp Connector
Note
This list may not include all possible site roles.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | True |
| DontShow: | False |
Parameter sets
SearchByName
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-SiteCode
Specify the site code for the specific site role.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
SearchByName
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-SiteSystemServerName
Specify the name of a specific site system server from which to get the role.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | True |
| DontShow: | False |
| Aliases: | Name, ServerName |
Parameter sets
SearchByName
| Position: | 0 |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.