Add-RMCollectionItem
From PowerGUI Wiki
Adds a new item to a computer collection.
Contents |
Syntax
Add-RMCollectionItem [-Collection] <PSObject> -DomainController <String> [<CommonParameters>]
Add-RMCollectionItem [-Collection] <PSObject> -Domain <String> [<CommonParameters>]
Detailed Description
Adds a new item to the computer collection that has the specified name or is represented by the specified objects.
Related Commands
Parameters
| Name | Description | Required? | Pipeline Input | Default Value |
|---|---|---|---|---|
| Collection | Specifies the computer collection to which a new item is to be added. This can be a computer collection object passed down the pipeline, stored in a variable, or specified by name. | true | true (ByValue) | |
| DomainController | Specifies the DNS name of the domain controller to be added to the computer collection. | true | false | |
| Domain | Specifies the DNS name of the domain to be added to the computer collection. | true | false |
Examples
Example 1
Add-RMCollectionItem –Collection Collection1 –DomainController dc1.dom1.local
Adds the dc1.dom1.local domain controller to the computer collection named Collection1.
Example 2
$c = Get-RMCollection Collection1 C:\PS>Add-RMCollectionItem -Collection $c –Domain dom1.local
In the first line of this example, the Get-RMCollection cmdlet gets the computer collection object named Collection 1 and saves it in the $c variable. In the second line, the Add-RMCollection cmdlet adds the dom1.local domain to the collection object saved in the $c variable.
