Solved

Using a script to created AD account in Window server 2008

Posted on 2013-05-12
4
466 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
  • 2
4 Comments
 
LVL 13

Expert Comment

by:imkottees
Comment Utility
0
 
LVL 10

Accepted Solution

by:
Prashant Girennavar earned 300 total points
Comment Utility
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
Comment Utility
THis worked great!  Thank you so much.
0
 
LVL 10

Expert Comment

by:Prashant Girennavar
Comment Utility
No Problems.

Glad that it was useful for you.

Thanks,

-Prashant Girennavar.
0

Featured Post

Want to promote your upcoming event?

Is your company attending an event or exhibiting at a trade show soon? Are you speaking at a conference? Spread the word by using a promotional banner in your email signature. This will ensure your organization’s most important contacts are in the know.

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now