Script Repository


Disable all computers managed by a user

September 04, 2015
1039

The script disables all computers managed by a user. You can use it as a part of the user deprovisioning process. For information onhow to add it to the built-in Deprovision Custom Command, see Configure User Deprovisioning.

To use it as a part of a Business Rule, Scheduled Task, or Custom Command, you need to add the Run a program or PowerShell script action that executes the script.
Note: The script uses cmdlets from Adaxes PowerShell module for Active Directory. To run it, you need to install the PowerShell Module for Active Directory component of Adaxes.
Edit Remove
PowerShell
Import-Module Adaxes

$computers = Get-AdmComputer -LdapFilter "(managedBy=%distinguishedName%)"
    
if ($computers -eq $NULL)
{
    return
}

$computers | Disable-AdmAccount



Comments ( 0 )
No results found.
Leave a comment