Solved

Creating Computers with Powershell

Posted on 2013-01-23
3
190 Views
Last Modified: 2013-01-24
I am wanting to create computers in AD automatically by prompting the user for a prefix, a starting number, and how many new computer to create.

How can I do this?
0
Comment
Question by:Joseph Moody
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 40

Expert Comment

by:Subsun
ID: 38811801
Are you talking about creating computer accounts in AD? Can you give an example on how you want to do it?

In PowerShell you can use New-ADComputer command to create computer accounts..
http://ss64.com/ps/new-adcomputer.html
0
 
LVL 40

Accepted Solution

by:
footech earned 500 total points
ID: 38814104
Import-Module ActiveDirectory
$prefix = Read-Host "Enter prefix"
try { [int]$startnumber = Read-Host "What's the starting number?" -ea "Stop"}
catch {"Need to enter a number"; break}
try { [int]$number = Read-Host "How many computer accounts do you want to create?" -ea "Stop"}
catch {"Need to enter a number"; break}
ForEach ($i in ($startnumber..($startnumber + $number -1)))
{
  $compName = $prefix + $i
  New-ADComputer -name $compName
}

Open in new window

0
 
LVL 22

Author Closing Comment

by:Joseph Moody
ID: 38815838
Genius!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A procedure for exporting installed hotfix details of remote computers using powershell
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question