Solved

Powershell: Exchange 2010

Posted on 2013-12-05
4
137 Views
Last Modified: 2014-05-01
I have been using powershell to create AD Users and Mailboxes, similar to below:

New-MailUser -Name Bob -FirstName Bob -LastName Smith -ExternalEmailAddress
bsmith@myco.com -UserPrincipalName bob@myco.com
-OrganizationalUnit myco.com

Am I able to take it one step further and add to multiple security groups / distribution lists as well?  If so, could you provide a quick example?

Thanks
0
Comment
Question by:trecool
[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 35

Expert Comment

by:Joseph Daly
ID: 39699276
To add a user to the dirstribution group you would use a command line the one below.

Add-DistributionGroupMember -Identity "Group Name" -Member bob@myco.com
0
 

Author Comment

by:trecool
ID: 39699305
can you append it to the original command?
0
 
LVL 35

Expert Comment

by:Joseph Daly
ID: 39699392
You cant really append it to the first command because it is a seperate action. You need to create the user account before it can be added to any groups.
0
 
LVL 37

Accepted Solution

by:
Mahesh earned 500 total points
ID: 39699418
You can just make copy of existing user having same group membership from active directory and then create mailbox either from shell or EMC
It is the easiest way if user needs to be part of bunch of groups

Mahesh
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

This article explains how to install and use the NTBackup utility that comes with Windows Server.
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

728 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