Cmdlets for Microsoft Active Directory

Build 24.0.9060

Remove-AD Cmdlet

Parameters   Output Objects  

Deletes Microsoft Active Directory data.

Syntax

Remove-AD [parameters]

Remarks

The Remove-AD cmdlet allows you to use a syntax similar to SQL DELETE statements to delete Microsoft Active Directory data.

$conn = Connect-AD -User 'MyUserName' -Password 'MyPassword' -Server 'MyServer' -Port 'MyPort' -BaseDN 'MyDN'
Remove-AD -Connection $conn -Table "User" -Id "CN=User Name,CN=Users,DC=Domain"
The Where parameter can also be used to specify the primary key:
Remove-AD -Connection $conn -Table "exTablePowershell;" -Where "Id = CN=User Name,CN=Users,DC=Domain"
The primary key can also be passed to the cmdlet along the pipeline:
Select-AD -Connection $conn -Table User -Where "CN = 'Administrator'" | Remove-AD

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9060