Ps ad command series-new-adcomputer command !, Adnew-adcomputer

Source: Internet
Author: User

Ps ad command series-new-adcomputer command !, Adnew-adcomputer

New-adcomputer and new-aduser are mainly different objects. Adcomputer is the computer object in the Active Directory, and aduser is the user.

There are relatively few computer objects. When we create a computer object, there is no need for more attribute settings, so it is very easy to create.

Let's start with a simple scenario, that is, to create an object named xupengComputer1 under OU named IT. We can execute the following command to create IT:

New-adcomputer-name xupengcomputer1-path "ou = it, dc = pilot, dc = com"

 

The batch creation of computers that belong to our rule-making systems adopts the following method. For example, we create three objects under IT and four computers under ad, for the four computers under caiwu, the computer name does not have the rule feature. We need to create a corresponding computer name file and edit it in the following format:

Name, path

Raymondpc, it

Xupfeipc, ad

Yapinpc, caiwu

Xypc, ad

Xxpc, ad

 

We compile the following script:

$Computerlist=import-csvcomputer.csv

Foreach ($ computerin $ computerlist)

{

$ Ou = "ou =" + $ computer. path + ", dc = pilot, dc = com ";

New-adcomputer-name $ computer. name-path $ ou;

}

In this way, we can import a specific computer to our active directory.

Of course, creating an Active Directory computer has specific scenarios. For example, we do not want all the computers that we add to the domain to be in the computers container. You can use this method to pre-create the computers. When they are added to the domain, they are automatically created in the OU we created.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.