We use cookies to improve your experience.
By your continued use of this site you accept such use.
For more details please see our privacy policy and cookies policy.

Script Repository

Disable all computers managed by a user

February 18, 2021 Views: 2185

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
Leave a comment
Loading...

Got questions?

Support Questions & Answers