Solved

create new user and mailbox process

Posted on 2008-10-09
6
829 Views
Last Modified: 2012-06-27
I have a win2008 DC and a Exchange 2007 server. When I create new users I want to use as simple steps as possible, so is it recommended to create the user in AD first, then create the mailbox through ESM. Or can I use a single 'new-mailbox' command that will add all my desired info into the new account. If so how do I add (script) values of 'profile path' 'logon script' etc?

If I have to run two separate scripts (one for AD and one for mailbox) is there some kind of replication interval between being able to run the two scripts.
0
Comment
Question by:Pete
[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
  • 2
6 Comments
 
LVL 7

Expert Comment

by:flaphead_com
ID: 22677228
if you use the new-mailbox powershell command you can create an ad user account at the same time
$user     = Read-Host "Enter Username.."
$password = Read-Host "Enter Password.." -AsSecureString
$OU       = Read-Host "Enter OU........"
 
$database = "<Change this to the database path>"
$ExternalEmailAddress = $user + "@<your domain>"
$txtfile = $user + ".txt"
new-mailbox -database $database -password $password -UserPrincipalName $ExternalEmailAddress -Name $user -OrganizationalUnit $OU
get-mailbox $user 

Open in new window

0
 
LVL 1

Author Comment

by:Pete
ID: 22677235
thanks:
If so how do I add (script) values of 'profile path' 'logon script' etc into the new account?
0
 
LVL 7

Expert Comment

by:flaphead_com
ID: 22677608
check out powergui (http://www.powergui.org/index.jspa) it's an addin to Powershell that lets you do more with the AD than the standard Exchange commands. All new-mailbox or even new-user will do is create a basic user.

Touching on something you mentioned before .. if you use the -DomainController switch, this should make running commands after each other okay, as they will update the same DC?
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 1

Author Comment

by:Pete
ID: 22677861
Thanks I like the interface of powershell but I still can't see how to create my users, can you please clarrify the process for me? -
Currently (win2003, ex2003) a new user comes and sees me and I use ADUC on the DC to create them, copying another user from the same OU\groups ete, it prompts for new mailbox and the store to put the mailbox in and I say 'OK'....great! Easy!
So HOW do I create a new user on Win2008, Ex2007? I need to specify: name, alias, OU and group membership, "profile path", "logon script" values as well as all the usual email address and managed mailbox policies etc.
This all seems very complicated.
As an aside will deleting the user in AD also delete the mailbox when they leave?
0
 
LVL 7

Expert Comment

by:flaphead_com
ID: 22678244
ah okay ... new-mailbox and new-user is for exchange 2007

powergui and a command line too, and I think that will work with "normal" powershell

If your using exchange 2003, and powergui then yes it will leave the mail disconnected

Not really  played with powergui much, but do understand it should do what you want
0
 
LVL 7

Accepted Solution

by:
flaphead_com earned 250 total points
ID: 22678356
You are going to need the following to stuff with the AD:

http://www.microsoft.com/downloads/details.aspx?FamilyId=993c0bcf-3bcf-4009-be21-27e85e1857b1&displaylang=en

and active roles powershell add-in: http://www.quest.com/powershell/activeroles-server.aspx

Once you have installed them, you can either use powergui or ActiveRoles Management Shell for Active Directory.

Set-QADUser looks like your friend
Use this cmdlet to change or remove values of attributes of a user account in Active Directory.

The cmdlet takes a series of optional, attribute-specific parameters allowing you to make changes to user attributes in Active Directory. Thus, to modify the value of the 'givenName', 'sn', or 'l' attribute, you can use the -FirstName, -LastName, or -City parameter, respectively.

If a given attribute is referred to by both the ObjectAttributes array and an attribute-specific parameter, the ObjectAttributes setting has no effect on that attribute. The cmdlet sets the attribute to the value specified by the attribute-specific parameter.

The cmdlet has optional parameters that determine the server and the security context for the operation. Normally,the connection parameters could be omitted so far as a connection to a server is established prior to using the cmd let. In this case, the server and the security context are determined by the Connect-QADService cmdlet.

If you do not use Connect-QADService and have no connection established prior to using a cmdlet, then the connection settings, including the server and the security context, are determined by the connection parameters of the first cmdlet you use. Subsequent cmdlets will use those settings by default.
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

Suggested Solutions

Title # Comments Views Activity
Distinguished username as email address 4 45
Save Exchange PowerShell Command 12 38
Auto BCC 8 27
exchange 2007, calendar 3 20
In-place Upgrading Dirsync to Azure AD Connect
A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
In this video we show how to create a Distribution Group 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 Recipients >>…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

730 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