Testing Organizational Units

Tests the existence of the specified Organizational Unit object(s). Returns true, if the Organizational Unit exists and false if it doesn't.


Examples:


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


Tests if the Organizational Unit object "Chicago"  exists in the container "Managed Users & Computers\solys.local":


Test-EmdbOrganizationalUnit "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago"


The following example tests, if an Organizational Unit object with a name starting with "P" exists in the "Managed Users & Computers\solys.local" container:


Test-EmdbOrganizationalUnit "emdb:\rootDSE\Managed Users & Computers\solys.local\P*"


The following code snippet first changes the working directory to the "solys.local" Domain under "Managed Users & Computers" and then tests, if an Organizational Unit named "Software Assignments" exists underneath:


Cd "emdb:\rootDSE\Managed Users & Computers\solys.local"

Test-EmdbOrganizationalUnit "Software Assignments" -Recurse