description: Get a site role object. external help file: AdminUI.PS.dll-Help.xml Module Name: ConfigurationManager ms.date: 08/25/2020 schema: 2.0.0 title: Get-CMSiteRole
Get a site role object.
Get-CMSiteRole [-AllSite] [-RoleName <String>] [-SiteCode <String>] [[-SiteSystemServerName] <String>]
[-DisableWildcardHandling] [-ForceWildcardHandling] [<CommonParameters>]
Get-CMSiteRole [-AllSite] -InputObject <IResultObject> [-DisableWildcardHandling] [-ForceWildcardHandling]
[<CommonParameters>]
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.
This example gets all roles for all sites in the hierarchy.
Get-CMSiteRole -AllSite
This example gets all roles from the site P01.
Get-CMSiteRole -SiteCode P01
This example gets all roles installed on the site system cm01.contoso.local.
Get-CMSiteRole -SiteSystemServerName "cm01.contoso.local"
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
This example lists the role names for all sites in the hierarchy.
$allRoles = Get-CMSiteRole -AllSite
$allRoles.RoleName
Include this parameter to get all of the roles for the site.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: AllSites
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: IResultObject
Parameter Sets: SearchByValue
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
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 System
SMS Component Server
SMS Distribution Point
SMS Management Point
SMS Device Management Point
SMS Software Update Point
SMS Enrollment Server
SMS Enrollment Web Site
SMS Notification Server
SMS Certificate Registration Point
SMS DM Enrollment Service
SMS Site Server
SMS State Migration Point
SMS Provider
SMS Cloud Proxy Connector
SMS SQL Server
SMS Fallback Status Point
AI Update Service Point
SMS SRS Reporting Point
SMS Endpoint Protection Point
Data Warehouse Service Point
SMS Dmp Connector
Note
This list may not include all possible site roles.
Type: String
Parameter Sets: SearchByName
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True
Specify the site code for the specific site role.
Type: String
Parameter Sets: SearchByName
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specify the name of a specific site system server from which to get the role.
Type: String
Parameter Sets: SearchByName
Aliases: Name, ServerName
Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: True
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.