-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-CloudContactPresent.ps1
63 lines (43 loc) · 1.73 KB
/
test-CloudContactPresent.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
60
61
62
63
<#
.SYNOPSIS
This function loops until we detect that the cloud contact is no longer present.
.DESCRIPTION
This function loops until we detect that the cloud contact is no longer present.
.PARAMETER contactSMTPAddress
The SMTP Address of the contact.
.OUTPUTS
None
.EXAMPLE
test-CloudcontactPresent -contactSMTPAddress SMTPAddress
#>
Function test-CloudcontactPresent
{
[cmdletbinding()]
Param
(
[Parameter(Mandatory = $true)]
[string]$contactSMTPAddress
)
#Declare function variables.
[boolean]$firstLoopProcessing=$TRUE
#Start function processing.
Out-LogFile -string "********************************************************************************"
Out-LogFile -string "BEGIN TEST-CLOUDcontactPRESENT"
Out-LogFile -string "********************************************************************************"
#Log the parameters and variables for the function.
out-Logfile -string ("contact SMTP Address = "+$contactSMTPAddress)
do
{
if ($firstLoopProcessing -eq $TRUE)
{
Out-LogFile -string "First time checking for contact - do not sleep."
$firstLoopProcessing = $FALSE
}
else
{
start-sleepProgress -sleepString "contact found in Office 365 - sleep for 30 seconds - try again." -sleepSeconds 30
}
} while (get-exoRecipient -identity $contactSMTPAddress)
Out-LogFile -string "END TEST-CLOUDcontactPRESENT"
Out-LogFile -string "********************************************************************************"
}