New-SqlMonitorPrincipal
Published 12 September 2023
Creates a new Principal on all base monitors
Syntax
New-SqlMonitorPrincipal [-Name] <string> [-Role] <string> [[-Type] <string>] [[-Groups] <Group[]>] [[-MonitoredObjects] <MonitoredObject[]>] [-All] [<CommonParameters>]
Description
The New-SqlMonitorPrincipal cmdlet creates a new Principal on each base monitor for SQL Monitor.
Connect-SqlMonitor must be called before this cmdlet.
Parameters
  
    -Name
    <String>
  
The Name of the Principal.
| Aliases | None | 
| Required? | true | 
| Position? | 1 | 
| Default Value | None | 
| Accept Pipeline Input | False | 
| Accept Wildcard Characters | false | 
  
    -Role
    <String>
  
The Role of the Principal ("Administrator", "Standard", "Reporting", or "ReadOnly"). For more information, see https://www.red-gate.com/sm13/auth-basic/managing-user-roles
| Aliases | None | 
| Required? | true | 
| Position? | 2 | 
| Default Value | None | 
| Accept Pipeline Input | False | 
| Accept Wildcard Characters | false | 
  
    -Type
    <String>
  
The Type of the OpenID Connect Principal ("User" or "Group").
| Aliases | None | 
| Required? | false | 
| Position? | 3 | 
| Default Value | None | 
| Accept Pipeline Input | False | 
| Accept Wildcard Characters | false | 
  
    -All
    <SwitchParameter>
  
Should the Principal have access to all monitored entities? Cannot be specified for administrators.
| Aliases | None | 
| Required? | false | 
| Position? | named | 
| Default Value | False | 
| Accept Pipeline Input | False | 
| Accept Wildcard Characters | false | 
  
    -Groups
    <Group[]>
  
Groups for the new Principal to have access to. Cannot be specified for administrators. Cannot be specified if All is set to true.
| Aliases | None | 
| Required? | false | 
| Position? | 4 | 
| Default Value | [Group[]]@() | 
| Accept Pipeline Input | False | 
| Accept Wildcard Characters | false | 
  
    -MonitoredObjects
    <MonitoredObject[]>
  
Monitored objects (outside specified groups) for the new Principal to have access to. Cannot be specified for administrators. Cannot be specified if All is set to true.
| Aliases | None | 
| Required? | false | 
| Position? | 5 | 
| Default Value | [MonitoredObject[]]@() | 
| Accept Pipeline Input | False | 
| Accept Wildcard Characters | false | 
  
    -ProgressAction
    <ActionPreference>
  
{{ Fill ProgressAction Description }}
| Aliases | None | 
| Required? | false | 
| Position? | named | 
| Default Value | None | 
| Accept Pipeline Input | False | 
| Accept Wildcard Characters | false | 
  <CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see http://technet.microsoft.com/en-us/library/hh847884.aspx.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
- 
    None.
    
 You cannot pipe input to this cmdlet.
Examples
-------------------------- EXAMPLE 1 --------------------------
New-SqlMonitorPrincipal -Name "test.user@example.com" -Role "Administrator"
-------------------------- EXAMPLE 2 --------------------------
New-SqlMonitorPrincipal -Name "test.user@example.com" -Role "Standard" -All $true