Quantcast
Viewing all articles
Browse latest Browse all 20

Create a user via Powershell

New blog:

This tutorial will explain how you can create users via Powershell.

The first thing we need to do is start Exchange Management Shell, you will find it in the startmenu under  Microsoft Exchange Server 2007.

Image may be NSFW.
Clik here to view.
Powershell

As you can see above there are a few commands displayed for example a command is displayed to display the help functionality. There is also a nice joke build in the Exchange 2007 Powershell, when you type in get-exblog it opens Internet Explorer with the Exchange 2007 Community.

The next step is the command we will need to create the user, it will look something like the following:

New-Mailbox –alias <alias> -name <name> -Database <Database name> -OrganizationalUnit Users –UserPrincipalName <UPN value, example: johan@test.local>

When you execute this command there are a few parameters which are needed:

  • alias
  • name
  • database
  • organizationalunit
  • userprincipalname

Below an example, this command will create a user johan with an UPN johan@test.local  in the OU utrecht in the database mailbox store.

Image may be NSFW.
Clik here to view.
User aanmaken

When you execute the command there is one thing missing, the password, Powershell will ask you for it.

Image may be NSFW.
Clik here to view.
Wachtwoord invoeren

When you typed in a password the user will be created and the the result will be like the screen below:

Image may be NSFW.
Clik here to view.
De gebruiker is aangemaakt

Of course there are more possibilities, the user we just created doesn’t get assigned managed folders. By adding the parameter -ManagedFolderMailboxPolicy <name policy> the user will be assigned this policy and will get managed folders. There are a few other parameters:

  • ActiveSyncMailboxPolicy
  • ResetPasswordOnNextLogon
  • WhatIf

Especially the last command is interesting if you are not sure what you are doing. This parameter will execute the command but not for real. The result will be displayed after it did the test run, if the result is OK you can remove the WhatIf and run it for real.

The post Create a user via Powershell appeared first on Johan's Web Portal.


Viewing all articles
Browse latest Browse all 20

Trending Articles