Solved

create new user and mailbox process

Posted on 2008-10-09
6
825 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
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
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
In this video we show how to create a Shared Mailbox 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 >> Sha…
In this video we show how to create a Contact 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 >> Contact ta…

867 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

12 Experts available now in Live!

Get 1:1 Help Now