magnify
Home Exchange Server Creating a new mailbox with Powershell function on Exchange Server 2010
formats

Creating a new mailbox with Powershell function on Exchange Server 2010

Tarih 29 Kasım 2009 yazar içinde Exchange Server, Haber

I wrote a function for Hosted Exchange 2010 to create a new mailbox on Exchange Server 2010.

1
2
3
4
5
6
7
function Add-MailUser
{
Param ($UserID, $FirstName, $LastName, $CustomerOU)
    $ADDomain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
    $ADDomainName = $ADDomain.Name
    Enable-Mailbox -Identity "$ADDomainName/$CustomerOU/$FirstName $LastName" -Alias "$UserID"
}

Usage of function:

Add-MailUser –UserID “2452” –FirstName “Yusuf” –LastName “Ozturk” -CustomerOU “Users”

I used System.Directory.Services to get Active Directory domain. Lets see how does it work:

dservices

CustomerOU is the base of your user container. Just type your OU name like “Exchange” or “Users”.

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
Creating a new mailbox with Powershell function on Exchange Server 2010 için yorumlar kapalı  comments 
© Hakan Uzuner
credit