forked from timmcmic/DLConversionV2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenable-ExchangeOnPremEntireForest.ps1
More file actions
41 lines (28 loc) · 1.25 KB
/
enable-ExchangeOnPremEntireForest.ps1
File metadata and controls
41 lines (28 loc) · 1.25 KB
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
<#
.SYNOPSIS
This function ensures that view entire forest is set to TRUE for exchange on premsies connections.
.DESCRIPTION
This function ensures that view entire forest is set to TRUE for exchange on premsies connections.
.OUTPUTS
None
.EXAMPLE
enable-ExchangeOnPremEntireForest
#>
Function enable-ExchangeOnPremEntireForest
{
#Declare function variables.
#Start function processing.
Out-LogFile -string "********************************************************************************"
Out-LogFile -string "BEGIN enable-ExchangeOnPremEntireForest"
Out-LogFile -string "********************************************************************************"
try {
out-logfile -string "Attempting to set view entire forest = TRUE."
Set-ADServerSettings -ViewEntireForest:$TRUE -ErrorAction STOP
}
catch {
out-logfile -string "Unable to set the entire forest settings to true."
out-logfile -string $_ -isError:$TRUE
}
Out-LogFile -string "END enable-ExchangeOnPremEntireForest"
Out-LogFile -string "********************************************************************************"
}