PowerShell bulk Disable the specified user and move the disabled user to the specified OU

Source: Internet
Author: User

As an enterprise administrator, the daily most basic task is to delete and create the daily users; also we know that the Microsoft system with dsquery commands can help us solve the problem of user, computer bulk query, delete, disable and move to have good help, but if you want to specify user disable and delete can also be achieved, But it's a lot of trouble, is there a better way, certainly has ah, that is the script, but seems to say that the batch two words everybody must think of is the script, generally is uses the foot to realize the batch to use, today is for everybody to explain how to bulk disable the specified user and will disable the user to move to the specified OU

Environment Introduction:

Domain name:gawain.com

Operation:

First, create a user on ad and create a specified OU that disables the move of the user

User: Zhangsan, Lisi

Ou:disableusers

2. Install the active Directort module for Windows PowerShell

3. After installation, open the script file:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.