Exchange 2003 whitespace
Is it possible to obtain free disc space, EDB size, and white space from the command line and export it to a file? Thanks John --- ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.clearswift.com **
Re: Exchange 2003 whitespace
Event 1221 in the Application log will tell you the amount of free space in the db at the time of online defrag. Can you use that plus filesystem info. about disk space and the size of the database files to get what you're looking for? You could write a Powershell script using the Get-Eventlog cmdlet to obtain the white space value, and the rest of it should be pretty straightforward. HTH, RS On Fri, Jul 23, 2010 at 5:01 AM, Ellis, John P. johnel...@wirral.gov.ukwrote: Is it possible to obtain free disc space, EDB size, and white space from the command line and export it to a file? Thanks John --- ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.clearswift.com **
RE: Exchange 2003 whitespace
Hi It does help, only I've not used Powershell before. I was hoping to use a batch file and use some command line swiches. Looks like time to investigate PS. Thanks John From: Richard Stovall [mailto:rich...@gmail.com] Sent: 23 July 2010 13:54 To: MS-Exchange Admin Issues Subject: Re: Exchange 2003 whitespace Event 1221 in the Application log will tell you the amount of free space in the db at the time of online defrag. Can you use that plus filesystem info. about disk space and the size of the database files to get what you're looking for? You could write a Powershell script using the Get-Eventlog cmdlet to obtain the white space value, and the rest of it should be pretty straightforward. HTH, RS On Fri, Jul 23, 2010 at 5:01 AM, Ellis, John P. johnel...@wirral.gov.uk wrote: Is it possible to obtain free disc space, EDB size, and white space from the command line and export it to a file? Thanks John --- ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.clearswift.com **
RE: Exchange 2003 whitespace
I put this together a while back to get the whitespace report weekly May help for a starting point, the rest should be able to be pulled out with the same array of servers and their WMI. strDate = Date() Const ForWriting = 2 Const ForReading = 1 strMail = us...@domain.com Dim fso Dim strLogFileName Set fso = CreateObject(Scripting.FileSystemObject) strLogFileName = Output _ Replace(Replace(replace(Now, /, _), :, _), , _) .txt Set fileDest = fso.OpenTextFile(strLogFileName, ForWriting, True) fileDest.WriteLine Begin WhiteSpace Report Script at now . VBCRLF arrComputers = Array(exchange servers HERE) Set dtmStartDate = CreateObject(WbemScripting.SWbemDateTime) Set dtmEndDate = CreateObject(WbemScripting.SWbemDateTime) DateToCheck = CDate(strDate) dtmStartDate.SetVarDate DateToCheck, CONVERT_TO_LOCAL_TIME dtmEndDate.SetVarDate DateToCheck + 1, CONVERT_TO_LOCAL_TIME For Each strComputer In arrComputers fileDest.WriteLine strComputer Set objWMIService = GetObject(winmgmts: _ {impersonationLevel=impersonate}!\\ strComputer \root\cimv2) Set colEvents = objWMIService.ExecQuery _ (Select * from Win32_NTLogEvent Where Logfile = 'Application' AND _ EventCode = '1221' AND SourceName = 'MSExchangeIS Mailbox Store' AND TimeWritten = ' _ dtmStartDate ' AND TimeWritten ' dtmEndDate ') For Each objEvent in colEvents Message = objEvent.Message fileDest.WriteLine Message Next Next fileDest.Close Set fileDest = fso.OpenTextFile(strLogFileName, ForReading) strText = fileDest.ReadAll fileDest.Close strNewText = Replace(strText, For more information, click http://www.microsoft.com/contentredirect.asp.;, ) Set fileDest = fso.OpenTextFile(strLogFileName, ForWriting) fileDest.WriteLine strNewText fileDest.Close Set fileDest = fso.OpenTextFile(strLogFileName, ForReading) Do Until fileDest.AtEndOfStream strLine = fileDest.ReadLine strLine = Trim(strLine) If Len(strLine) 0 then strNewContents = strNewContents strLine vbCRLF End If Loop fileDest.Close Set fileDest = fso.OpenTextFile(strLogFileName, ForWriting) fileDest.Write strNewContents fileDest.Close Set objEmail = CreateObject(CDO.Message) objEmail.From = whitespacerep...@domain.com objEmail.to = strMail objEmail.Subject = Whitespace Weekly Report objEmail.TextBody = Script Results Log objEmail.AddAttachment D:\Whitespace\ strLogFileName objEmail.Configuration.Fields.Item (http://schemas.microsoft.com/cdo/configuration/sendusing;) = 2 objEmail.Configuration.Fields.Item (http://schemas.microsoft.com/cdo/configuration/smtpserver;) = relay server objEmail.Configuration.Fields.Item (http://schemas.microsoft.com/cdo/configuration/smtpserverport;) = 25 objEmail.Configuration.Fields.Update objEmail.Send From: Ellis, John P. [mailto:johnel...@wirral.gov.uk] Sent: Friday, July 23, 2010 9:11 AM To: MS-Exchange Admin Issues Subject: RE: Exchange 2003 whitespace Hi It does help, only I've not used Powershell before. I was hoping to use a batch file and use some command line swiches. Looks like time to investigate PS. Thanks John From: Richard Stovall [mailto:rich...@gmail.com] Sent: 23 July 2010 13:54 To: MS-Exchange Admin Issues Subject: Re: Exchange 2003 whitespace Event 1221 in the Application log will tell you the amount of free space in the db at the time of online defrag. Can you use that plus filesystem info. about disk space and the size of the database files to get what you're looking for? You could write a Powershell script using the Get-Eventlog cmdlet to obtain the white space value, and the rest of it should be pretty straightforward. HTH, RS On Fri, Jul 23, 2010 at 5:01 AM, Ellis, John P. johnel...@wirral.gov.uk wrote: Is it possible to obtain free disc space, EDB size, and white space from the command line and export it to a file? Thanks John --- ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.clearswift.com **
Re: Exchange 2003 whitespace
Some folks on the NT list have mentioned Mark Russinovich's psloglist utility in the past. I've not used it, but perhaps it might let you do what you need in a batch file. http://technet.microsoft.com/en-us/sysinternals/bb897544.aspx http://technet.microsoft.com/en-us/sysinternals/bb897544.aspx On Fri, Jul 23, 2010 at 9:10 AM, Ellis, John P. johnel...@wirral.gov.ukwrote: Hi It does help, only I've not used Powershell before. I was hoping to use a batch file and use some command line swiches. Looks like time to investigate PS. Thanks John -- *From:* Richard Stovall [mailto:rich...@gmail.com] *Sent:* 23 July 2010 13:54 *To:* MS-Exchange Admin Issues *Subject:* Re: Exchange 2003 whitespace Event 1221 in the Application log will tell you the amount of free space in the db at the time of online defrag. Can you use that plus filesystem info. about disk space and the size of the database files to get what you're looking for? You could write a Powershell script using the Get-Eventlog cmdlet to obtain the white space value, and the rest of it should be pretty straightforward. HTH, RS On Fri, Jul 23, 2010 at 5:01 AM, Ellis, John P. johnel...@wirral.gov.ukwrote: Is it possible to obtain free disc space, EDB size, and white space from the command line and export it to a file? Thanks John --- ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.clearswift.com **
RE: Exchange 2003 whitespace
Powershell Script I wrote\stole. Works in Ex2007 with Powershell 2.0. It needs some modifications on the order of application entries it brings into the array but it will get you going. #startscript #Need Power Shell Version 2.0 # Note: Event ID 1221 has an InstanceID of 1074136261 on both MSX 2007 and MSX 2003 servers. # #Vairables# # $es = Servers Array # # $srv = Servername # # $dbc = Database Count # # $DB = Database Name # # $WS = WhiteSpace# ### #Create File for Output $fileName=read-host Enter the File Name where the information will be stored: $File=New-Item -ItemType file $FileName.txt #Adds Header Info to file add-content $file Server DateBase NumberOfUsers DataBaseSize WhiteSpace #Gets All Exchange Servers with the Mailbox Role including Public Folders $es = Get-ExchangeServer | Sort-Object -Property name | Where-Object {$_.ServerRole -eq Mailbox} foreach ($srv in $es) { #Getting the database count $dbc = get-mailboxdatabase -server $srv |Measure-Object #Getting the 1221 events. #need to modify the following line in order to only get correct app entries $events = Get-EventLog -ComputerName $srv -LogName application -instanceid 1074136261 -source MSExchangeIS Mailbox Store -Newest $dbc.count| Sort-Object -Property Message #Writing the output to Screen Write-Host Write-Host Server - $srv -ForegroundColor Blue Write-Host Databases - $dbc.Count -ForegroundColor Blue Write-Host foreach ($item in $events) { $DBName = $item.ReplacementStrings[1] $WS = $item.ReplacementStrings[0] $database1=$DBName #Getting File Size of Databases $db = Get-MailboxDatabase $srv\$Database1 #write-host $db $path = `\`\ + $srv + `\ + $db.EdbFilePath.DriveName.Remove(1).ToString() + $+ $db.EdbFilePath.PathName.Remove(0,2) $dbsize = Get-ChildItem $path $ReturnedObj = New-Object PSObject #$ReturnedObj | Add-Member NoteProperty -Name Server\StorageGroup\Database -Value $objItem.Identity #$ReturnedObj | Add-Member NoteProperty -Name Size (MB) -Value ({0:n2} -f ($dbsize.Length/1024KB)) #$ReturnedObj | Add-Member NoteProperty -Name -Value ({0:n2} -f ($dbsize.Length/1024KB)) $ReturnedOBJ = ({0:n2} -f ($dbsize.Length/1024KB)) #Getting Number of Users on Databases $NuUsers=Get-MailboxStatistics -database $srv\$Database1 |where-object {!$_.DisconnectDate} | group-object -property:displayName |Measure-Object $NumBerOfUSers=$NuUsers.Count #Writing to Screen Write-Host Write-Host ServerName $srv Write-Host DBName $DBName write-host NmbrUsers $NumberOfUsers Write-Host SizeOfDB$ReturnedObj Write-Host WhtSpace$WS Write-Host #Writing to File add-content $file $srv $DBName $NumberOfUsers$ReturnedObj $WS } } #endscript ___ Clint Kleciak Infrastructure Engineer Mgr CIGNA IT Confidential, unpublished property of CIGNA. Do not duplicate or distribute. Use and distribution limited solely to authorized personnel. (c) Copyright 2010 CIGNA -Original Message- From: Ellis, John P. [mailto:johnel...@wirral.gov.uk] Sent: Friday, July 23, 2010 5:02 AM To: MS-Exchange Admin Issues Subject: Exchange 2003 whitespace Is it possible to obtain free disc space, EDB size, and white space from the command line and export it to a file? Thanks John --- ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.clearswift.com ** -- CONFIDENTIALITY NOTICE: If you have received this email in error, please immediately notify the sender by e-mail at the address shown. This email transmission may contain confidential information. This information is intended only for the use of the individual(s) or entity to whom it is intended even if addressed incorrectly. Please delete it from your files if you are not the intended recipient. Thank you for your compliance. Copyright 2010 CIGNA ==
RE: Exchange 2003 whitespace
You can also try this one: http://gsexdev.blogspot.com/2008/07/show-exchange-whitespace-retained-it ems.html I use something based on this in PowerGUI. Cheers, Phil -- Phil Randal | Networks Engineer NHS Herefordshire Herefordshire Council | Deputy Chief Executive's Office | I.C.T. Services Division Thorn Office Centre, Rotherwas, Hereford, HR2 6JT Tel: 01432 260160 email: pran...@herefordshire.gov.uk Any opinion expressed in this e-mail or any attached files are those of the individual and not necessarily those of Herefordshire Council. This e-mail and any attached files are confidential and intended solely for the use of the addressee. This communication may contain material protected by law from being passed on. If you are not the intended recipient and have received this e-mail in error, you are advised that any use, dissemination, forwarding, printing or copying of this e-mail is strictly prohibited. If you have received this e-mail in error please contact the sender immediately and destroy all copies of it. -Original Message- From: Kleciak, Clint D A7IT [mailto:clint.klec...@cigna.com] Sent: 23 July 2010 15:36 To: MS-Exchange Admin Issues Subject: RE: Exchange 2003 whitespace Powershell Script I wrote\stole. Works in Ex2007 with Powershell 2.0. It needs some modifications on the order of application entries it brings into the array but it will get you going. #startscript #Need Power Shell Version 2.0 # Note: Event ID 1221 has an InstanceID of 1074136261 on both MSX 2007 and MSX 2003 servers. # #Vairables# # $es = Servers Array # # $srv = Servername # # $dbc = Database Count # # $DB = Database Name # # $WS = WhiteSpace# ### #Create File for Output $fileName=read-host Enter the File Name where the information will be stored: $File=New-Item -ItemType file $FileName.txt #Adds Header Info to file add-content $file Server DateBase NumberOfUsers DataBaseSize WhiteSpace #Gets All Exchange Servers with the Mailbox Role including Public Folders $es = Get-ExchangeServer | Sort-Object -Property name | Where-Object {$_.ServerRole -eq Mailbox} foreach ($srv in $es) { #Getting the database count $dbc = get-mailboxdatabase -server $srv |Measure-Object #Getting the 1221 events. #need to modify the following line in order to only get correct app entries $events = Get-EventLog -ComputerName $srv -LogName application -instanceid 1074136261 -source MSExchangeIS Mailbox Store -Newest $dbc.count| Sort-Object -Property Message #Writing the output to Screen Write-Host Write-Host Server - $srv -ForegroundColor Blue Write-Host Databases - $dbc.Count -ForegroundColor Blue Write-Host foreach ($item in $events) { $DBName = $item.ReplacementStrings[1] $WS = $item.ReplacementStrings[0] $database1=$DBName #Getting File Size of Databases $db = Get-MailboxDatabase $srv\$Database1 #write-host $db $path = `\`\ + $srv + `\ + $db.EdbFilePath.DriveName.Remove(1).ToString() + $+ $db.EdbFilePath.PathName.Remove(0,2) $dbsize = Get-ChildItem $path $ReturnedObj = New-Object PSObject #$ReturnedObj | Add-Member NoteProperty -Name Server\StorageGroup\Database -Value $objItem.Identity #$ReturnedObj | Add-Member NoteProperty -Name Size (MB) -Value ({0:n2} -f ($dbsize.Length/1024KB)) #$ReturnedObj | Add-Member NoteProperty -Name -Value ({0:n2} -f ($dbsize.Length/1024KB)) $ReturnedOBJ = ({0:n2} -f ($dbsize.Length/1024KB)) #Getting Number of Users on Databases $NuUsers=Get-MailboxStatistics -database $srv\$Database1 |where-object {!$_.DisconnectDate} | group-object -property:displayName |Measure-Object $NumBerOfUSers=$NuUsers.Count #Writing to Screen Write-Host Write-Host ServerName $srv Write-Host DBName $DBName write-host NmbrUsers $NumberOfUsers Write-Host SizeOfDB$ReturnedObj Write-Host WhtSpace$WS Write-Host #Writing to File add-content $file $srv $DBName $NumberOfUsers $ReturnedObj $WS } } #endscript ___ Clint Kleciak Infrastructure Engineer Mgr CIGNA IT Confidential, unpublished property of CIGNA. Do not duplicate or distribute. Use and distribution limited solely to authorized personnel. (c) Copyright 2010 CIGNA -Original Message- From: Ellis, John P. [mailto:johnel...@wirral.gov.uk] Sent: Friday, July 23, 2010 5:02 AM To: MS-Exchange Admin Issues Subject: Exchange 2003 whitespace Is it possible to obtain free disc space, EDB size, and white space from the command line and export it to a file? Thanks John