[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

need a quest AD cmdlets or posh script to create bulk "mail enabled" users

Posted on 2013-11-20
4
Medium Priority
?
566 Views
Last Modified: 2014-03-29
can someone provide a quest AD cmdlets script to create bulk mail enabled users from an input CSV?

[not mailbox enabled]

many thanks

S.
0
Comment
Question by:siber1
[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
4 Comments
 
LVL 53

Assisted Solution

by:Will Szymkowski
Will Szymkowski earned 1000 total points
ID: 39664830
I am assuming that you want to create "new" mail users. If so use the powershell command below to accomplish this...

You need to construct your CSV file like the below example for this to work properly...

Name        ExternalEmailAddress   UserPrincipalName    sAMAccountName  Password
Jon Smith  jsmith@abc.com            jsmith@domain.com  jsmith                       P@ssworD
Mac Lin     Mlin@abc.com               mlin@domain.com     mlin                           P@ssworD
etc.....

$UserList = import-csv "c:\yourCSVhere"
foreach ($User in $UserList) {
$User.Name
$User.ExternalEmailAddress
$User.UserPrincipalName
$User.sAMAccountName
$User.Password
New-MailUser -Name $User.Name -ExternalEmailAddress $User.ExternalEmailAddress -UserPrincipalName $User.UserPrincipalName -sAMAccountName $User.sAMAccountName -Password $User.Password -AsSecureString
}

Open in new window


Will.
0
 
LVL 40

Accepted Solution

by:
Subsun earned 1000 total points
ID: 39665881
Try this..

You need to run the code from Exchange Management Shell..
$password = convertto-securestring "p@ssw0rd" -asplaintext -force
Import-Csv C:\Test.csv | % {
New-MailUser `
	-Name "$($_.LastName) $($_.FirstName)" `
	-FirstName $_.FirstName `
	-LastName $_.LastName `
	-DisplayName "$($_.LastName) $($_.FirstName)" `
	-Password $password `
	-ExternalEmailAddress $_.Email `
	-UserPrincipalName "$($_.Account)@testdomain.com" `
	-OrganizationalUnit "Testdomain.com/mailenabled"
}

Open in new window

Sample C:\Test.csv file..
FirstName,LastName,Account,Email
Test,User,TUser,Tuser@Test.com
Test1,User1,TUser1,Tuser1@Test.com

Open in new window

0
 

Author Closing Comment

by:siber1
ID: 39666233
thanks Subsun / Spec01 both solutions work great.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

How to deal with a specific error when using the Enable-RemoteMailbox cmdlet to create a mailbox in the cloud-based service, for an existing user in an on-premises Active Directory.
If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

656 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