?
Solved

Using a script to created AD account in Window server 2008

Posted on 2013-05-12
4
Medium Priority
?
479 Views
Last Modified: 2013-05-17
Hello Everyone,

I need to setup a non IT user to create new accounts in a windows 2008 domain.  They will need to create two accounts for each user.  I am looking to streamline this as much as posslbie.  Does anyone know of a script that will prompt you to enter a username, password, and then create the user?

Thanks,

Bill
0
Comment
Question by:bjennings
[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
  • 2
4 Comments
 
LVL 13

Expert Comment

by:imkottees
ID: 39160255
0
 
LVL 10

Accepted Solution

by:
Prashant Girennavar earned 1200 total points
ID: 39160382
import-module activedirectory
$SamAccountName = Read-Host "Enter Logon Name"
$Password = Read-host "Enter the Password"
$FirstName = Read-Host "Enter First Name of the User account"
$LastName = Read-host "Enter Last Name of the User account"
$UserPrincipalName = $Samaccountname + "@contoso.COM"
New-ADUser -SamAccountName $SamAccountName -UserPrincipalName $UserPrincipalName -Givenname $FirstName -Name $FirstName -SurName $LastName -AccountPassword (ConvertTo-SecureString $Password -AsPlainText -force) -Enabled $True -ChangePasswordAtLogon $True -PassThru

Open in new window


This script will prompt for each attribute , Please test it  and use it. (Make sure you run this script on a system which is a domain contorller or which has RSAT Installed in it)

Other resource you can refer.

http://gallery.technet.microsoft.com/scriptcenter/PowerShell-Create-Active-7e6a3978
http://serverfault.com/questions/60992/how-to-create-active-directory-user-account-with-powershell

Thanks,

-Prashant Girennavar
0
 

Author Closing Comment

by:bjennings
ID: 39174876
THis worked great!  Thank you so much.
0
 
LVL 10

Expert Comment

by:Prashant Girennavar
ID: 39175008
No Problems.

Glad that it was useful for you.

Thanks,

-Prashant Girennavar.
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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Suggested Courses
Course of the Month12 days, 22 hours left to enroll

777 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