Archive for the ‘EMS Commands (Powershell)’ Category

Set-MailboxCalendarSettings cmdlet to enable calendar processing for a mailbox.   Leave a comment

Use the Set-MailboxCalendarSettings cmdlet to enable calendar processing for a mailbox.

The Set-MailboxCalendarSettings cmdlet lets you enable calendar processing for a mailbox. You can configure parameters for automatic resource booking or Calendar Attendant processing.

To run the Set-MailboxCalendarSettings cmdlet, the account that you use must be delegated the following:

-Exchange Organization Administrator role

Set-MailboxCalendarSettings -Identity “5th Floor Conference Room” -AutomateProcessing AutoAccept -AddOrganizerToSubject $true -DeleteSubject $true

Posted July 20, 2015 by Prem Rana in EMS Commands (Powershell)

Exchange Server 2010 – Changing Message Tracking Log Retention Period   Leave a comment

Open the Exchange Management Shell console and determine your server’s identity and verify logging is enabled with either of these commands.

Get-TransportServer | Select Name,MessageTrackingLogEnabled | ft -auto
Get-MailboxServer | Select Name,MessageTrackingLogEnabled | ft -auto
Here you can check the current Message Logging values. It also aids in determining which switches to set.

Get-MailboxServer YourServerName | fl messagetracking*

You should see something like this…

MessageTrackingLogEnabled : True
MessageTrackingLogMaxAge : 30.00:00:00
MessageTrackingLogMaxDirectorySize : 1000 MB (1,048,576,000 bytes)
MessageTrackingLogMaxFileSize : 10 MB (10,485,760 bytes)
MessageTrackingLogPath : C:\Program Files\Exchange\TransportRoles\Logs\MessageTracking
MessageTrackingLogSubjectLoggingEnabled : True

Change your values to something more useful. In my case, space was not an issue so I enabled logging for 365 days and allocated 10 GB for log files.

Set-TransportServer YourServerName -MessageTrackingLogMaxAge 365
Set-TransportServer YourServerName -MessageTrackingLogMaxDirectorySize 10000MB

Posted July 20, 2015 by Prem Rana in EMS Commands (Powershell)

Use these commands to get a snapshot of the move throughput for completed moves   Leave a comment

$stats = Get-MoveRequest -MoveStatus Completed | Get-MoveRequestStatistics
$stats | sort totalmailboxsize | ft Alias,{$_.totalmailboxsize.ToMB()},totalinprogressduration -auto

Posted December 16, 2014 by Prem Rana in EMS Commands (Powershell)

This command spins through all your mailbox servers and reconnects all the uniquely identified but disconnected mailboxes in any one of the mailbox stores:   Leave a comment

$Servers = Get-ExchangeServer
$Servers | `
  Where { $_.IsMailboxServer -Eq ‘$True’ } `
  | ForEach { Get-MailboxStatistics -Server $_.Name `
  | Where { $_.DisconnectDate -NotLike ” } `
  | ForEach { Connect-Mailbox -Identity `
    $_.DisplayName -Database $_.DatabaseName} }

Posted July 8, 2014 by Prem Rana in EMS Commands (Powershell)

Wondering how many log files are generated per server every minute? Quickly find out by typing:   Leave a comment

 

Get-MailboxDatabase -Server $env:ComputerName | ?{ %{$_.DatabaseCopies | ?{$_.ReplayLagTime -ne [TimeSpan]::Zero -And $_
.HostServerName -eq $env:ComputerName} } } | %{ $count = 0; $MinT = [DateTime]::MaxValue; $MaxT = [DateTime]::MinValue;
Get-ChildItem -Path $_.LogFolderPath -Filter “*????.log” | %{ $count = $count + 1; if($_.LastWriteTime -gt $MaxT){ $MaxT
= $_.LastWriteTime}; if($_.LastWriteTime -lt $MinT){ $MinT= $_.LastWriteTime} }; ($count / ($MaxT.Subtract($MinT)).Tota
lMinutes) } | Measure-Object -Min -Max -Ave

Posted June 30, 2014 by Prem Rana in EMS Commands (Powershell)

How to Count Number of Mailboxes in Exchange 2010 Using Powershell   Leave a comment

Command to count all type of mailboxes in Exchange Management Shell

Get-Mailbox -ResultSize Unlimited | measure-object

Command to count Specific type of mailboxes in Exchange Management Shell

Get-Mailbox -ResultSize Unlimited | where {$_.ResourceType -eq “Equipment”} | measure-object

Command to count mailboxes on a specific server in Exchange Management Shell

Get-Mailbox -ResultSize Unlimited | where {$_.ServerName -eq “SERVERNAME”} | measure-object

Posted April 23, 2014 by Prem Rana in EMS Commands (Powershell)

How to Change the SCL (Spam Confidence Level) Junk Threshold in an Organization in MS Exchange using Powershell   Leave a comment

 

Set-OrganizationConfig –SCLJunkThreshold “SCL Value”

Posted September 1, 2013 by Prem Rana in EMS Commands (Powershell)