powershell remoting -在exchange2010 c#中创建邮箱
本文关键字:创建 exchange2010 remoting powershell | 更新日期: 2023-09-27 18:02:20
首先我为我糟糕的英语道歉。
我想在Exchange 2010中创建邮箱用户。正如我一直说的,搜索可以用PowerShell完成。有没有其他方法可以摆脱PowerShell Remoting?
我想我明白你的要求,如果我错了请纠正我。
要远程到交换服务器然后创建邮箱吗?
使用下面的连接到exchange,非常简单,但您可以使用它做更多的事情。
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
}
一旦连接,它应该只是发出cmdlet New-Mailbox
以及require属性的情况,如果它是现有用户的新邮箱,那么它将是Enable-Mailbox