Retrieving AutoInsert-Rules

Retrieves AutoInsert-Rule objects.


Hint: The execution of these examples requires a connected PowerShell drive.

All AutoInsert-Rules defined can be retrieved using the cmdlet Get-EmdbAutoInsertRule.


As with other cmdlets, too, the returned AutoInsert-Rule-objects can be filtered. the following example just retrieves the "Default Auto-Insert Rule (Computers)" object:

Get-EmdbAutoInsertRule -Path "Default Auto-Insert Rule (Computers)"

or alternatively (and more easily)

Get-EmdbAutoInsertRule "Default Auto-Insert Rule (Computers)"

Retrieve the AutoInsert-Rule "Default Auto-Insert Rule (Users)" through its Item-ID (this ID will vary in different DSM environments):

Get-EmdbAutoInsertRule -ItemID 12

Tip: the alias ID can be used instead of ItemID.

Note: Note that AutoInsert-Rule-objects are Catalog-objects contained in rootCatalog and are therefore not part of the context rootDSE. As as consequence, they can be referenced without a full qualified path resp. an absolute path.

Starting with PSX 3.1 there was a new option implemented when retrieving AutoInsert-Rule objects. When specifying the SingleItemExpected-switch it is expected, that none or exactly one object is contained in the result. If the retrieval returns more than one object, an error is raised that can be caught and handled in scripts.