Skip to main content

Posts

Showing posts from December, 2004

Showing how much whitepace is in your database via script

Continuing on from some of my last weeks entries, When the Information Store maintenance process runs it logs to the windows eventlogs the results of its retention and de-fragmentation operations. More importantly it tells you how much space is held in deleted item retention (and how much it just released). How much space is held in deleted mailbox retention and how much it just released. And finally how much free-space there is in the database after the online de-fragmentation has just run. So what this script does is query AD for all the mail and public folder stores in your domain. Then it querys each servers event log for 3 specific events that contain the details of the 3 maintenance operations and then parses the result out of that text and displays the result at the commandline. Event “1221” is logged after an online de-fragmentation is run on a mailbox or public folder store. Event “1027” is logged after the deleted item retention cleanup is done and the result of starting and ...

Finding when a Exchange Store last backed up via script

There are a couple of ways you can determine when the last time a particular exchange store was backed up if you're using a program that backs up via the Exchange Backup API (Veritas,Brightstore etc). With Exchange 2003 a new function was added into System Manager to allow you to see the "Time of Last Full Backup" on the database tab. This property is also available in CDOEXM (if you have the 2003 version of system manager loaded on the machine). The ".LastFullBackupTime" property was added to the IMailStoreDB and IPublicStoreDB interfaces. Using this is pretty easy all you have to do is to open the mailstore using the LDAP DN path and access the property eg set mdbobj = createobject("CDOEXM.MailboxStoreDB") mdbobj.datasource.open "LDAP://mbdDNpath" Wscript.echo "Last Backed Up : " & mdbobj.LastFullBackupTime I've put this together with a similar query from my previous post and this script selects all the exchange stores in...

Listing the file sizes of all Exchange Stores on all Exchange Servers in a Domain V2

[updated fixed new bug when there's more then one mailbox store on a server] I've had a bit of feedback about the first version of the script that i posted here so I decided to give it a quick revise and add some additional functionality. The additional functionality added to this script is that instead of just returning the size of each store file it also now returns the freespaces left of the disk where the file is located and the percentage of the diskspace that is free. Also there are some fixes for it to allow the script to work when there are more then 1000 mailboxes. I've posted a copy of the new code up here set conn = createobject("ADODB.Connection") set com = createobject("ADODB.Command") Set iAdRootDSE = GetObject("LDAP://RootDSE") strNameingContext = iAdRootDSE.Get("configurationNamingContext") rangeStep = 999 lowRange = 0 highRange = lowRange + rangeStep Conn.Provider = "ADsDSOObject" Conn.Open "ADs Provi...

Setting Outlook 2003 Junk Email Options Programmatically

[If you are trying to do this using Exchange 2007 please see http://gsexdev.blogspot.com/2007/07/turning-on-filter-junk-email-in.html ] The Outlook 2003 Junk email filter has a number of different options that can be configured through (tools-options) that determine how the filter will treat email it detects as spam in your inbox. The configuration settings are stored on a hidden extendedrule message in a user’s inbox. The options settings are held in two MAPI properties on this hidden message the first one being http://schemas.microsoft.com/mapi/proptag/0x61010003 which stores a long value that sets that level of junk email protection you want the long values for each of the setting are No Automatic filtering = -1 Low = 6 High = 3 Safe Lists only = -2147483648 The “Permanently delete suspected junk e-mail instead of moving it to the Junk E-mail folder” is stored in the http://schemas.microsoft.com/mapi/proptag/0x61020003 as Disabled = 0 Enabled = 1 On a new mailbox or a mailbox where...
All sample scripts and source code is provided by for illustrative purposes only. All examples are untested in different environments and therefore, I cannot guarantee or imply reliability, serviceability, or function of these programs.

All code contained herein is provided to you "AS IS" without any warranties of any kind. The implied warranties of non-infringement, merchantability and fitness for a particular purpose are expressly disclaimed.