How do I filter out only the SMTP address? I want to report only on users with domain name @mydomain.com
. All other domain names would be excluded. I'm attempting to run a report that would exclude certain SIP/SMTP addresses based off of the user's domain.
$CheckUser = Get-CsUser -Filter {SipAddress -eq $SIP}
$s = 0
While ($CheckUser -eq $null) {
$CheckUser = Get-CsUser -Filter {SipAddress -eq $SIP}
$s++
If ($s -eq 2000) {
$Date = Get-Date –f "MM/dd/yyyy HH:mm:ss"
"[$Date] User $EUID did not complete OCS configuration"
$ProcessedDateandTime = Get-Date
$ProcessedDate = $ProcessedDateandTime.ToShortDateString()
$ProcessedTime = $ProcessedDateandTime.ToShortTimeString()
$ErrorCode = "12"
Add-Content $ProcessedFileName "$ProcessedDate,$ProcessedTime,$EUID,Mailbox Created but OCS Timed Out.,$ErrorCode"
Add-Content $ErrorLog "$ProcessedDate,$ProcessedTime,$EUID,Mailbox Created but OCS Timed Out."
$FailureCount++
Break
}
}