-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathImport-EdgeSubscription.ps1
46 lines (32 loc) · 1.91 KB
/
Import-EdgeSubscription.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<#
.SYNOPSIS
This script imports an Edge Subscription file for a specific Active Directory site.
Thomas Stensitzki
THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE
RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.
Version 1.0, 2024-02-15
Please send ideas, comments and suggestions to [email protected]
.LINK
https://scripts.granikos.eu
.DESCRIPTION
The script takes two parameters: the path to the Edge Subscription file and the name of the Active Directory site.
It then imports the Edge Subscription file for the specified Active Directory site and does not create an Internet send connector.
This script is primarily used for hybrid Exchange deployments where a different internet send connector already exists.
.PARAMETER edgeSubscriptionFile
The full path to the Edge Subscription file.
.PARAMETER activeDirectorySite
The name of the Active Directory site for subscribign the Edge Transport Server to.
.EXAMPLE
.\Import-EdgeSubscription.ps1 -edgeSubscriptionFile "C:\Import\EdgeSubscription.xml" -activeDirectorySite "ADSiteName"
#>
param(
[string]$edgeSubscriptionFile = "C:\Import\EdgeSubscription.xml",
[string]$activeDirectorySite = "ADSiteName"
)
Import-EdgeSubscription -FileData ([byte[]]$(Get-Content -Path $edgeSubscriptionFile -Encoding Byte -ReadCount 0)) -Site $activeDirectorySite -CreateInternetSendConnector $false
Write-Output @(
('Imported Edge Subscription from {0} for Active Directory site {1}' -f $edgeSubscriptionFile, $activeDirectorySite),
'One of the Exchange Servers in the Active Directory site will use the imported BootStrap account to initiate the Edge Subscription process.',
'Use Test-EdgeSynchronization to verify that Exchange mailbox servers communicate with subscribed Edge Transport Server.',
'More information: https://learn.microsoft.com/powershell/module/exchange/test-edgesynchronization?view=exchange-ps'
)