forked from timmcmic/DLConversionV2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Invoke-Office365SafetyCheck.ps1
59 lines (43 loc) · 1.71 KB
/
Invoke-Office365SafetyCheck.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<#
.SYNOPSIS
This function confirms that the distribution list specified and found in Office 365 is DirSynced=TRUE
.DESCRIPTION
This function confirms that the distribution list specified and found in Office 365 is DirSynced=TRUE
.PARAMETER O365DLConfiguration
The DL configuration obtained by the service.
.OUTPUTS
No returns.
.EXAMPLE
invoke-office365safetycheck -o365dlconfiguration o365dlconfiguration
#>
Function Invoke-Office365SafetyCheck
{
[cmdletbinding()]
Param
(
[Parameter(Mandatory = $true)]
$o365dlconfiguration
)
Out-LogFile -string "********************************************************************************"
Out-LogFile -string "BEGIN INVOKE-OFFICE365SAFETYCHECK"
Out-LogFile -string "********************************************************************************"
#Comapre the isDirSync attribute.
try
{
Out-LogFile -string ("Distribution list isDirSynced = "+$o365dlconfiguration.isDirSynced)
if ($o365dlconfiguration.isDirSynced -eq $FALSE)
{
Out-LogFile -string "The distribution list requested is not directory synced and cannot be migrated." -isError:$TRUE
}
else
{
Out-LogFile -string "The distribution list requested is directory synced."
}
}
catch
{
Out-LogFile -string $_ -isError:$TRUE
}
Out-LogFile -string "END INVOKE-OFFICE365SAFETYCHECK"
Out-LogFile -string "********************************************************************************"
}