- 16 Jan 2025
- 1 Minute to read
- Print
- DarkLight
- PDF
Microsoft MECM - Add or Remove Assets to/from Collection (PS-based)
- Updated on 16 Jan 2025
- 1 Minute to read
- Print
- DarkLight
- PDF
Microsoft MECM - Add or Remove Assets to/from Collection (PS-based) adds devices to or removes them from a collection using direct membership rules for:
- Assets returned by the selected query or assets selected on the relevant asset page.
This Enforcement Action replaces Microsoft MECM - Add or Remove Assets to Collection, as it uses PowerShell commands, which is the Microsoft-recommended method of adding devices to a collection. Microsoft MECM - Add or Remove Assets to Collection is still supported, but this action is recommended.
- Not all asset categories are supported for all Enforcement Actions.
- See Actions supported for Activity Logs, Adapters Fetch History, and Asset Investigation modules.
- See Actions supported for Vulnerabilities.
- See Actions supported for Software.
Required Fields
These fields must be configured to run the Enforcement Set.
- Action name - The name of this Enforcement Action. The system sets a default name. You can change the name.
- Configure Dynamic Values - Toggle on to enter a Dynamic Value statement. See Creating Enforcement Action Dynamic Value Statements to learn more about Dynamic Value statement syntax.
- Host - The hostname or IP address of the host that has Configuration Manager cmdlets available to run via PowerShell.
- Username - A username with the required permissions to run this action.
- Password - The user's password..
- EC Action - Select between Add to Collection and Remove from Collection.
- Site - The Configuration Manager site in which the Enforcement Action will run.
- Collection Name - The name of the collection to which the changes will apply.
Compute Node - The Axonius node to use when connecting to the specified host. For more details, see Connecting Additional Axonius Nodes.
Additional Fields
These fields are optional.
- Gateway Name - Select the Gateway through which to connect to perform the action.
APIs
Axonius uses the ConfigurationManager API.
Required Ports
Axonius must be able to communicate via the following ports:
- 5986
Required Permissions
The stored credentials must have permission to run the following cmdlets in PowerShell:
- Add-CMDeviceCollectionDirectMembershipRule
- Get-CMDevice
- Get-CMDeviceCollection
- Remove-CMDeviceCollectionDirectMembershipRule
- Import-Module
- Set-Location
For more details about other Enforcement Actions available, see Action Library.