Add-RemotelyManagedDevice

Add-RemotelyManagedDevice

Adds a remotely managed device to an agent.

Syntax

Parameter Set: FromAgentManagedComputer
Add-RemotelyManagedDevice [-ProxyAgent] <AgentManagedComputer> [-Device] <CustomMonitoringObject[]> [ <CommonParameters>]

Detailed Description

Adds a remotely managed device to an agent.

Parameters

-Device<CustomMonitoringObject[]>

Specifies the custom monitoring objects that are associated with the device. Use start-discovery with a device discovery configuration to retrieve discovery results that include these custom monitoring objects.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-ProxyAgent<AgentManagedComputer>

Specifies the proxy agent to use.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters

Notes

  • For more information, type "Get-Help Add-RemotelyManagedDevice -detailed". For technical information, type "Get-Help Add-RemotelyManagedDevice -full".
    When specifying multiple values for a parameter, use commas to separate the values. For example, "<parameter-name> <value1>, <value2>".

Examples

-------------- EXAMPLE 1 --------------

This command requires that a variable named $dc be populated with a device discovery configuration, as demonstrated in the previous example. Start-Discovery is used to get and store discovery results in the $discovery_results variable. Get-Agent is then used to retrieve a reference to an agent named fabrikam and store it in the $agent variable. Last, Add-RemotelyManagedDevice is used to add the network device to the agent.

C:\PS>$discovery_results = start-discovery `
-managementserver (get-managementserver) `
-devicediscoveryconfiguration $dc
$agent = get-agent | where-object {$_.Name -eq "fabrikam"}
add-remotelymanageddevice -proxyagent $agent `
-device $discovery_results.custommonitoringobjects

-------------- EXAMPLE 2 --------------

This command demonstrates how to create a device discovery configuration which is used in the next example. Type get-help -full new-devicediscoveryconfiguration for more information.

C:\PS>$networkdeviceclass = get-monitoringclass -name 'System.NetworkDevice'
$dc = new-devicediscoveryconfiguration -monitoringclass `
$networkdeviceclass -fromipaddress 192.168.0.1 -toipaddress 192.168.0.4
$encoding = new-object System.Text.UnicodeEncoding
$encodedCommunityString = $encoding.GetBytes("CommunityString")
$dc.ReadOnlyCommunity = `
[System.Convert]::ToBase64String($encodedCommunityString)

Add-RemotelyManagedComputer

Get-RemotelyManagedComputer

Get-RemotelyManagedDevice

Remove-RemotelyManagedComputer

Remove-RemotelyManagedDevice