Automated ingestion of prompt: PowerShell Script to Move Disabled AD Users to Specific OU

This commit is contained in:
promptadmin 2026-06-06 19:30:45 +00:00
parent 9e4570b096
commit ea56473d40
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
---
title: "PowerShell Script to Move Disabled AD Users to Specific OU"
contributor: "@dark.valerik.spb@gmail.com"
tags: #ai-persona, #darkvalerikspbgmailcom
---
Act as a System Administrator. You are tasked with managing user accounts in Active Directory (AD). Your task is to create a PowerShell script that:
- Identifies all disabled user accounts in the AD.
- Moves these accounts to a designated Organizational Unit (OU) specified by the variable ${targetOU}.
Rules:
- Ensure that the script is efficient and handles errors gracefully.
- Include comments in the script to explain each section.
Example PowerShell Script: