看到了一篇好文章,转了过了,做了些简单的翻译。
如果你部署的Exchange环境中的负载均衡或防火墙不能处理动态的RPC端口,那么你将要在CAS服务器上给RPC客户端连接服务和地址薄服务定义静态端口。如果你使用了公共文件夹,你还得在Mailbox服务器上定义公共文件夹端口。我常用的端口是:
RPC客户端连接服务:TCP 60000
地址薄服务:TCP 60001
RPC客户端连接(公共文件夹):60002
对于前面两个,我已以下面的脚本中做好了快速设置端口的工作,只需要在CAS服务器上运行即可,当然,针对自己的情况得做些必要的修改。
If you are deploying Exchange in an environment with load balancers or firewalls which aren’t able to handle dynamic RPC port ranges, chances are you’ll be defining static ports for the RPC Client Access Service and the Address Book Service on each CAS server. If you’re using Public Folders, you’ll want a third static port on the Mailbox servers hosting Public Folders. I typically use these ports for this:
RPC Client Access Service – TCP 60,000
Address Book Service – TCP 60,001
RPC Client Access (Public Folders) – TCP 60,002
For the first two, I’ve included a script below which makes quick work of setting the ports. Just run it on the CAS server to make the required changes.
以下为脚本:
param([int32]$MAPIPort = 60000, [int32]$AddressBookPort = 60001, [bool]$RestartServices = $true)
# ==============================================================================================
# NAME: Configure Exchange Static Ports
#
# AUTHOR: Brian Desmond, brian@briandesmond.com
# DATE : 4/9/2012
#
# COMMENT:
#
# ==============================================================================================
Set-PSDebug -Strict:$true
function CheckProcessElevation()
{
$identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$principal = New-Object System.Security.Principal.WindowsPrincipal($identity)
return $principal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)
}
function CreateRegistryKeyIfNecessary([string]$path)
{
if (Test-Path -Path $path)
{
return
}
else
{
[void](New-Item -Path $path)
}
}
Function Test-RegistryValue($regkey, $name)
{
Get-ItemProperty $regkey $name -ErrorAction SilentlyContinue | Out-Null
$?
}
function CreateOrUpdateRegistryValue([string]$path, [string]$valueName, [Microsoft.Win32.RegistryValueKind]$valueType, $value)
{
if ((Test-Path -Path $path) -ne $true)
{
CreateRegistryKeyIfNecessary $path
}
if ((Test-RegistryValue $path $valueName) -eq $false)
{
[void](New-ItemProperty -Path $path -Name $valueName -PropertyType $valueType -Value $value)
}
else
{
[void](Set-ItemProperty -Path $path -Name $valueName -Value $value)
}
}
if ((CheckProcessElevation) -eq $false)
{
Write-Warning "Script must be run from an elevated prompt. Exiting..."
exit 1
}
$domtParamsPath = "HKLM:\System\CurrentControlSet\Services\MSExchangeAB\Parameters"
$momtParamsPath = "HKLM:\System\CurrentControlSet\Services\MSExchangeRPC\ParametersSystem"
Write-Host "Setting Address Book Service Port to $($AddressBookPort)"
CreateOrUpdateRegistryValue $domtParamsPath "RpcTcpPort" "String" $AddressBookPort.ToString()
Write-Host "Setting RPC Client Access Port to $($MAPIPort)"
CreateOrUpdateRegistryValue $momtParamsPath "TCP/IP Port" "DWord" $MAPIPort
if ($RestartServices)
{
Write-Host "Restarting Services..."
Restart-Service -Name "MSExchangeAB" -Confirm:$false
Restart-Service -Name "MSExchangeRPC" -Confirm:$false
}
Write-Host "Complete." -ForegroundColor Green
如果正在寻找定义公共文件夹连接的端口,除了上面的脚本,还可以用以下的注册表修改来搞定。
If you’re looking to restrict the port used for Public Folder access, you’ll need to do this in addition to the script above. The registry setting you want is below:
Key: “HKLM\System\CurrentControlSet\Services\MSExchangeRPC\ParametersSystem”
Value Name: "TCP/IP Port”
Value Type: REG_DWORD
Value Data: “60002” (decimal)
原文地址:Setting Static Ports for Exchange Client Access