Partager via


Create a Mailbox for a User

 

Applies To: Windows Server 2012 Essentials

Creates a mailbox for a user by using the default profile.

URI Template

POST services/builtin/MailboxManagement.svc/mailbox/create?username={username}&email={email}

{username}
The name of a user.

{email}
The email address to create for the user.

Sample Request

POST https://www.contoso.com/services/builtin/MailboxManagement.svc/mailbox/create?username=user1&email=user1@microsoft.com HTTP/1.1  
Content-Type: application/xml  
Accept: application/xml  
Cookie: ASP.NET_SessionId=********************  
Canary: *********************  
Host: domainname  
Content-Length: 0  

Sample Response

On-Premises Exchange Server

HTTP/1.1 200 OK  
<ExchangeServerMailbox  
    xmlns="http://contracts.microsoft.com/WindowsServerEssentials/2011/09/WebApi"  
    xmlns:i="http://www.w3.org/2001/XMLSchema-instance">  
  <Email>auro@163.com</Email>  
  <UserName>AuroraUser</UserName>  
  <Quota>0</Quota>  
  <QuotaEnforced>false</QuotaEnforced>  
</ExchangeServerMailbox>  

Microsoft Office 365

HTTP/1.1 200 OK  
<Office365Mailbox  
    xmlns="http://contracts.microsoft.com/WindowsServerEssentials/2011/09/WebApi"  
    xmlns:i="http://www.w3.org/2001/XMLSchema-instance">  
  <Email>tonytian@tt2000.onmicrosoft.com</Email>  
  <UserName>AuroraUser</UserName>  
  <Activated>true</Activated>  
</Office365Mailbox>  

Error Codes

Error Code Error Message
400 One or more parameters are not valid.
404 The path does not exist.
409 A conflict prevented the request from being processed (for example, if mailbox already exists with the requested email address).
500 An internal server error occurred.

See Also

Web Service Methods