diff --git a/Admin/MonitorExchangeAuthCertificate/DataCollection/Get-ExchangeAuthCertificateStatus.ps1 b/Admin/MonitorExchangeAuthCertificate/DataCollection/Get-ExchangeAuthCertificateStatus.ps1 index d6e5e9ffcf..0ebc1a2242 100644 --- a/Admin/MonitorExchangeAuthCertificate/DataCollection/Get-ExchangeAuthCertificateStatus.ps1 +++ b/Admin/MonitorExchangeAuthCertificate/DataCollection/Get-ExchangeAuthCertificateStatus.ps1 @@ -47,7 +47,7 @@ function Get-ExchangeAuthCertificateStatus { $allMailboxServers = Get-ExchangeServer | Where-Object { ((($_.IsMailboxServer) -or ($_.IsClientAccessServer)) -and - ($_.AdminDisplayVersion -Match "^Version 15")) + ($_.AdminDisplayVersion -match "^Version 15")) } $multipleExchangeSites = (($allMailboxServers.Site.Name | Sort-Object -Unique).Count -gt 1) diff --git a/Admin/MonitorExchangeAuthCertificate/DataCollection/Test-IsServerValidForAuthCertificateGeneration.ps1 b/Admin/MonitorExchangeAuthCertificate/DataCollection/Test-IsServerValidForAuthCertificateGeneration.ps1 index 26504ad61a..0c6486472c 100644 --- a/Admin/MonitorExchangeAuthCertificate/DataCollection/Test-IsServerValidForAuthCertificateGeneration.ps1 +++ b/Admin/MonitorExchangeAuthCertificate/DataCollection/Test-IsServerValidForAuthCertificateGeneration.ps1 @@ -22,7 +22,7 @@ function Test-IsServerValidForAuthCertificateGeneration { $exchangeServerDetails = Get-ExchangeServer -Identity $ComputerName -ErrorAction Stop if (($exchangeServerDetails.IsMailboxServer) -and - (($exchangeServerDetails.AdminDisplayVersion -Match "^Version 15"))) { + (($exchangeServerDetails.AdminDisplayVersion -match "^Version 15"))) { Write-Verbose ("Exchange Server role and version is VALID to renew the Auth Certificate") $isValid = $true } else { diff --git a/Calendar/Get-RBASummary.ps1 b/Calendar/Get-RBASummary.ps1 index c05c8d4d5d..dd1d470064 100644 --- a/Calendar/Get-RBASummary.ps1 +++ b/Calendar/Get-RBASummary.ps1 @@ -539,8 +539,8 @@ function RBALogSummary { $LastDate = "[Unknown]" if ($starts.count -gt 1) { - $LastDate = ($Starts[0] -Split ",")[0].Trim() - $FirstDate = ($starts[$($Starts.count) -1 ] -Split ",")[0].Trim() + $LastDate = ($Starts[0] -split ",")[0].Trim() + $FirstDate = ($starts[$($Starts.count) -1 ] -split ",")[0].Trim() Write-Host "`tThe RBA Log for [$Identity] shows the following:" Write-Host "`t $($starts.count) Processed events times between $FirstDate and $LastDate" } @@ -555,19 +555,19 @@ function RBALogSummary { $Cancellations = $RBALog | Select-String -Pattern "It's a meeting cancellation." if ($AcceptLogs.count -ne 0) { - $LastAccept = ($AcceptLogs[0] -Split ",")[0].Trim() + $LastAccept = ($AcceptLogs[0] -split ",")[0].Trim() Write-Host "`t $($AcceptLogs.count) were Accepted between $FirstDate and $LastDate" Write-Host "`t`t with the last meeting Accepted on $LastAccept" } if ($TentativeLogs.count -ne 0) { - $LastTentative = ($TentativeLogs[0] -Split ",")[0].Trim() + $LastTentative = ($TentativeLogs[0] -split ",")[0].Trim() Write-Host "`t $($TentativeLogs.count) Tentatively Accepted meetings between $FirstDate and $LastDate" Write-Host "`t`t with the last meeting Tentatively Accepted on $LastTentative" } if ($DeclineLogs.count -ne 0) { - $LastDecline = ($DeclineLogs[0] -Split ",")[0].Trim() + $LastDecline = ($DeclineLogs[0] -split ",")[0].Trim() Write-Host "`t $($DeclineLogs.count) Declined meetings between $FirstDate and $LastDate" Write-Host "`t`t with the last meeting Declined on $LastDecline" } @@ -577,7 +577,7 @@ function RBALogSummary { } if ($UpdatedLogs.count -ne 0) { - $LastUpdated = ($UpdatedLogs[0] -Split ",")[0].Trim() + $LastUpdated = ($UpdatedLogs[0] -split ",")[0].Trim() Write-Host "`t $($UpdatedLogs.count) Updates to meetings between $FirstDate and $LastDate" Write-Host "`t`t with the last meeting updated on $LastUpdated" } else { @@ -591,7 +591,7 @@ function RBALogSummary { } if ($DelegateReferrals.count -ne 0) { - $LastDelegateReferral = ($DelegateReferrals[0] -Split ",")[0].Trim() + $LastDelegateReferral = ($DelegateReferrals[0] -split ",")[0].Trim() Write-Host "`t $($DelegateReferrals.count) Delegate Referrals were sent between $FirstDate and $LastDate" Write-Host "`t`t with the last Delegate Referral sent on $LastDelegateReferral" } else { @@ -599,7 +599,7 @@ function RBALogSummary { } if ($NonMeetingRequests.count -ne 0) { - $LastNonMeetingRequest = ($NonMeetingRequests[0] -Split ",")[0].Trim() + $LastNonMeetingRequest = ($NonMeetingRequests[0] -split ",")[0].Trim() Write-Host "`t $($NonMeetingRequests.count) Non Meeting Requests were skipped between $FirstDate and $LastDate" Write-Host "`t`t with the last Non Meeting Request skipped on $LastNonMeetingRequest" } else { diff --git a/Diagnostics/HealthChecker/Features/Get-LoadBalancingReport.ps1 b/Diagnostics/HealthChecker/Features/Get-LoadBalancingReport.ps1 index 9ee1ae692d..20a046a315 100644 --- a/Diagnostics/HealthChecker/Features/Get-LoadBalancingReport.ps1 +++ b/Diagnostics/HealthChecker/Features/Get-LoadBalancingReport.ps1 @@ -13,18 +13,18 @@ function Get-LoadBalancingReport { Write-Grey("Site filtering ON. Only Exchange 2013+ CAS servers in {0} will be used in the report." -f $SiteName) $CASServers = $getExchangeServer | Where-Object { ($_.IsClientAccessServer -eq $true) -and - ($_.AdminDisplayVersion -Match "^Version 15") -and + ($_.AdminDisplayVersion -match "^Version 15") -and ([System.Convert]::ToString($_.Site).Split("/")[-1] -eq $SiteName) } | Select-Object Name, Site | Sort-Object Name Write-Grey("Site filtering ON. Only Exchange 2013+ MBX servers in {0} will be used in the report." -f $SiteName) $MBXServers = $getExchangeServer | Where-Object { ($_.IsMailboxServer -eq $true) -and - ($_.AdminDisplayVersion -Match "^Version 15") -and + ($_.AdminDisplayVersion -match "^Version 15") -and ([System.Convert]::ToString($_.Site).Split("/")[-1] -eq $SiteName) } | Select-Object Name, Site | Sort-Object Name } else { if ( ($null -eq $ServerList) ) { Write-Grey("Filtering OFF. All Exchange 2013+ servers will be used in the report.") - $CASServers = $getExchangeServer | Where-Object { ($_.IsClientAccessServer -eq $true) -and ($_.AdminDisplayVersion -Match "^Version 15") } | Select-Object Name, Site | Sort-Object Name - $MBXServers = $getExchangeServer | Where-Object { ($_.IsMailboxServer -eq $true) -and ($_.AdminDisplayVersion -Match "^Version 15") } | Select-Object Name, Site | Sort-Object Name + $CASServers = $getExchangeServer | Where-Object { ($_.IsClientAccessServer -eq $true) -and ($_.AdminDisplayVersion -match "^Version 15") } | Select-Object Name, Site | Sort-Object Name + $MBXServers = $getExchangeServer | Where-Object { ($_.IsMailboxServer -eq $true) -and ($_.AdminDisplayVersion -match "^Version 15") } | Select-Object Name, Site | Sort-Object Name } else { Write-Grey("Custom server list is being used. Only servers specified after the -ServerList parameter will be used in the report.") $CASServers = $getExchangeServer | Where-Object { ($_.IsClientAccessServer -eq $true) -and ( ($_.Name -in $ServerList) -or ($_.FQDN -in $ServerList) ) } | Select-Object Name, Site | Sort-Object Name diff --git a/Diagnostics/ManagedAvailabilityTroubleshooter/ManagedAvailabilityTroubleshooter.ps1 b/Diagnostics/ManagedAvailabilityTroubleshooter/ManagedAvailabilityTroubleshooter.ps1 index d03f95d08f..4def3375f5 100644 --- a/Diagnostics/ManagedAvailabilityTroubleshooter/ManagedAvailabilityTroubleshooter.ps1 +++ b/Diagnostics/ManagedAvailabilityTroubleshooter/ManagedAvailabilityTroubleshooter.ps1 @@ -91,7 +91,7 @@ function InvestigateProbe { param([String]$ProbeToInvestigate , [String]$MonitorToInvestigate , [String]$ResponderToInvestigate , [String]$ResourceNameToInvestigate , [String]$ResponderTargetResource ) TestFileOrCmd $ProbeDefinitionEventCmd - if (-Not ($ResponderTargetResource) -and ($ProbeToInvestigate.split("/").Count -gt 1)) { + if (-not ($ResponderTargetResource) -and ($ProbeToInvestigate.split("/").Count -gt 1)) { $ResponderTargetResource = $ProbeToInvestigate.split("/")[1] } $ProbeDetailsCmd = '(' + $ProbeDefinitionEventCmd + '| % {[XML]$_.toXml()}).event.userData.eventXml| ? {$_.Name -like "' + $ProbeToInvestigate.split("/")[0] + '*" }' diff --git a/PublicFolders/Update-PublicFolderPermissions.ps1 b/PublicFolders/Update-PublicFolderPermissions.ps1 index ae4e5e57d3..fbc3d6452a 100644 --- a/PublicFolders/Update-PublicFolderPermissions.ps1 +++ b/PublicFolders/Update-PublicFolderPermissions.ps1 @@ -118,7 +118,7 @@ function FindFoldersToUpdate([string[]]$includeFolders, [bool]$recurseOnFolders, continue } - if ($folderToSkip -notContains $foundFolder.EntryId) { + if ($folderToSkip -notcontains $foundFolder.EntryId) { Write-Verbose "$($MyInvocation.MyCommand): Returning found folder $($foundFolder.Identity) with EntryId $($foundFolder.EntryID)" #Return found folder $foundFolder diff --git a/Security/src/Test-ProxyLogon.ps1 b/Security/src/Test-ProxyLogon.ps1 index 0d6ff92fe4..12dd818799 100644 --- a/Security/src/Test-ProxyLogon.ps1 +++ b/Security/src/Test-ProxyLogon.ps1 @@ -136,7 +136,7 @@ begin { [Void]$allResults.FileList.Add( $files[$i] ) Import-Csv -Path $files[$i] -ErrorAction SilentlyContinue | - Where-Object { $_.AnchorMailbox -Like 'ServerInfo~*/*' -and $_.AnchorMailbox -notlike 'ServerInfo~*/autodiscover*' -and $_.AnchorMailbox -notlike 'ServerInfo~localhost*/*' } | + Where-Object { $_.AnchorMailbox -like 'ServerInfo~*/*' -and $_.AnchorMailbox -notlike 'ServerInfo~*/autodiscover*' -and $_.AnchorMailbox -notlike 'ServerInfo~localhost*/*' } | Select-Object -Property $outProps | ForEach-Object { [Void]$allResults.Hits.Add( $_ ) @@ -219,7 +219,7 @@ begin { if ((Get-ChildItem $files[$i] -ErrorAction SilentlyContinue | Select-String -Pattern "ServerInfo~").Count -gt 0) { - $hits = @(Import-Csv -Path $files[$i] -ErrorAction SilentlyContinue | Where-Object { $_.AnchorMailbox -Like 'ServerInfo~*/*Reset*VirtualDirectory#' -and $_.HttpStatus -eq 200 } | + $hits = @(Import-Csv -Path $files[$i] -ErrorAction SilentlyContinue | Where-Object { $_.AnchorMailbox -like 'ServerInfo~*/*Reset*VirtualDirectory#' -and $_.HttpStatus -eq 200 } | Select-Object -Property $outProps) if ($hits.Count -gt 0) { $hits | ForEach-Object {