New-SCOMManagementGroupConnection
New-SCOMManagementGroupConnection
Creates a persistent connection to a management group.
Syntax
Parameter Set: FromComputerNames
New-SCOMManagementGroupConnection [[-ComputerName] <String[]> ] [[-Credential] <PSCredential> ] [-PassThru] [ <CommonParameters>]
Detailed Description
The New-SCOMManagementGroupConnection cmdlet creates a persistent connection to a System Center 2012 – Operations Manager management group. A variety of cmdlets require a connection to a management group. By default, cmdlets use the current active persistent connection to a management group.
The most recent connection that this cmdlet creates becomes the active connection. Only one active persistent connection can exist at a time. If you attempt to create a connection that already exists, the cmdlet does not create another instance of the connection.
Specify a computer that belongs to the management group, along with required credentials. You must run the System Center Data Access service to use this cmdlet. You can use the Get-SCOMManagementGroupConnection cmdlet to get existing persistent connections, and you can use the Set-SCOMManagementGroupConnection cmdlet to make any persistent connection become the active connection. For more information about persistent connections, type Get-Help about_OpsMgr_Connections
.
Parameters
-ComputerName<String[]>
Specifies an array of names of computers. The cmdlet establishes persistent connections with management groups for these computers. You can use NetBIOS names, IP addresses, or fully qualified domain names (FQDNs). To specify the local computer, type the computer name, localhost, or a dot (.).
Aliases |
none |
Required? |
false |
Position? |
1 |
Default Value |
localhost |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-Credential<PSCredential>
Specifies a PSCredential object for the management group connection. To obtain a PSCredential object, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential
.
Use an account that has access to the computer specified in the ComputerName parameter. The default is the current user.
Aliases |
none |
Required? |
false |
Position? |
2 |
Default Value |
Current user context |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-PassThru
Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
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 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
System.String
You can pipe a computer name to the ComputerName parameter of this cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Connection object
If you specify the PassThru parameter, this cmdlet generates a connection object.
Examples
Example 1: Create a connection
This command creates a persistent connection for the local computer. The command employs the Get-Credential cmdlet to create a PSCredential object for the user WOODGROVE\Administrator. That cmdlet prompts the user for a password.
PS C:\> New-SCOMManagementGroupConnection -ComputerName "localhost" -Credential (Get-Credential WOODGROVE\Administrator)
Related topics
Get-SCOMManagementGroupConnection
Remove-SCOMManagementGroupConnection