search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Creating a new mailbox with Powershell function on Exchange Server 2010
Posted in Exchange Server, Windows Powershell | 1 Comment | 13,981 views | 29/11/2009 21:01

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”.


Comments (1)

» Hosted Exchange 2010 SP1 JohanPersson.nu

October 8th, 2011
11:45:54

[…] http://www.zerohoursleep.com/2010/10/step-by-step-starting-with-exchange-2010-sp1-multi-tenant-installation/http://www.zerohoursleep.com/2010/10/step-by-step-starting-with-exchange-2010-sp1-multi-tenant-create-and-delete-organizations/http://www.zerohoursleep.com/2010/10/step-by-step-starting-with-exchange-2010-sp1-multi-tenant-manage-your-organizations/http://www.zerohoursleep.com/2010/10/step-by-step-starting-with-exchange-2010-sp1-multi-tenant-sending-and-receiving-emails/http://www.yusufozturk.info/exchange-server/creating-a-new-mailbox-with-powershell-function-on-exchahttp://www.yusufozturk.info/exchange-server/creating-a-new-mailbox-with-powershell-function-on-excha… &laquo iSCSI Target i “Windows Server 8” […]



Leave a Reply