Creating AutoInsert-Rules

This section covers the creation of AutoInsert-Rules.


Examples:


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


New AutoInsert-Rules are created using the New-EmdbAutoInsertRule cmdlet. Mandatory parameters are the name, the object type, for which the rule is valid, and the target container. As there are already standard rules which come as part of the installation, new rules must specify more detailed rules, or the creation will fail. The following example uses an IP-address scope:


$MyTarget = Get-EmdbOrganizationalUnit "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago"

New-EmdbAutoInsertRule "New Chicago Computers" -ForType Computer -TargetContainer $MyTarget -IPRangeStart "192.168.1.1" -IPRangeEnd "192.168.1.254"


AutoInsert-Rules support an order. During evaluation, the first rule with matching criteria is applied. As a consequence, the order of evaluation is an important aspect. The rule from above could therefore be created with in a more sophisticated way:


New-EmdbAutoInsertRule "New Chicago Computers" -ForType Computer -TargetContainer $MyTarget -IPRangeStart "192.168.1.1" -IPRangeEnd "192.168.1.254" -EvaluationOrder 1


Among other options, rules can also be created deactivated using the -Inactive switch:


New-EmdbAutoInsertRule "New Chicago Computers" -ForType Computer -TargetContainer $MyTarget -IPRangeStart "192.168.1.1" -IPRangeEnd "192.168.1.254" -EvaluationOrder 1 -Inactive


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.