Get-CMSiteRole

Get a site role object.

Syntax

Get-CMSiteRole
   [-AllSite]
   [-RoleName <String>]
   [-SiteCode <String>]
   [[-SiteSystemServerName] <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [<CommonParameters>]
Get-CMSiteRole
   [-AllSite]
   -InputObject <IResultObject>
   [-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.

Type:SwitchParameter
Aliases:AllSites
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Type:IResultObject
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters: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 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
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:True

-SiteCode

Specify the site code for the specific site role.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SiteSystemServerName

Specify the name of a specific site system server from which to get the role.

Type:String
Aliases:Name, ServerName
Position:0
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:True

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

IResultObject[]

IResultObject