Recently I was facing an issue where Windows Server 2012 R2 reported remaining 22% of free disk space of one of the Exchange Server data volumes. The Exchange Server data volumes are connected using mount points.
Before trying to identify any issues in regards to hidden system files or streams, I checked the volume shadow copy configuration using the Disk Management MMC.
Windows Disk Management showed that volume C: was using a mounted volume as shadow copy target.
Examining the available disk space using the Get-Diskspace.ps1 PowerShell script, it showed that WMI was reporting the FreeSpace the same way as the Disk Management.
[PS] D:\SCRIPTS\Get-Diskspace>.\Get-Diskspace.ps1 -ComputerName EX01 Fetching Volume Data from EX01 Name Capacity (GB) FreeSpace (GB) BootVolume SystemVolume FileSystem ---- ------------- -------------- ---------- ------------ ---------- E:\ExchangeDatabases\DatabaseSet1\ 2048 1083 False False NTFS E:\ExchangeDatabases\DatabaseSet2\ 2048 445 False False NTFS E:\ExchangeDatabases\DatabaseSet3\ 2048 1219 False False NTFS E:\ExchangeDatabases\DatabaseSet4\ 2048 1091 False False NTFS
The only viable solution to reclaim the wasted disk space was to remove the shadow copy of volume C.
First I checked the current list of shadow copies using the vssadmin command line tool.
D:\>vssadmin list shadows vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool (C) Copyright 2001-2013 Microsoft Corp. Contents of shadow copy set ID: {eb09ce08-f8a6-47ea-b48d-2d6da7591d4e} Contained 1 shadow copies at creation time: 23.06.2017 16:05:56 Shadow Copy ID: {3684b224-bca2-42c4-a0b3-43b7d0db2d96} Original Volume: (C:)\\?\Volume{df40ac48-f610-11e3-80ce-806e6f6e6963}\ Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1 Originating Machine: ex01.granikossolutions.eu Service Machine: ex01.granikossolutions.eu Provider: 'Microsoft Software Shadow Copy provider 1.0' Type: ApplicationRollback Attributes: Persistent, No auto release, Differential
The vssadmin tool does not clearly state the path to the shadow copy volume. Therefore, it is much more convenient to identify the shadow copy target using Disk Management. But the output shows that the shadow copy is nearly six months old. So it's safe to delete this orphaned shadow copy.
You can easily delete all shadow copies of a selected volume using the following command
vssadmin delete shadows /for=c: /all
But it turned out that the shadow copy could not be deleted, even with administrative credentials in use.
D:\>vssadmin delete shadows /for=c: /all vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool (C) Copyright 2001-2013 Microsoft Corp. Error: Snapshots were found, but they were outside of your allowed context. Try removing them with the backup application which created them.
Needless to say, that a well-known third party solution is in use to backup the servers. The shadow copy remainers are copies created by the backup solution and were not properly removed after backup due to a system failure during backup.
But how can you remove the current shadow copy without tempering the exisiting permissions for your account?
Simply use the Disk Management MMC to modifx the current shadow copy configuration and the shadow copy is removed.
Switch to the command line and check for existing shadow copies.
D:\>vssadmin list shadows vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool (C) Copyright 2001-2013 Microsoft Corp. No items found that satisfy the query.
The oprhaned shadow copy is gone.
Now open the Settings windows for the source volume again and change the Located on this volume to be the same as the source volume anfd change the Use Limit to the same value for the volume that is configured on other servers.
Enjoy Volume Shadow Copies
This script fetches the disk volume (Win32_Volume) information via WMI and shows the results in the PowerShell command line window. Optionally, you can have the report sent as an Html email to a recipient of your choice.
The switch -AllExchangeServer simplifies gathering the disk volume information across all Exchange servers in your environment.
The following screenshot shows the command line output when using
.\Get-Diskpace.ps1 -ComputerName MYSERVER
The following screenshot shows an example of the html email output when using
.\Get-Diskpace.ps1 -ComputerName MYSERVER -SendMail -MailFrom postmaster@sedna-inc.com -MailTo exchangeadmin@sedna-inc.com -MailServer mail.sedna-inc.com
# EXAMPLE 1 # Get disk information from computer MYSERVER in MB Get-Diskpace.ps1 -ComputerName MYSERVER -Unit MB # EXAMPLE 2 # Get disk information from all Exchange servers and send html email Get-Diskpace.ps1 -AllExchangeServer -SendMail -MailFrom postmaster@sedna-inc.com -MailTo exchangeadmin@sedna-inc.com -MailServer mail.sedna-inc.com
This Powershell script has been optimized using the ISESteroids™ add-on. Learn more about ISESteroids™ here.
The new community script Get-Diskspace helps to fetch disk volume information from a single server or across multiple servers.
Currently the script supports a command line switch to gather disk volume information across all Exchange servers in your environment.
The following screenshot shows the command line output
The following screenshot shows the html email
# Get disk information from computer MYSERVER .\Get-Diskpace.ps1 -ComputerName MYSERVER # Get disk information from computer MYSERVER in MB .\Get-Diskpace.ps1 -ComputerName MYSERVER -Unit MB # Get disk information from all Exchange servers and send html email .\Get-Diskpace.ps1 -AllExchangeServer -SendMail -MailFrom postmaster@sedna-inc.com -MailTo exchangeadmin@sedna-inc.com -MailServer mail.sedna-inc.com
Enjoy.
You need assistance with your Exchange Server setup? You have questions about your Exchange Server infrastructure and going hybrid? You are interested in what Exchange Server 2016 has to offer for your environment?
Contact me at thomas@mcsmemail.de Follow at https://twitter.com/stensitzki
This script removes the proxy address(es) for a selected protocol from mail-enabled public folders.
Any proxy address with a given protocol is removed from the proxy addresses list.
The script can fix the alias of mail-enabled public folders as well. The code used is based upon a blog post by Shay Levy.
# EXAMPLE 1 # Check mail enabled public folders for proxy addresses having "MS:" as a protocol type. # Do not remove and update addresses, but log found addresses to RemovedAddresses.txt .\Clean-MailEnabledPublicFolders.ps1 -ProtocolToRemove "MS:*" # EXAMPLE 2 # Check mail enabled public folders for proxy addresses having "MS:" as a protocol type. # Remove and update addresses and log found addresses to RemovedAddresses.txt .\Clean-MailEnabledPublicFolders.ps1 -ProtocolToRemove "MS:*" -UpdateAddresses
This script deletes user from the NoSpamProxy NoSpamProxyAddressSynchronization database table [Usermanagement].[User] table that have not been removed by the NoSpamProxy Active Directory synchronization job.
The script was developed due to a process flaw in how Active Directory accounts are handled as part of a leaver process. So this script does not fix a software bug, but a process glitch.
Due to the Active Directory account process the accounts still exist in Active Directory and are synchronized to the NoSpamProxyAddressSynchronization database.
When executed without the -Delete parameter all identified users are wirtten the log file only.
# EXAMPLE 1 # Check for Active Directory existance of all users stored in NoSpamProxy database. Do NOT delete any users from the database. .\Remove-NspUsers.ps1 # EXAMPLE 2 # Delete users from NoSpamProxy database hosted on SQL instance MYNSPSERVER\SQLEXPRESS that do NOT exist in Active Directory. .\Remove-NspUsers.ps1 -Delete -SqlServerInstance MYNSPSERVER\SQLEXPRESS
This script reads the Exchange schema version from the Active Directory schema partition.
The Exchange organization name is fetched from Active Directory automatically. The script fetches at forest level:
The script fetches at domain level:
Code Samples
# Fetch all version information in the Active Directory forest .\Get-ExchangeServerVersionInfo.ps1
Sample Output:
PS D:\Scripts> .\Get-ExchangeServerVersionInfo.ps1 Exchange Server Schema and Object Information for forest [VARUNA.ROOT] Exchange Organization Name : VARUNA-GROUP Active Directory Schema rangeUpper: 15332 Working on VARUNA.ROOT MESO Container objectVersion : 13236 Exchange Configuration msExchProductId : 15.01.1466.003 Exchange Configuration objectVersion : 16213 Working on VARUNAGROUP.DE MESO Container objectVersion : 13236
Enjoy Exchange Server!
Given Microsoft’s success in building Exchange Online running on its Office 365 cloud platform, it has undoubtedly learned a few valuable lessons that can be applied to on-premises deployments.
In this whitepaper, ENow board member and Microsoft Exchange MVP Tony Redmond reveals how standardization, automation and monitoring played into Microsoft’s success with scaling its platform.
Download the Whitepaper here: http://enowsoftware.com/whitepaper/Improve-Your-Exchange-Deployment-by-Learning-from-Massive-Scale.pdf
Are you unsure, if you should migrate to Office 365? You want to know more about security of cloud applications and services? Your Exchange Server infrastructure requires an upgrade? Contact me via email: thomas@mcsmemail.de