Edit

Share via


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 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.

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.

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

IResultObject

IResultObject