Manage Exchange 2010 Database Log Growth by Using the Troubleshoot-DatabaseSpace.ps1 Script in the Shell

The Troubleshoot-DatabaseSpace.ps1 script is used by Microsoft System Center Operations Manager 2007 to detect and correct any excess log growth or Microsoft Exchange database (.edb) file growth that, if unchecked, may cause database downtime. By default, System Center Operations Manager 2007 runs the script every 15 minutes. However, you can use Task Scheduler to configure and run this script to monitor database log and file growth.

The Troubleshoot-DatabaseSpace.ps1 script performs the following actions:

  1. Keeps track of log generation rate for the highest log generators per database. This helps determine which users are logging too heavily and potentially causing space issues.
  2. Keeps track of the available disk space for both the database and the log files. If either of these is within a configurable threshold of being full, further action must be taken.
  3. Keeps track of the log generation rate. If it appears that the disk is going to run out of space within the value specified by the HourThreshold parameter (based on the log generation rate), further action must be taken.

    noteNote:

    To avoid critical issues, make sure the value for the HourThreshold parameter is large enough to give you time to react during normal business hours while enough free space is available. If drives are filling up faster than the value specified, immediate action must be taken to protect the disk.

  4. If all of the preceding conditions are fulfilled, the script determines the list of top 25 users who accessed the database during the last one-hour period. The script then quarantines the top high-usage mailboxes for which the sum of the log generation rate is greater than the difference between the current generation rate and the sustainable generation rate that would allow tiding over the configurable time threshold. These users are quarantined for six hours, during which they won’t have access to e-mail.
  5. If the troubleshooter is unsuccessful at dropping the log generation rate to below the threshold level, it will write out events that translate into health model alerts. At this point, the script removes the database from provisioning by running the Set-MailboxDatabase cmdlet with the ExcludeFromProvisioning parameter set to $true against the specified database. You may need to move mailboxes to a new server to rebalance space.
  6. If the troubleshooter quarantines more than 10 users, this indicates a systemic issue, which you need to follow up on. The health model will trigger an urgent alert from this condition.

The default settings used in the Troubleshoot-DatabaseSpace.ps1 script are defined in the StoreTSConstants.ps1 script.

Command: .\Troubleshoot-databasespace.ps1 -server MBX01 -PercentLogFreeSpace 10 -PercentEDBFreeSpace 10 -HourThreshold 5 -Quarantine

Taskscheduler: powershell.exe -PSConsoleFile “C:\Program Files\Microsoft\Exchange Server\V14\bin\exshell.psc1” -command “. ‘C:\Program Files\Microsoft\Exchange Server\V14\Scripts\Troubleshoot-databasespace.ps1’ –server EX01 -PercentLogFreeSpace 10 -PercentEDBFreeSpace 10 -HourThreshold 1 -Quarantine”

Exchange Tools

Here I’ll share some free tools that can help simplify Microsoft Exchange deployment, troubleshooting, and administration. Some of the tools are simple—but still convenient—whereas others provide some powerful functionality.

There are some tools you can use during deployment to ease the process and reduce issues in the future, tools you can use for troubleshooting to reduce down-times, and tools you can use during day-to-day administration to monitor server health and perform tasks.

Microsoft Exchange Server Deployment Assistant

Microsoft’s Exchange Server Deployment Assistant is an online tool that produces a custom step-by-step checklist you can utilize during a server installation or upgrade. It first asks you questions about your current and desired deployment environment, such as the deployment type (on-premise, cloud, or hybrid), migration questions, desired features/functionality, and other miscellaneous caveats that impact the installation or upgrade.

Microsoft Remote Connectivity Analyzer

Microsoft’s Remote Connectivity Analyzer is a website with many tools to help test and troubleshoot connectively of Exchange servers, Outlook, Lync, OCS, Office 365, and POP, IMAP, and STMP email. Plus it offers downloadable Connectivity Analyzer Tools for local testing and a message header analyzer.

PFDAVAdmin and ExFolders
These are tools that enable you to perform tasks on Exchange public folders and mailboxes, such as checking or changing permissions. It can also connect to mailboxes, check the contents, and generate reports. PFDAVAdmin is for Exchange 2000, 2003, and 2007 and ExFolders is the updated version for Exchange 2007 and 2010 SP1 and later.

Jetstress

The Jetstress tool simulates disk I/O load on your server, allowing you to specify the amount of simulated Exchange users and profiles. This can help you verify the performance and stability of your server before installing Exchange and putting it into production-use.

Exchange Server Role Requirements Calculators

These are calculator tools that give sizing recommendations for your particular Exchange server roles for both client access and mailbox. The 2010 version is focused on mailbox calculations while the 2013 version includes recommendations on sizing Client Access servers too.

Exchange Environment Report

This Exchange Environment Report tool is from Steve Goodman and is a PowerShell script that generates an automatic overview of your Exchange environment. It supports Exchange 2003, 2007, 2010 and 2013 servers and database availability groups. It reports the number of and details about the servers, mailboxes, roles, and versions. It also gives you useful status on the Database Availability Groups (DAG) and non-DAG databases.

Exchange Reports

Exchange Reports offers reports on overall information about your Exchange Environment, supporting Exchange 2010 & Exchange 2013. You can keep an eye on configuration changes and status with Group Reports, Single Group Information, Mailbox Report, Single Mailbox Information, Message Tracking, and Environment Report.

The program doesn’t require any installation, but requires .Net 4.0, Powershell 2.0, and Remote Powershell access to the Exchange Server. Reports can be saved in history and also exported to Excel.

Microsoft Exchange Server MAPI Editor (MFCMAPI)

Microsoft’s Microsoft Exchange Server MAPI Editor (MFCMAPI) tool provides access to MAPI stores, useful when troubleshooting Exchange and Outlook issues, which can serve as a replacement to the old Microsoft Exchange Server Information Store Viewer. You can open and navigate through the message stores that are exposed through MAPI.

Free Exchange Monitor

The Free Exchange Monitor from SolarWinds supports Microsoft Exchange Server 2000 and 2003. It keeps tabs on the Exchange server stats, services, mail queue sizes, and host server health. In addition to notifying you of outages it can be useful in troubleshooting Exchange server problems and even help with pro-active monitoring, for instance detecting growing mail queues that can indicate bigger issues like transport failures, Internet connection failures, and virus activity.

Free Exchange Monitoring

This is another monitoring application, but from ManageEngine and supports Exchange Server 2003, 2007, 2010, and 2013. It gives stats on server health and Exchange services. It also provides details on the client access server, transport, Active Sync counters, and delivery aspects. You can generate real-time performance reports to be downloaded or emailed in PDF format.

Exclaimer Outlook Photos

Exclaimer Outlook Photos can help you import staff photos into the Active Directory so they’ll show up in the Outlook People Pane, SharePoint profile, and on Microsoft Lync. It can auto-match pictures from a batch to names or other data in Active Directory, and even automatically crop and center the photos as well.

Certificate Manager for Exchange 2007

Exchange 2007 enables SSL within IIS by default, but creating and managing SSL certificates via PowerShell commands can be confusing. However, the Certificate Manager for Exchange 2007 from U-BTech eases the process with a GUI.

You can generate an Exchange 2007 Certificate Signing Request and process the Certificate Authority and enable certificates for Exchange 2007 Services (POP, IMAP, SMTP, IIS, UM). Plus you can include additional subject names in a single certificate. It supports import and exporting as well.

Exchange PST Capture

Exchange PST Capture from Microsoft will search your network for PST files and then import those files to mailboxes in your organization. It supports both on-premises Exchange Server 2010 and 2013 and Exchange Online. This tool can help, for instance, during the initial deployment of an Exchange Server, to move local Outlook data files into the Exchange Server.

LINK

Exchange Shared Cache Service restarts frequently in Exchange Server 2013 Cumulative Update 5

After you install Microsoft Exchange Server 2013 Cumulative Update 5, your monitoring solution indicates that the Microsoft Exchange Shared Cache Service restarts frequently.

This problem occurs because the managed availability probes that monitor this service have a time-out value that is too sensitive for standard operation. This causes the managed availability process to restart the service.

As of Exchange Server 2013 Cumulative Update 5, this notice and the frequent restarts of the managed availability process are considered not to be a concern.
Therefore, you can safely ignore the problem.

Microsoft has published a Windows PowerShell script that you can use to disable the probes to prevent the Exchange Shared Cache service from restarting.

Download the script.

Exchange Powershell Scripts that Every Exchange Admin need to have

The Following Powershell scripts that every Exchange Admin must have Glimlach

Test-ExchangeServerHealth
Get-DagHealth
PelNet.ps1
ADinfo.ps1
Get-VirDirInfo.ps1
CertificateReport.ps1
Get-EASdevicereport.ps1
Get-MailboxReport.ps1
Get-DailyBackupAlerts.ps1
Install-Exchange2013.ps1

Exchange 2013 RMS Shared Identity user FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042 not found

Today I was re-installing Exchange 2013 into an Active Directory forest The schema was already extended with the Exchange 2013 schema extensions.

When installing Exchange 2013, installation of the Mailbox Transport role failed with the following error:

Error:
The following error was generated when “$error.Clear();
if ( ($server -eq $null) -and ($RoleIsDatacenter -ne $true) )
{
Update-RmsSharedIdentity -ServerName $RoleNetBIOSName
}
” was run: “RMS Shared Identity user FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042 not found.”.

FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042 is a Exchange 2013 built in arbitration user account which must exist in every Exchange 2013 environment. The GUID never changes, it is always “4c1f4d8b-8179-4148-93bf-00a95fa1e042”.

The setup failed because someone deleted this user account from Active Directory!

How can we get it back?

You have two ways to get this mailbox back. If you have a computer on your network with the Exchange 2010 management tools installed, you can create the user account using powershell with the following command:

New-Mailbox -Arbitration -Name FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042 -UserPrincipalName FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042@default_accepted_domain

For more information on this see Microsoft KB978776

What happens if you do not have exchange management shell installed on any computers? Well there is another way to get this account back. This account is originally created when you prepare the domain/schema. If you run setup.com /PrepareAD on your domain it will re-create this account for you. See below:

Script Browser for Windows PowerShell ISE

Script Browser for Windows PowerShell ISE enables you to search for over 9000 script samples in the TechNet Script Center from within the scripting environment.

image

Download

Microsoft Virtual Machine Converter 2.0

    Microsoft® Virtual Machine Converter (MVMC) is a Microsoft-supported, stand-alone solution for the information technology (IT) pro or solution provider who wants to convert virtual machines and disks from VMware hosts to Hyper-V® hosts and Windows Azure™.
    MVMC can be deployed with minimal dependencies. Because MVMC provides native support for Windows PowerShell®, it enables scripting and integration with data center automation workflows such as those authored and run within Microsoft System Center Orchestrator 2012 R2. It can also be invoked through the Windows PowerShell® command-line interface. The solution is simple to download, install, and use. In addition to the Windows PowerShell capability, MVMC provides a wizard-driven GUI to facilitate virtual machine conversion.
    New Features in MVMC 2.0
    MVMC 2.0 release of MVMC includes the following new features:

    • Converts virtual disks that are attached to a VMware virtual machine to virtual hard disks (VHDs) that can be uploaded to Windows Azure.
    • Provides native Windows PowerShell capability that enables scripting and integration into IT automation workflows.
      Note The command-line interface (CLI) in MVMC 1.0 has been replaced by Windows PowerShell in MVMC 2.0.
    • Supports conversion and provisioning of Linux-based guest operating systems from VMware hosts to Hyper-V hosts.
    • Supports conversion of offline virtual machines.
    • Supports the new virtual hard disk format (VHDX) when converting and provisioning in Hyper-V in Windows Server® 2012 R2 and Windows Server 2012.
    • Supports conversion of virtual machines from VMware vSphere 5.5, VMware vSphere 5.1, and VMware vSphere 4.1 hosts Hyper-V virtual machines.
    • Supports Windows Server® 2012 R2, Windows Server® 2012, and Windows® 8 as guest operating systems that you can select for conversion.
    Standard MVMC Features
    In addition to the new features previously identified, MVMC provides the following functionality:

    • Converts and deploys virtual machines from VMware hosts to Hyper-V hosts on any of the following operating systems:
    • Windows Server® 2012 R2
    • Windows Server® 2012
    • Windows Server 2008 R2 SP1
    • Converts VMware virtual machines, virtual disks, and configurations for memory, virtual processor, and other virtual computing resources from the source to Hyper-V.
    • Adds virtual network interface cards (NICs) to the converted virtual machine on Hyper-V.
    • Supports conversion of virtual machines from VMware vSphere 5.5, VMware vSphere 5.0, and VMware vSphere 4.1 hosts to Hyper-V.
    • Has a wizard-driven GUI, which simplifies performing virtual machine conversions.
    • Uninstalls VMware Tools before online conversion (online only) to provide a clean way to migrate VMware-based virtual machines to Hyper-V.
      Important MVMC takes a snapshot of the virtual machine that you are converting before you uninstall VMware Tools, and then shuts down the source machine to preserve state during conversion. The virtual machine is restored to its previous state after the source disks that are attached to the virtual machine are successfully copied to the machine where the conversion process is run. At that point, the source machine in VMware can be turned on, if required.
      Important MVMC does not uninstall VMware Tools in an offline conversion. Instead, it disables VMware services, drivers, and programs only for Windows Server guest operating systems. For file conversions with Linux guest operating systems, VMware Tools are not disabled or uninstalled. We highly recommend that you manually uninstall VMware Tools when you convert an offline virtual machine.
    • Supports Windows Server and Linux guest operating system conversion. For more details, see the section “Supported Configurations for Virtual Machine Conversion” in this guide.
    • Includes Windows PowerShell capability for offline conversions of VMware-based virtual hard disks (VMDK) to a Hyper-V–based virtual hard disk file format (.vhd file).
      Note The offline disk conversion does not include driver fixes.

Download

HV Backup A free Hyper-V backup Tool

HVbackup is a very easy and powerful free tool to backup and restore Hyper-V virtual machines, in standalone and clustered (CSV) environments, overcoming all the limitations that a generic tool like Diskshadow provides.
This tool targets Windows 2008 (R2) and Windows Server 2012 (R2). All the corresponding core and free Hyper-V editions are also supported!
HVBackup supports app consistent and crash consistent backups through the Hyper V VSS writer component integrated in the operating system.
There are quite a few expensive commercial solutions on the market supporting this scenario, but this is the first open source one, based on the research we did before publishing the project.
We integrated this tool in our datacenter’s production environment management infrastructure, which means that it undergoes continuous testing in a real world environment 🙂
HVBackup can be invoked from the command line, scripted with Powershell or integrated in any .Net program through it’s class library.
The backup process generates a separate zip file for each virtual machine in the specified output directory, containing all the files owned by the VM and identified for backup by the VSS Hyper-V provider.
Requirements:
.Net Framework 3.5, which can be easily enabled on the command line.

Samples:

HVBackup -a -o c:\backup
Performs a full VSS backup (using the HyperV VSS writer) of all VMs on the host.
HVBackup -l VM1,VM2 -o \\yourserver\backup
Performs a full VSS backup of the provided list of VMs (use quotes if the names contain spaces).
In this sample the output directory is on a remote server.
HVBackup -f list.txt -o c:\backup
Performs a full VSS backup of the VMs names provided in “list.txt”, one per line.

How to perform a scheduled backup

backup.cmd :

set BCKPATH=\\yourserver\yourpath
net use %BCKPATH% /user:<user> <password>
pushd %BCKPATH% && forfiles.exe -m *.zip -d -7 -c “cmd /c del @path”
popd
HVBackup.exe -a -o %BCKPATH% 1> lastlog_out.txt 2> lastlog_err.txt

Note: This script will delete every zip file older than 7 days in the target directory before performing a backup of all the VMs on the host. Change it accordingly to your needs.

Now, as we don’t have a scheduled task UI on hyper-v or server core, in order to schedule the previous script every night at 01 AM, just run:

schtasks.exe /create /tn HVBackup /tr c:\hvbackup\backup.cmd /sc DAILY /ru <username> /rp /st 01:00:00

Tool: http://hypervbackup.codeplex.com/

Download: HVBackup_1_0_beta1_20120330.zip Windows 2008 (R2) and Windows Server 2012

Download: HVBackup_1_0_1_Beta.zip Windows Server 2012 R2

Cumulative Update 3 for Microsoft Exchange Server 2013

Issues that the cumulative update resolves

Cumulative Update 3 for Microsoft Exchange Server 2013 contains the fix for the security issue that is described in Security Bulletin MS13-061

(http://technet.microsoft.com/en-us/security/bulletin/MS13-061)

and resolves the issues that are described in the following Microsoft Knowledge Base (KB) articles:

  • 2865161 “Errors: Failed exporting item id: from source id” when you try to copy search results in an Exchange Server 2013 environment

  • 2866064 Can’t load OWA Premium by using Internet Explorer 11 in an Exchange Server environment

  • 2871980 Child domains are not displayed for selection when you create a mailbox by using EAC in an Exchange Server 2013 environment

  • 2874216 Security issue that is described in Security Bulletin MS13-061 is resolved by an Exchange Server update

  • 2878160 “The Active Directory user wasn’t found” error when you create or update an In-Place eDiscovery search in an Exchange Server 2013 environment

  • 2882608 Exchange Server 2013 does not share the inproxy.dll file

  • 2886115 Retention policies are not applied to Exchange Server 2013 mailboxes when user accounts are on different domains

  • 2888274 WebClientReadFormQueryString string and WebClientEditFormQueryString string return incorrect URLs in an Exchange Server 2013 environment

  • 2888315 Event 2112 or 2180 is logged when you try to back up a database in an Exchange Server 2013 environment

  • 2888612 Retention policy does not work after you run a cmdlet in an Exchange Server 2013 environment

  • 2889786 Sign-in format for Outlook Web App on mobile devices is not adjusted according to the Set-OwaVirtualDerictory cmdlet in an Exchange Server 2013 environment

  • 2890650 Items in the Drafts folder are not stamped with the retention policy tag in an Exchange Server 2010 or 2013 environment

  • 2895487 “Copy Search Results” option does not work in an Exchange server 2013 environment

  • 2895500 DBCS characters appear garbled when you run some PowerShell scripts in EMS in an Exchange Server 2013 environment

  • 2895678 “Nombre de usuario\dominio” is displayed unexpectedly on the Spanish version of the OWA and EAC logon pages in an Exchange Server 2013 environment

  • 2902929 You cannot forward an external meeting request in an Exchange Server 2013 environment

  • 2902933 “Generate incident report” does not display the “Bcc” field in an Exchange Server 2013 environment

  • 2902934 Korean language localization issue in Exchange 2013 OWA user interface

  • 2902936 You cannot change SMTP addresses for distribution groups by using EAC in an Exchange Server 2013 environment

  • 2902938 You cannot preview Office documents in shared folders by using Outlook Web App in an Exchange Server 2013 environment

  • 2902939 EMS connection error when you separately install an Exchange Server 2013 Mailbox server and a Client Access server

  • 2883203 Exchange Server 2013 restarts frequently after Cumulative Update 2 is installed

  • 2890814 No redirection to the Outlook Web App URL for Exchange Online users in an Exchange hybrid deployment

Download

Removing Windows 8.1 Built-in Applications

Last year Ben Hunter published a PowerShell script that is designed to remove the built-in Windows 8 applications when creating a Windows 8 image. Well now that Windows 8.1 has been released it must update the PowerShell script to work with Windows 8.1.

The script below takes a simple list of Apps and then removes the provisioned package and the package that is installed for the Administrator. To adjust the script for your requirements simply update the $AppList comma separated list to include the Apps you want to remove. The script is designed to work as part of an MDT or Configuration Manager task sequence. If it detects that you are running the script within a task sequence it will log the to the task sequence folder otherwise it will log to the Windows\temp folder.

I chanced the script a little bit. I don’t want to remove some programs dat Ben Hunter did…

The Script:

<#    
    ************************************************************************************************************
    Purpose:    Remove built in apps specified in list
    Pre-Reqs:    Windows 8.1
    ************************************************************************************************************
#>

#—————————————————————————————————————
# Main Routine
#—————————————————————————————————————

# Get log path. Will log to Task Sequence log folder if the script is running in a Task Sequence
# Otherwise log to \windows\temp

try

{
$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment
$logPath = $tsenv.Value(“LogPath”)
}
catch
{
Write-Host “This script is not running in a task sequence”
$logPath = $env:windir + “\temp”
}
$logFile = “$logPath\$($myInvocation.MyCommand).log”

# Start logging
Start-Transcript $logFile
Write-Host “Logging to $logFile”

# List of Applications that will be removed

$AppsList = “microsoft.windowscommunicationsapps”,”Microsoft.BingFinance”,”Microsoft.BingMaps”,`
“Microsoft.BingWeather”,”Microsoft.ZuneVideo”,”Microsoft.ZuneMusic”,”Microsoft.Media.PlayReadyClient.2″,`
“Microsoft.Media.PlayReadyClient.2″,”Microsoft.XboxLIVEGames”,”Microsoft.HelpAndTips”,”Microsoft.BingSports”,`
“Microsoft.BingNews”,”Microsoft.BingFoodAndDrink”,”Microsoft.BingTravel”,”Microsoft.WindowsReadingList”,`
“Microsoft.BingHealthAndFitness”,”Microsoft.WindowsAlarms”,”Microsoft.Reader”,”Microsoft.WindowsSoundRecorder”,”Microsoft.SkypeApp”

ForEach ($App in $AppsList)

{
$Packages = Get-AppxPackage | Where-Object {$_.Name -eq $App}
if ($Packages -ne $null)
{
  Write-Host “Removing Appx Package: $App”
  foreach ($Package in $Packages)
      {
      Remove-AppxPackage -package $Package.PackageFullName
      }
}
else
{
      Write-Host “Unable to find package: $App”
}
$ProvisionedPackage = Get-AppxProvisionedPackage -online | Where-Object {$_.displayName -eq $App}
if ($ProvisionedPackage -ne $null)
{
      Write-Host “Removing Appx Provisioned Package: $App”
      remove-AppxProvisionedPackage -online -packagename $ProvisionedPackage.PackageName
}
else
{
      Write-Host “Unable to find provisioned package: $App”
}

}

# Stop logging
Stop-Transcript

Translate »