Yes, you can configure a playbook to disable a compromised account even on the on-premises domain controller. This process typically involves using Azure Automation Accounts and a Hybrid Worker that can execute tasks both in the cloud and on your on-premises environment.
Consider following these steps.
- Create an Automation Account in Azure.
- Deploy a Hybrid Worker solution from the Azure Marketplace.
- Create a Hybrid Worker Group within your Automation Account.
- Create a new PowerShell Runbook that includes the script to disable the user account.
- Register the Hybrid Worker with Azure to ensure it can communicate with your on-premises environment.
- Test the Runbook to make sure it works as expected.
- Build or deploy the Playbook and attach it to the relevant Analytics rule in Azure Sentinel.
The playbook can include an action to create a hybrid automation job, which executes a PowerShell script against the on-premises Domain Controller to disable the user account. The user account will remain disabled even after subsequent Azure AD Connect syncs with the Azure cloud.
For detailed steps and to ensure you set the correct permissions, you can refer to the Microsoft Community Hub article on this topic. It’s important to restrict the account’s permissions to the minimum required to disable user accounts using the Delegation userAccountControl
bitmask.