-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Some basic Exchange Server checks to run after maintenance. | ||
Write-Host -ForeGroundColor Yellow "Service Health" | ||
Test-ServiceHealth | ||
Write-Host -ForeGroundColor Yellow "MAPI Connectivity" | ||
Test-MAPIConnectivity | ||
Write-Host -ForeGroundColor Yellow "Mailbox Database Copy Status" | ||
Get-MailboxDatabaseCopyStatus | ||
Write-Host -ForeGroundColor Yellow "Cluster Node Status" | ||
Get-ClusterNode | ||
Write-Host -ForeGroundColor Yellow "Replication Health" | ||
Test-ReplicationHealth | ||
Write-Host -ForeGroundColor Yellow "Server Component State" | ||
Get-ServerComponentState -Identity $env:COMPUTERNAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Get-MailboxDatabase -Status | Sort-Object Name | ` | ||
Select-Object Name, | ||
@{Name='DB Size (Gb)';Expression={$_.DatabaseSize.ToGb()}}, | ||
@{Name='DB Free Whitespace (Gb)';Expression={$_.AvailableNewMailboxSpace.ToGb()}} |
10 changes: 10 additions & 0 deletions
10
Exchange Server/Get Receive Connectors with External Relay Permissions.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
$ReceiveConnectors = (Get-ExchangeServer | Get-ReceiveConnector).Where({$_.Enabled -eq $true}) | Sort-Object Name,Identity | ||
$ExternalRelays = @() | ||
foreach ($rc in $ReceiveConnectors) { | ||
$dn = $rc.DistinguishedName | ||
if (Get-ADPermission -Identity $dn -User "NT AUTHORITY\ANONYMOUS LOGON" | Where-Object {$_.ExtendedRights.RawIdentity -eq "MS-Exch-SMTP-Accept-Any-Recipient"}) { | ||
$ExternalRelays += $rc | ||
} | ||
} | ||
|
||
$ExternalRelays | Select-Object Name,Server,Enabled -Unique |
2 changes: 2 additions & 0 deletions
2
Exchange Server/List All Exchange Server Virtual Directories.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# A fun way to find every cmdlet that gets Exchange virtual directories and then pipe that list to run it against the current server. | ||
foreach ($c in ((Get-Command "Get*VirtualDirectory" -CommandType Function).Name)) {& $c -server $env:COMPUTERNAME | Format-List Name,InternalUrl,ExternalUrl} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<# | ||
.SYNOPSIS | ||
A script to clear old Exchange logs files. | ||
.DESCRIPTION | ||
This script will clear all Exchange Server log files under the installation's "Logging" path that are older than a set | ||
number of days. (It will not touch database log files unless those are intentionally put in the worst possible location!) | ||
#> | ||
|
||
# Set the number of days to preserve logs from. | ||
$LogAgeDays = 14 | ||
|
||
# Check for the existince of the Exchange logging folder under the install path. | ||
if (Test-Path -Path "$env:ExchangeInstallPath\Logging") { | ||
Set-Location -Path "$env:ExchangeInstallPath\Logging" -ErrorAction Stop | ||
|
||
# Get Exchang Server logs that are older than [nn] days and remove them. Any log files still in use will not be deleted. | ||
Get-ChildItem -Path "$env:ExchangeInstallPath\Logging" -Recurse -Include *.log | ` | ||
Where-Object { $_.LastWriteTime -lt ((Get-Date).AddDays(-$LogAgeDays)) } | ` | ||
Remove-Item -Confirm:$false -ErrorAction SilentlyContinue | ||
} |