تخطَّ إلى المحتوى

PowerShell Script to Move Disabled AD Users to Specific OU

This prompt provides a PowerShell script to identify disabled user accounts in Active Directory and move them to a specified Organizational Unit (OU).

المحتوى

جهّز البرومبت لشغلك

أضف بياناتك في الخانات، ثم راجع نص البرومبت قبل استخدامه.

نص البرومبت بعد التخصيص

هذا هو النص الذي ستنسخه أو تستخدمه. يتغيّر مباشرة مع بياناتك.

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: ``` # Define the target OU $targetOU = "OU=DisabledUsers,DC=yourdomain,DC=com" # Get all disabled user accounts $disabledUsers = Get-ADUser -Filter {Enabled -eq $false} # Move each disabled user to the target OU foreach ($user in $disabledUsers) { try { Move-ADObject -Identity $user.DistinguishedName -TargetPath $targetOU Write-Host "Moved: $($user.SamAccountName) to $targetOU" } catch { Write-Host "Failed to move $($user.SamAccountName): $_" } } ``` Variables: - targetOU - The distinguished name of the target Organizational Unit where disabled users will be moved.

برومبتات ذات صلة

AI builder

نص

This AI builder will create a fully functional website based on the provided details the website will be ready to publish or deploy

H@community
0

Developer Daily Report Generator

نص

Generate a daily report template for developers to document their daily tasks, achievements, challenges, and plans for the next day.

H@community
0

AI Workflow Automation Specialist

نص

Act as an AI Workflow Automation Specialist, guiding users in automating business processes, optimizing workflows, and integrating AI tools effectively.

H@community
0

PowerShell Script for Managing Disabled AD Users

نص

This prompt provides a PowerShell script to identify all disabled user accounts in Active Directory and move them to a specified Organizational Unit (OU).

H@community
0

自动写作、图片生成与发布工具

نص

该提示帮助用户自动生成文本内容、创建相关图片并发布到指定平台。

H@community
0

Shift Tracking Telegram Mini App

نص

Develop a Telegram Mini App for internal use by company employees to track shift times and view shift schedules seamlessly integrated with Telegram.

H@community
0

UiPath XAML Code Review Specialist

نص

Act as a specialist in reviewing UiPath XAML files for errors and improvements. Provide solutions for detected issues without making any code changes until instructed.

H@community
0

Node.js Automation Script Developer

نص

Guide a user in creating automated scripts using Node.js for various tasks like file manipulation, web scraping, and API interactions.

H@community
0

Reply-Focused Cold Email Builder

نص

Designed for freelancers, consultants, founders, and outbound sales teams who need concise cold emails that sound credible instead of automated. This prompt generates complete outreach emails with a subject line, natural opener, value framing, and low-friction CTA. The structure is optimized for reply likelihood rather than aggressive selling. Outputs are short, professional, and ready to send without editing.

H@community
0

Paladin Octem Plus (Research Swarm)

نص

Enhanced Competitive Research Swarm

H@community
0

Readability Logic Simulator - 全功能翻译版

نص

MASTER PROMPT DESIGN FRAMEWORK - LYRA EDITION (V1.9.3 - Final)

H@community
0

Excel Formula Sensei

نص

—

H@community
0

التعليقات