Posts Tagged ‘Exchange’

So what started this is actually quite simple. We have limited space on our virtual machines and the log files for IIS keeping filling up the drive on our Hub Transport Server (Exchange Server 2010). It is a little know fact, that a certain amount of free space on C: is needed on an Exchange Hub Transport Server, the magic number happens to be 15%. There are a few ways to solve the log file issue. I found this solution. This deletes all files older than 7 days. This can, of course, be modified to suit your needs, I personally have chosen 14 days. Some people choose more, it is basically a case of whatever works best for.

I could simple set this a scheduled task and allow this to run every few days and keep the log files to a reasonable size. However, I have orchestrator and was thinking that this would be a great chance to get my hands dirty and start to show the benefit of Orchestrator to some of the staff in our IT department. I know those that know Orchestrator, are saying “you have to convince them how good Orchestrator is?” and the answer is a resounding “YES”. Anyways, back onto topic here. Below is a diagram of the orchestration. I will go into more detail around my thinking for each step. Hopefully someone can learn from this and help drive the value of System Centre Orchestrator Smile


So, the first bit is simply a monitor allowing you specify how often you would like the Runbook to Run.



Next up, is a simple “Disk Space” monitor found under “Monitoring”


I have configured the parameters as needed.


I also tweaked the security parameters as needed to an account that has the required rights for checking Drive Space on the required server.


For the next step, I modified the “Link Properties” to match my needs of checking of the Disk Space to return a value that will allow the rest of the Runbook to run. It is simply a case of Clicking “Add” and then selecting the required values to check for. I chose “Percentage of Space Available” from Component Before “is less than” Desired percentage.


This is why I chose to create a runbook, my staff and Company like to be informed of any changes made on servers. So now I send an e-mail stating that the free space is low to the necessary recipients.


Now, I create a folder to allow for creation of text files for the logging of which files will be deleted. (more on this later)


I also use published data from earlier in the Databus to create unique folders based on date and time.


Now, I create a list of all the files to be deleted and read them into a “log file” and place them in the folder created above for “Auditing” purposes. I had to run this through a PowerShell script and there are some limitations with Orchestrator and Impersonating another account within PowerShell. I will continue to work on this to clean it up.

Please note that *subscribeddata* means data from earlier up the Databus, namely folder locations.


I run the below PowerShell script.

This reads the files to be deleted, older than 14 days, creates a log file, and reads the log file into the body of the e-mail.

net use H: *subsribeddata* /user:europcar\administrator &lt;password&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $files=get-childitem -Path \\ms-ec-exc01\C$\inetpub\logs\LogFiles -recurse | where-object {$_.lastwritetime -lt (get-date).addDays(-14)}| out-file -filepath "H:\logs.txt" -append<br>$body = (get-content *subscribeddata&gt;*logs.txt -encoding ASCII | out-string)<br>send-mailmessage -attachments &lt;subscribed data&gt;\logs.txt -body $body -to "" -from "" -subject "Files to be deleted" -smtpserver<br>net use h: /delete

Now it is time to delete the actual files


net use H: *subsribeddata* /user:europcar\administrator *password*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $files=get-childitem -Path \\ms-ec-exc01\C$\inetpub\logs\LogFiles -recurse | where-object {$_.lastwritetime -lt (get-date).addDays(-14)}| remove-item –recurse<br>net use h: /delete

Now it is time to check the Disk Space is at an adequate level.


Modify the link Properties again to meet new requirements. So, I have tweaked the script to ensure that the free space is now above my threshold ( I have set mine to 15%)



And then finally send an e-mail stating that the free space is now adequate. Tweaked to meet my needs with Subscribed data in the body and subject.


Please note that this information is provided as is. I can assist as much as possible. Please TEST, TEST and TEST again.

Hope this helps,

Follow me.




Not that long ago, I ran into a strange issue with my Exchange Environment.I had already configured by Exchange Backups and these had been running for quite some already. However, now all of a sudden the backups are NOT running to completion. So, checking the size of the “LOG” drives. i see that the logs are not being cleared and this appears to be the issue for the backup not running to completion.


So, this is how you fix the issue.

Open the Exchange Console, on the affected Mailbox Store, enable Circular Logging (temporarily, not permanently as this can lead to other issues especially with backups), dismount and remount the Mailbox Store for the setting to take affect. Once the logs have been cleared, you can check this by checking the free space on your “LOG” drives. Once the logs are cleared. Go to the “Mailbox Store” and then disable “Circular Logging” and dismount and remount the Mail Store, Run your DPM backup again and all should be now fixed.

Hope this helps,

Follow me.

facebook-small322252222 twitter-small322252222



Hi All,

It has been a really busy time for me. However, I am very happy with life at the moment. Just recently I received a “Microsoft Community Contributor” award from Microsoft.


I know I have been a little quite the last little while. I have been busy doing a job that everyone loves (I wish there was a font for sarcasm). I have been VERY busy documenting my production environment including Hyper-V, Active Directory and Exchange. This is a long and tiresome process, however PowerShell has been a phenomenal help and I thought I would share a few bits of code from PowerShell that have made my life a little easier in this process.


A script to list all GPO in required Domain

Import-Module grouppolicy
#command to get all GPOS
get-gpo -all -Domain domainname

A script to backup all GPOs for said domain

Import-Module grouppolicy
#command to backup all GPOS
Backup-GPO -All -Domain domainname -Path filepath


A script to pull the IP address listed within a Receive Connector

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Support
Get-ReceiveConnector -Server <nameoripofHTServer>
Get-ReceiveConnector -Identity "<name of identity>" | Select-Object -ExpandProperty RemoteIPRanges


A script to pull the VMs being controlled by Virtual Machine manager and sort them by Host Name for easier documentation.

Add-PSSnapin Microsoft.SystemCenter.VirtualMachineManager
Get-VMMServer nameofvmmserver
Get-VM -VMMServer nameofvmmserver | Select-Object -Property Name, Owner, Description, HostName, OperatingSystem, CPUCount, Memory | Sort-Object -Property HostName

Really hope this helps some other people as well.

Follow me

facebook-small3222 twitter-small3222


So, it has been another week and as always something new has been learnt. This time, however the product in question was Exchange Server 2010. We had some unexpected downtime for e-mail, so being the cautious person I am, i start checking Exchange. This is the story and the bizarre end result i had. Details to follow.

So here is the situation. I log onto our OWA in the morning and I am able to connect without any issue. So a good start. For me, the next step is to open Outlook and connect to Exchange via OutlookAnywhere, also worked, so far so good. So I make my way into the office and i decide to check Exchange further. I RDP onto the required servers and start checking services, all services are started and functioning. Great!!!! I check the mailbox stores and everything is mounted with no errors. So, you are probably asking what is so strange.

Enter the strangeness!!!!!

I run a get-queue and to my horror only a single comes back, now I know that sometimes after a reboot, it takes some time for all correct queues to show up. So, send myself a test e-mail from myself to myself and I was expecting to see a mail queue with messages being delivered to the mailbox store. NO SUCH LUCK, and of course the e-mail was NOT delivered to me.

So, to sum up

1. All servers are up and functioning

2. All services on the server are up and running

3. All Mailbox Stores are up and mounted

4. External Connectivity is available


So now onto some more troubleshooting.

I checked the server and found that there was some free space on the Hub Transport but as it turns out NOT ENOUGH. I discovered this by removing some unnecessary files on the server and I performed a get-queue and I had a few more queues. Great, Progress!!!!

So now, after running through a few additional steps. (Tested on Exchange 2010)

1. Pause the Microsoft Exchange Transport Service (this allows the queue to be processed cleanly (without adding any additional messages)

2. Copy mail queue data folder (default “c:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\data\Queue) to a safe place( rather safe than sorry)

3. Navigate to Exchange Queue Folder (c:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\data\Queue)

4. Use eseutil to determine shutdown state. eseutil /mh mail.que

5. If the state is “Dirty Shutdown”. eseutil /p mail.que to repair the file (if “Clean Shutdown” move to next step)

6. Run eseutil /d mail.que

7. Restart Microsoft Exchange Transport Service

So now, you should be back up and running and mailflow has been restored, but now how the heck do you prevent this from happening again?

Enter “EdgeTransport.exe.config” (“c:\Program Files\Microsoft\Exchange Server\V14\Bin”)

The entries listed below can de modified to move the folder that holds mail.que onto a separate drive with more space.

<add key="QueueDatabasePath" value = "C:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\data\Queue" />

<add key="QueueDatabaseLoggingPath" value = "C:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\data\Queue" />

<add key="IPFilterDatabasePath" value = "C:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\data\IpFilter" />

<add key="IPFilterDatabaseLoggingPath" value = "C:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\data\IpFilter" />

<add key="TemporaryStoragePath" value = "C:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\data\Temp" />

Simply modify the values to meet the folder requirements on the new drive.

Follow me

facebook-small32 twitter-small32