Want to know how your e-mail queue's are piling up?
# Script: QueueReport.ps1
# Purpose: This script can be set as a scheduled task to run every 30minutes
# and will monitor all exchange 2010 queue's. If a threshold of 10 is met an
# output file with the queue details will be e-mailed to all intended admins
# listed in the e-mail settings
# Author: Edwin van Brenk
# Date: 12-2013
$data = Get-ExchangeServer | Where { $_.isHubTransportServer -eq $true } | get-queue | Where-Object { $_.MessageCount -gt 10 } | FT -Wrap -autosize
$report = $data
$smtpServer = “smtp.domain.lan”
$message = new-object Net.Mail.MailMessage
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$message.From = “Queue-Alert@domain.com”
$message.To.Add("admin1@domain.com")
#$msg.To.Add("admin2@domain.com")
$message.Subject = “CAS SERVER QUEUE THRESHOLD REACHED - PLEASE CHECK EXCHANGE QUEUES”
$message.Body = ( $report | out-string )
$smtp.Send($message)
About: Exchange 2013-2016-2019-Online - Powershell - Windows 2012-2016-2019 - Teams - Office365 - PKI - Microsoft365
19 December 2013
Exchange Queue report script
Labels:
Exchange 2010,
Powershell
Location:Utrecht
Utrecht, Nederland
ActiveSync connection report
I wanted to get more info on our active sync devices and any errors that may occur.
So after a trip down the Micrsoft Script gallery i came across this: ActiveSyncReport.PS1
Just what i was looking for.
After adjusting some parameters, i created an email report to show me the activesync devices that had more than 1000 connections to the CAS-HUB servers from the internet from the day before.
Which looks something like this:
# Current date minus 1 day
$Date = (get-date (get-date).Adddays(-1) -Format "dd-MM-yyyy")
$LogparserExec = "C:\Program Files (x86)\Log Parser 2.2\LogParser.exe"
$ActiveSyncOutputFolder = "D:\Temp\ASoutput"
$IISLogs = "\\sr-xxxx\d$\IISLogs\w3svc1\","\\sr-xxxx\d$\IISLogs\w3svc1\"
$SMTPServer = "smtp.domain.lan"
$SMTPSender = Activesync@domain.com
$SMTPRecipient = "username1@domain.com","username2@domain.com"
$SendEmailReport = $true
$HTMLReport = $true
$MinimumHits = 1000
And finally send the email:
Send-MailMessage -To $SMTPRecipient -From $SMTPSender -SmtpServer $SMTPServer -Subject "Exchange ActiveSync Report $Date $title" -BodyAsHtml $body
I changed some parameters to functions so it is easier to generate the same report every day.
Otherwise i would have to change the date every time i wanted to generate the report.
The script itself can be found here
The full description and examples can be found here
So after a trip down the Micrsoft Script gallery i came across this: ActiveSyncReport.PS1
Just what i was looking for.
After adjusting some parameters, i created an email report to show me the activesync devices that had more than 1000 connections to the CAS-HUB servers from the internet from the day before.
Which looks something like this:
# Current date minus 1 day
$Date = (get-date (get-date).Adddays(-1) -Format "dd-MM-yyyy")
$LogparserExec = "C:\Program Files (x86)\Log Parser 2.2\LogParser.exe"
$ActiveSyncOutputFolder = "D:\Temp\ASoutput"
$IISLogs = "\\sr-xxxx\d$\IISLogs\w3svc1\","\\sr-xxxx\d$\IISLogs\w3svc1\"
$SMTPServer = "smtp.domain.lan"
$SMTPSender = Activesync@domain.com
$SMTPRecipient = "username1@domain.com","username2@domain.com"
$SendEmailReport = $true
$HTMLReport = $true
$MinimumHits = 1000
And finally send the email:
Send-MailMessage -To $SMTPRecipient -From $SMTPSender -SmtpServer $SMTPServer -Subject "Exchange ActiveSync Report $Date $title" -BodyAsHtml $body
I changed some parameters to functions so it is easier to generate the same report every day.
Otherwise i would have to change the date every time i wanted to generate the report.
The script itself can be found here
The full description and examples can be found here
Labels:
Exchange 2010,
Powershell
Location:Utrecht
Utrecht, Nederland
10 December 2013
Send email using Telnet
This one comes from Paul Cunningham, and as he states this is indeed need to know stuff.
So bookmark this or Paul's page.
This is one of the essential troubleshooting tricks that an Exchange administrator needs to know, sending an email using Telnet from the command line.
Let’s say you’ve just configured a relay connector and want to test it from the server that you wish to allow relay from before you let that server’s owner know that it is all set up for them. Or perhaps you want to quickly test whether a another email server on the internet is accepting mail from your network.
For just about any scenario where you want to quickly test SMTP knowing this method is very useful.
Note: this technique requires the Telnet client to be installed on the computer you’re running the test from. For Windows XP and Windows Server 2003 it will already be installed, but Windows 7 and Windows Server 2008 need to install it first.
If Telnet is able to connect to the remote server you should see its welcome banner.
The first command to send is the HELO command. Some email servers will accept HELO on its own, others will require you to also provide a host or domain name along with it.
Next use the MAIL FROM command to tell the remote server who the email is from.
Now use the RCPT TO command to tell the remote server who to deliver the email to.
The final step for the bare minimum set of commands is the DATA command.
If you just want to send a blank message type a period “.” and press enter. Otherwise you can set a subject line for the message if you like. Use SUBJECT and then type your subject line, and press enter.
Type any text you want to include with the message, press enter, and then finally type a period “.” and press enter to send the email.
If the message was queued for delivery then it has been accepted by the server. If this is an Exchange server that you control then you can use message tracking to troubleshoot further if the message doesn’t make it to the inbox that you were expecting.
Type the QUIT command to terminate the connection when you’re done.
250 is a good thing, and there are a lot of other SMTP status codes you’ll encounter the more you use this technique. For example an email server may deny your attempt to relay mail between two domains.
Or you may encounter an email server that is explicitly blocking email from your domain.
There are a lot of different scenarios you might encounter here, and thankfully the SMTP status codes will help you troubleshoot them.
Now that you understand how to send email using Telnet and the command line I hope you find this technique very useful in the future.
So bookmark this or Paul's page.
This is one of the essential troubleshooting tricks that an Exchange administrator needs to know, sending an email using Telnet from the command line.
Let’s say you’ve just configured a relay connector and want to test it from the server that you wish to allow relay from before you let that server’s owner know that it is all set up for them. Or perhaps you want to quickly test whether a another email server on the internet is accepting mail from your network.
For just about any scenario where you want to quickly test SMTP knowing this method is very useful.
Note: this technique requires the Telnet client to be installed on the computer you’re running the test from. For Windows XP and Windows Server 2003 it will already be installed, but Windows 7 and Windows Server 2008 need to install it first.
Installing the Telnet Client for Windows 7
To install the Telnet client on a Windows 7 computer use these steps.- Open the Control Panel
- Click on Programs
- Click on Turns Windows Features on or off
- Scroll down the list until you see Telnet Client, and tick that box
- Click OK and close the Control Panel
Installing the Telnet Client for Windows Server 2008
To install the Telnet client on a Windows Server 2008 computer open a command prompt and run the following command.C:\>servermanagercmd -i telnet-client
.........
Start Installation...
[Installation] Succeeded: [Telnet Client].
Success: Installation succeeded.
Installing the Telnet Client for Windows Server 2008 R2
To install the Telnet client on a Windows Server 2008 R2 computer open a PowerShell window and run the following command.PS C:\> Import-Module servermanager PS C:\> Add-WindowsFeature telnet-client Success Restart Needed Exit Code Feature Result ------- -------------- --------- -------------- True No Success {Telnet Client}
Sending Email from the Command Line via Telnet
Open a command prompt and use Telnet to connect to the remote email server on port 25.C:\>telnet esp-ho-ex2010a 25
If Telnet is able to connect to the remote server you should see its welcome banner.
220 ESP-HO-EX2010A.exchangeserverpro.net Microsoft ESMTP MAIL Service ready at T ue, 9 Aug 2011 22:00:04 +1000
The first command to send is the HELO command. Some email servers will accept HELO on its own, others will require you to also provide a host or domain name along with it.
helo test.com 250 ESP-HO-EX2010A.exchangeserverpro.net Hello [10.0.1.11]
Next use the MAIL FROM command to tell the remote server who the email is from.
mail from: test@test.com 250 2.1.0 Sender OK
Now use the RCPT TO command to tell the remote server who to deliver the email to.
rcpt to: alan.reid@exchangeserverpro.net 250 2.1.5 Recipient OK
The final step for the bare minimum set of commands is the DATA command.
data 354 Start mail input; end with .
If you just want to send a blank message type a period “.” and press enter. Otherwise you can set a subject line for the message if you like. Use SUBJECT and then type your subject line, and press enter.
subject: this is a test message
Type any text you want to include with the message, press enter, and then finally type a period “.” and press enter to send the email.
sending a test message via telnet . 250 2.6.0 [InternalId=320] Queued mail for delivery
If the message was queued for delivery then it has been accepted by the server. If this is an Exchange server that you control then you can use message tracking to troubleshoot further if the message doesn’t make it to the inbox that you were expecting.
Type the QUIT command to terminate the connection when you’re done.
SMTP Status Codes
You may notice along the way that after typing commands you see responses from the server starting with “250″.250 is a good thing, and there are a lot of other SMTP status codes you’ll encounter the more you use this technique. For example an email server may deny your attempt to relay mail between two domains.
550 5.7.1 Unable to relay
Or you may encounter an email server that is explicitly blocking email from your domain.
554 5.1.0 Sender denied
There are a lot of different scenarios you might encounter here, and thankfully the SMTP status codes will help you troubleshoot them.
Now that you understand how to send email using Telnet and the command line I hope you find this technique very useful in the future.
09 December 2013
Create shared mailbox with RES Automation Manager and Powershell
I created a script for our servicedesk that can create a shared mailbox in combination with RES Automation Manager.
Normally our servicedesk support staff can't create a shared mailbox because of the limited rights they have in our environment. Shared mailboxes can only be created with powershell and Organization Management rights.
The script runs as a "Module" in RES AM.
There are 2 variables that need to be entered:
The 2 variables:
The sharedmailbox "Testmailbox" has been created in the OU domain.lan\Central\Accounts\Shared Mailboxes, and the login has been disabled. (by default for a shared mailbox)
A group for the shared mailbox "Testmailbox" has been created in the OU domain.lan\Central\Accounts\Groups\Shared Mailboxes with the name; g.f.mail.Alias (g.f.mail.testmailbox)
The new group is added to the shared mailbox with "Full Access" permissions and "Send as" permissions.
The only thing that has to be done by hand, is add the opropriate users to the new "Testmailbox".
The script:
param ($Alias,$DisplayName)
add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010
import-module activedirectory
# Setup variables
$DomainController="sr-XXXXX.domain.lan"
$OU='domain.lan/Central/Accounts/Shared Mailboxes'
$UPNdomain = "@domain.com"
if ($Alias)
{
if ($Alias.Contains('@')) { $Alias = $Alias.Substring(0,$Alias.IndexOf('@')) }
$AliasMailbox = Get-Mailbox $Alias -ErrorAction SilentlyContinue
$AliasMailUser = Get-MailUser $Alias -ErrorAction SilentlyContinue
if ($AliasMailbox -or $AliasMailUser)
{
Write-Output "The Alias specified already exists."
$Alias = $null
}
}
while (!$Alias)
{
$Alias = Read-Host -Prompt "Alias"
if ($Alias)
{
if ($Alias.Contains('@')) { $Alias = $Alias.Substring(0,$Alias.IndexOf('@')) }
$AliasMailbox = Get-Mailbox $Alias -ErrorAction SilentlyContinue
$AliasMailUser = Get-MailUser $Alias -ErrorAction SilentlyContinue
if ($AliasMailbox -or $AliasMailUser)
{
Write-Output "The Alias specified already exists."
$Alias = $null
}
}
}
if ($DisplayName)
{
$DisplayNameMailbox = Get-Mailbox $DisplayName -ErrorAction SilentlyContinue
$DisplayNameMailUser = Get-MailUser $DisplayName -ErrorAction SilentlyContinue
if ($DisplayNameMailbox -or $DisplayNameMailUser)
{
Write-Output "The Display Name specified already exists."
$DisplayName = $null
}
}
while (!$DisplayName)
{
$DisplayName = Read-Host -Prompt "Display Name"
if ($DisplayName)
{
$DisplayNameMailbox = Get-Mailbox $DisplayName -ErrorAction SilentlyContinue
$DisplayNameMailUser = Get-MailUser $DisplayName -ErrorAction SilentlyContinue
if ($DisplayNameMailbox -or $DisplayNameMailUser)
{
Write-Output "The Display Name specified already exists."
$DisplayName = $null
}
}
}
#Alias to lower
$Alias=$Alias.ToLower()
# Set UPN
$UPN=$Alias + $UPNDomain
Write-Output "Creating Shared Mailbox"
New-Mailbox -Name:$Alias -Alias:$Alias -DisplayName:$DisplayName -OrganizationalUnit:$OU -UserPrincipalName:$UPN -SamAccountName:$Alias -Database:$MailboxDatabase –Shared –DomainController $DomainController
Sleep 10
Write-Output "Creating Security Group"
New-ADGroup -Name "g.f.mail.$Alias" -SamAccountName g.f.mail.$Alias -GroupCategory Security -GroupScope Global -DisplayName "g.f.mail.$Alias" -Path "OU=Shared Mailboxes,OU=Groups,OU=Accounts,OU=Central,DC=domain,DC=lan" -Description "Group for shared mailbox $Alias"
Write-Output "Setting Mailbox Permissions"
sleep 50
Add-MailboxPermission –Identity: $Alias –AccessRights:FullAccess –user:"g.f.mail.$Alias"
Add-ADPermission –Identity: $Alias –user:"g.f.mail.$Alias" –ExtendedRights: 'Send-as'
Normally our servicedesk support staff can't create a shared mailbox because of the limited rights they have in our environment. Shared mailboxes can only be created with powershell and Organization Management rights.
The script runs as a "Module" in RES AM.
There are 2 variables that need to be entered:
- The shared mailbox Alias
- The shared mailbox description
The 2 variables:
When the job has run successfully the following has happened:
A group for the shared mailbox "Testmailbox" has been created in the OU domain.lan\Central\Accounts\Groups\Shared Mailboxes with the name; g.f.mail.Alias (g.f.mail.testmailbox)
The new group is added to the shared mailbox with "Full Access" permissions and "Send as" permissions.
The only thing that has to be done by hand, is add the opropriate users to the new "Testmailbox".
The script:
param ($Alias,$DisplayName)
add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010
import-module activedirectory
# Setup variables
$DomainController="sr-XXXXX.domain.lan"
$OU='domain.lan/Central/Accounts/Shared Mailboxes'
$UPNdomain = "@domain.com"
if ($Alias)
{
if ($Alias.Contains('@')) { $Alias = $Alias.Substring(0,$Alias.IndexOf('@')) }
$AliasMailbox = Get-Mailbox $Alias -ErrorAction SilentlyContinue
$AliasMailUser = Get-MailUser $Alias -ErrorAction SilentlyContinue
if ($AliasMailbox -or $AliasMailUser)
{
Write-Output "The Alias specified already exists."
$Alias = $null
}
}
while (!$Alias)
{
$Alias = Read-Host -Prompt "Alias"
if ($Alias)
{
if ($Alias.Contains('@')) { $Alias = $Alias.Substring(0,$Alias.IndexOf('@')) }
$AliasMailbox = Get-Mailbox $Alias -ErrorAction SilentlyContinue
$AliasMailUser = Get-MailUser $Alias -ErrorAction SilentlyContinue
if ($AliasMailbox -or $AliasMailUser)
{
Write-Output "The Alias specified already exists."
$Alias = $null
}
}
}
if ($DisplayName)
{
$DisplayNameMailbox = Get-Mailbox $DisplayName -ErrorAction SilentlyContinue
$DisplayNameMailUser = Get-MailUser $DisplayName -ErrorAction SilentlyContinue
if ($DisplayNameMailbox -or $DisplayNameMailUser)
{
Write-Output "The Display Name specified already exists."
$DisplayName = $null
}
}
while (!$DisplayName)
{
$DisplayName = Read-Host -Prompt "Display Name"
if ($DisplayName)
{
$DisplayNameMailbox = Get-Mailbox $DisplayName -ErrorAction SilentlyContinue
$DisplayNameMailUser = Get-MailUser $DisplayName -ErrorAction SilentlyContinue
if ($DisplayNameMailbox -or $DisplayNameMailUser)
{
Write-Output "The Display Name specified already exists."
$DisplayName = $null
}
}
}
#Alias to lower
$Alias=$Alias.ToLower()
# Set UPN
$UPN=$Alias + $UPNDomain
Write-Output "Creating Shared Mailbox"
New-Mailbox -Name:$Alias -Alias:$Alias -DisplayName:$DisplayName -OrganizationalUnit:$OU -UserPrincipalName:$UPN -SamAccountName:$Alias -Database:$MailboxDatabase –Shared –DomainController $DomainController
Sleep 10
Write-Output "Creating Security Group"
New-ADGroup -Name "g.f.mail.$Alias" -SamAccountName g.f.mail.$Alias -GroupCategory Security -GroupScope Global -DisplayName "g.f.mail.$Alias" -Path "OU=Shared Mailboxes,OU=Groups,OU=Accounts,OU=Central,DC=domain,DC=lan" -Description "Group for shared mailbox $Alias"
Write-Output "Setting Mailbox Permissions"
sleep 50
Add-MailboxPermission –Identity: $Alias –AccessRights:FullAccess –user:"g.f.mail.$Alias"
Add-ADPermission –Identity: $Alias –user:"g.f.mail.$Alias" –ExtendedRights: 'Send-as'
Labels:
Exchange 2010,
Powershell,
RES Automation Manager
Location:Utrecht
Utrecht, Nederland
Configure Protocol logging
By default protocol logging is not enabled on your send and receive connectors.
It is a pretty good idea to turn it on, at least on your internet send and receive connectors.
You could also turn it on on all your send and receive connectors, if there's no data sent over those connectors there will be nothing logged.
Disk space is the main criteria to implement protocol logging, and even that can be configured to your desires.
Protocol logging records the SMTP conversations that occur between e-mail servers as part of message delivery. These SMTP conversations occur on Send connectors and Receive connectors configured on servers running Microsoft Exchange Server 2010 that have the Hub Transport server role or the Edge Transport server role installed. You can use protocol logging to diagnose mail flow problems.
By default, protocol logging is disabled on all Send connectors and Receive connectors. Protocol logging is enabled or disabled on a per-connector basis. Other protocol logging options are set on a per-connector type basis for the whole server. All the Receive connectors on a Hub Transport server or an Edge Transport server share the same protocol log files and protocol log options. These protocol log files and protocol log options are separate from the Send connector protocol log files and protocol log options that are on the same server. By default, Exchange 2010 uses circular logging to limit the protocol logs based on file size and file age to help control the hard disk space used by the protocol log files.
Looking for other management tasks related to transport logs? Check out Managing Transport Logs.
© 2010 Microsoft Corporation. All rights reserved.
It is a pretty good idea to turn it on, at least on your internet send and receive connectors.
You could also turn it on on all your send and receive connectors, if there's no data sent over those connectors there will be nothing logged.
Disk space is the main criteria to implement protocol logging, and even that can be configured to your desires.
- You can configure the maximum number of days the logs are maintained.
- You can configure the maximum directory size.
- You can configure the maximum file size.
- You can configure the log file path.
Configure Protocol Logging
Exchange 2010
Applies to: Exchange Server 2010 SP3, Exchange Server 2010 SP2
Protocol logging records the SMTP conversations that occur between e-mail servers as part of message delivery. These SMTP conversations occur on Send connectors and Receive connectors configured on servers running Microsoft Exchange Server 2010 that have the Hub Transport server role or the Edge Transport server role installed. You can use protocol logging to diagnose mail flow problems.
By default, protocol logging is disabled on all Send connectors and Receive connectors. Protocol logging is enabled or disabled on a per-connector basis. Other protocol logging options are set on a per-connector type basis for the whole server. All the Receive connectors on a Hub Transport server or an Edge Transport server share the same protocol log files and protocol log options. These protocol log files and protocol log options are separate from the Send connector protocol log files and protocol log options that are on the same server. By default, Exchange 2010 uses circular logging to limit the protocol logs based on file size and file age to help control the hard disk space used by the protocol log files.
Looking for other management tasks related to transport logs? Check out Managing Transport Logs.
Caution: |
---|
Don't perform this procedure on an Edge Transport server that has been subscribed to the Exchange organization by using EdgeSync. Instead, make the changes on the Hub Transport server. The changes are then replicated to the Edge Transport server next time EdgeSync synchronization occurs. |
You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Receive connectors" and "Send connectors" entries in the Transport Permissions topic.
- Perform one of the following steps:
- To modify an existing Receive connector on an Edge Transport server, in the console tree, select Edge Transport, and then in the work pane, click the Receive Connectors tab.
- To modify an existing Receive connector on a Hub Transport server, expand Server Configuration in the console tree, and select Hub Transport. In the result pane, select the server that has the Receive connector that you want to modify, and then click the Receive Connectors tab.
- In the work pane, select the Receive connector to modify.
- Under the name of the Receive connector in the action pane, click Properties to open the Properties page.
- Click the General tab and use the drop-down box next to Protocol logging level to enable or disable protocol logging. None disables protocol logging, and Verbose enables protocol logging.
- After you make your protocol logging selection, click Apply to save changes and remain on the Properties page, or click OK to save changes and exit the Properties page.
This example enables protocol logging for the Receive connector Connection from Contoso.com.
The procedure is similar for Send connectors. For Send connectors, you use the Set-SendConnector cmdlet.
For detailed syntax and parameter information, see Set-ReceiveConnector or Set-SendConnector.
Set-ReceiveConnector "Connection from Contoso.com" -ProtocolLoggingLevel Verbose
For detailed syntax and parameter information, see Set-ReceiveConnector or Set-SendConnector.
You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Hub Transport server" entry in the Transport Permissions topic.
A special Send connector named the intra-organization Send connector exists on every Hub Transport server. This connector is implicitly created, invisible, and requires no management. The intra-organization Send connector is used to relay messages to the following destinations:
This example enables protocol logging on the intra-organization Send connector on a Hub Transport server.
For detailed syntax and parameter information, see Set-TransportServer.
Note: |
---|
You can't use the EMC to enable or disable protocol logging for the intra-organization Send connector. |
- To other Hub Transport servers in the Exchange organization
- To Exchange Server 2003 servers in the Exchange organization
- To Edge Transport servers in the Exchange organization
This example enables protocol logging on the intra-organization Send connector on a Hub Transport server.
Set-TransportServer "Exchange01" -IntraOrgConnectorProtocolLoggingLevel Verbose
You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Hub Transport server" and "Edge Transport server" entries in the Transport Permissions topic.
By default, the Receive connector protocol log files are located at C:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\Logs\ProtocolLog\SmtpReceive, and the Send connector protocol log files are located at C:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\Logs\ProtocolLog\SmtpSend. The directory must be local to the Exchange 2010 computer.
By default, the Receive connector protocol log files are located at C:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\Logs\ProtocolLog\SmtpReceive, and the Send connector protocol log files are located at C:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\Logs\ProtocolLog\SmtpSend. The directory must be local to the Exchange 2010 computer.
- Perform one of the following steps:
- On a computer that has the Edge Transport server role installed, select Edge Transport, and then in the action pane, click the Properties link that's directly under the server name.
- On a computer that has the Hub Transport server role installed, in the console tree, expand Server Configuration, and select Hub Transport. In the action pane, click the Properties link that's directly under the server name.
- On the Properties page, click the Log Settings tab.
- In the Protocol log section, click Browse next to Receive connector protocol log file path.
- In the Browse for folder window, browse to the new location where you want to store the Receive connector protocol log files. If you want to create a folder, select a parent folder, click Make New Folder, and then type the name of the new folder. After you make your folder selection, click OK to close the Browse for folder window.
- Click Apply to save changes and remain on the Properties page, or click OK to save changes and exit the Properties page.
This example sets the Receive connector protocol log directory to C:\Receive SMTP Log on the Exchange 2010 computer Exchange01.
For detailed syntax and parameter information, see Set-TransportServer.
Set-TransportServer Exchange01 -ReceiveProtocolLogPath "C:\Receive SMTP Log"
- Perform one of the following steps:
- On a computer that has the Edge Transport server role installed, select Edge Transport, and then in the action pane, click the Properties link that's directly under the server name.
- On a computer that has the Hub Transport server role installed, in the console tree, expand Server Configuration, and select Hub Transport. In the action pane, click the Properties link that's directly under the server name.
- On the Properties page, click the Log Settings tab.
- In the Protocol log section, click Browse next to Send connector protocol log file path.
- In the Browse for folder window, browse to the new location where you want to store the Send connector protocol log files. If you want to create a folder, select a parent folder, click Make New Folder, and then type the name of the new folder. After you make your folder selection, click OK to close the Browse for folder window.
- Click Apply to save changes and remain on the Properties page, or click OK to save changes and exit the Properties page.
This example sets the Send connector protocol log directory to C:\Send SMTP Log on the Exchange 2010 computer Exchange01.
Setting the value of the SendProtocolLogPath parameter or ReceiveProtocolLogPath parameter to
For detailed syntax and parameter information, see Set-TransportServer.
Set-TransportServer Exchange01 -SendProtocolLogPath "C:\Send SMTP Log"
$null
disables protocol logging for all Send connectors or all Receive connectors on the server. However, setting either of these parameters to $null
when protocol logging is enabled for any Send connector, including the intra-organization Send connector, or Receive connector on the server generates event log errors. The preferred method of disabling protocol logging is to use the Set-SendConnector or Set-ReceiveConnector cmdlets to set the ProtocolLoggingLevel parameter to None
. Also, you can use the Set-TransportServer cmdlet to set the IntraOrgProtocolLoggingLevel parameter to None
.For detailed syntax and parameter information, see Set-TransportServer.
You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Hub Transport server" and "Edge Transport server" entries in the Transport Permissions topic.
By default, the maximum size for each protocol log file is 10 MB. All Receive connectors on the server share the same protocol log files, and all Send connectors on the server share the same protocol log files. When a protocol log file reaches its maximum size, Exchange 2010 opens a new protocol log file. This process continues until either of the following conditions is true:
This example sets the maximum size of Receive connector protocol log files to 20 MB on the Exchange 2010 computer Exchange01.
This example sets the maximum size of Send connector protocol log files to 20 MB on the Exchange 2010 computer Exchange01.
For detailed syntax and parameter information, see Set-TransportServer.
Note: |
---|
You can't use the EMC to configure the maximum size of each protocol log file. |
- The protocol log directory reaches its specified maximum size. For more information about how to change the maximum size of the protocol log directory, see "Configure the maximum size of the protocol log directory" later in this topic.
- A protocol log file reaches its specified maximum age. For more information about how to change the maximum age of a protocol log file, see "Configure the maximum age of the protocol log files" later in this topic.
This example sets the maximum size of Receive connector protocol log files to 20 MB on the Exchange 2010 computer Exchange01.
Set-TransportServer Exchange01 -ReceiveProtocolLogMaxFileSize 20MB
Set-TransportServer Exchange01 -SendProtocolLogMaxFileSize 20MB
You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Hub Transport server" and "Edge Transport server" entries in the Transport Permissions topic.
By default, the maximum size for the protocol log directory is 250 MB. All Receive connectors on the server share the same protocol log directory, and all Send connectors on the server share the same protocol log directory. Circular logging deletes the oldest protocol log files when either of the following conditions is true:
This example sets the maximum size of the Send connector protocol log directory to 400 MB on the Exchange 2010 computer Exchange01.
For detailed syntax and parameter information, see Set-TransportServer.
Note: |
---|
You can't use the EMC to configure the maximum size of the protocol log directory. |
- The protocol log directory reaches its specified maximum size.
- A protocol log file reaches its specified maximum age.
Set-TransportServer Exchange01 -ReceiveProtocolLogMaxDirectorySize 400MB
Set-TransportServer Exchange01 -SendProtocolLogMaxDirectorySize 400MB
You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Hub Transport server" and "Edge Transport server" entries in the Transport Permissions topic.
By default, the maximum age for any protocol log file is 30 days. All Receive connectors on the server share the same protocol log files, and all Send connectors on the server share the same protocol log files. Circular logging deletes the oldest protocol log files if either of the following conditions is true:
This example sets the age limit of the Send connector protocol log files to 45 days on the Exchange 2010 computer Exchange01.
To specify an age value, enter the value as a time span: dd.hh:mm:ss, where d = days, h = hours, m = minutes, and s = seconds. The valid input range for this parameter is from 00:00:00 through 24855.03:14:07. Setting the value of the ReceiveProtocolLogMaxAge parameter or the SendProtocolLogMaxAge parameter to
For detailed syntax and parameter information, see Set-TransportServer.
Note: |
---|
You can't use the EMC to configure the maximum age of the protocol log files. |
- The protocol log directory reaches its specified maximum size.
- A protocol log file reaches its specified maximum age.
Set-TransportServer Exchange01 -ReceiveProtocolLogMaxAge 45.00:00:00
Set-TransportServer Exchange01 -SendProtocolLogMaxAge 45.00:00:00
00:00:00
prevents the automatic removal of protocol log files because of their age.For detailed syntax and parameter information, see Set-TransportServer.
Labels:
Exchange 2010,
Powershell
Location:Utrecht
Utrecht, Nederland
02 December 2013
Change and publish ReportingURL for Lync 2010
Tried using the Lync reporting feature the other day, and found there was no URL published.
First check what the current URL is:
Get-CsService -MonitoringServer
Identity : MonitoringServer:sr-XXXXX.domain.lan
MonitoringDatabase : MonitoringDatabase:cl-XXXX-cg1
ReportingUrl :
DependentServiceList : {Registrar:lyncedc.domain.lan}
ServiceId : 2-MonitoringServer-1
SiteId : Site:FirstSite
PoolFqdn : sr-XXXXX.domain.lan
Version : 5
Role : MonitoringServer
Set new Url and publish:
Set-CsMonitoringServer -Identity "MonitoringServer:sr-XXXXX.domain.lan" -ReportingUrl http://sr-XXXXX/Reports_APPROD/Pages/Folder.aspx
Review your change:
Get-CsService -MonitoringServer
Identity : MonitoringServer:sr-XXXXX.domain.lan
MonitoringDatabase : MonitoringDatabase:cl-XXXXX-cg1
ReportingUrl : http://sr-XXXXX/Reports_APPROD/Pages/Folder.aspx
DependentServiceList : {Registrar:lyncedc.domain.lan}
ServiceId : 2-MonitoringServer-1
SiteId : Site:FirstSite
PoolFqdn : sr-XXXXX.domain.lan
Version : 5
Role : MonitoringServer
And now the URL is published:
First check what the current URL is:
Get-CsService -MonitoringServer
Identity : MonitoringServer:sr-XXXXX.domain.lan
MonitoringDatabase : MonitoringDatabase:cl-XXXX-cg1
ReportingUrl :
DependentServiceList : {Registrar:lyncedc.domain.lan}
ServiceId : 2-MonitoringServer-1
SiteId : Site:FirstSite
PoolFqdn : sr-XXXXX.domain.lan
Version : 5
Role : MonitoringServer
Set new Url and publish:
Set-CsMonitoringServer -Identity "MonitoringServer:sr-XXXXX.domain.lan" -ReportingUrl http://sr-XXXXX/Reports_APPROD/Pages/Folder.aspx
Review your change:
Get-CsService -MonitoringServer
Identity : MonitoringServer:sr-XXXXX.domain.lan
MonitoringDatabase : MonitoringDatabase:cl-XXXXX-cg1
ReportingUrl : http://sr-XXXXX/Reports_APPROD/Pages/Folder.aspx
DependentServiceList : {Registrar:lyncedc.domain.lan}
ServiceId : 2-MonitoringServer-1
SiteId : Site:FirstSite
PoolFqdn : sr-XXXXX.domain.lan
Version : 5
Role : MonitoringServer
And now the URL is published:
Labels:
Lync 2010,
Powershell
Location:Utrecht
Utrecht, Nederland
Subscribe to:
Posts (Atom)