简体   繁体   中英

Create a mailbox in Exchange 2010 c#

First of all I apologize for my bad english.

I want to create mailbox users in Exchange 2010. As I always said search can be done with PowerShell. Is there another way out of PowerShell Remoting?

I think I understand what your asking, do correct me if I'm wrong.

You want to remote to an exchange server and then create a mailbox?

Connect to exchange using the following, quite simple but you can do more with it.

function Connect-MSExchSession
{
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true, Position = 0)]
        [string]$Server
    )

    $URI = 'http://' + $Server + '/powershell'
    $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri $URI
    Import-Module (Import-PSSession $session -AllowClobber) -Global
}

Once connected it should just be a case of issuing the cmdlet New-Mailbox along with the require attributes, if its a new mailbox for an existing user then it would be Enable-Mailbox

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM