Solved

create new user and mailbox process

Posted on 2008-10-09
6
824 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
  • 4
  • 2
6 Comments
 
LVL 7

Expert Comment

by:flaphead_com
Comment Utility
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
Comment Utility
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
Comment Utility
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 1

Author Comment

by:Pete
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
In this video we show how to create an email address policy 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 Mail Flow…
To show how to create a transport rule 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 Mail Flow >> Rules tab.:  To cr…

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

15 Experts available now in Live!

Get 1:1 Help Now