Deleting 1 folder across multiple Mailboxes

We created a duplicate junk mail folder and want to delete it across multiple 
mailboxes.  Is there a utility that will do this or do we need to open each 
mailbox individually?  We have 1200 mailboxes.
Thank you
0
Griff (32)
1/11/2006 5:08:01 PM
exchange.admin 57650 articles. 2 followers. Follow

6 Replies
404 Views

Similar Articles

[PageSpeed] 40

Exmerge.exe will do this...it is available at download.microsoft.com.




"Griff" <Griff@discussions.microsoft.com> wrote in message 
news:886F1600-5F60-43F1-9F64-968C2F0FB115@microsoft.com...
> We created a duplicate junk mail folder and want to delete it across 
> multiple
> mailboxes.  Is there a utility that will do this or do we need to open 
> each
> mailbox individually?  We have 1200 mailboxes.
> Thank you 


0
tfelts (292)
1/11/2006 5:46:19 PM
I am able to delete individual emails across the board, but not folders.  Am 
I missing something.
Thank you,
Griff

"Tom Felts" wrote:

> Exmerge.exe will do this...it is available at download.microsoft.com.
> 
> 
> 
> 
> "Griff" <Griff@discussions.microsoft.com> wrote in message 
> news:886F1600-5F60-43F1-9F64-968C2F0FB115@microsoft.com...
> > We created a duplicate junk mail folder and want to delete it across 
> > multiple
> > mailboxes.  Is there a utility that will do this or do we need to open 
> > each
> > mailbox individually?  We have 1200 mailboxes.
> > Thank you 
> 
> 
> 
0
Griff (32)
1/11/2006 6:15:02 PM
i was wondering about that...I don't know that exmerge will delete
folders...

--
Susan Conkey [MVP]



"Griff" <Griff@discussions.microsoft.com> wrote in message
news:4F43B389-B63A-4AE8-B1A4-C92BCD2C7409@microsoft.com...
> I am able to delete individual emails across the board, but not folders.
Am
> I missing something.
> Thank you,
> Griff
>
> "Tom Felts" wrote:
>
> > Exmerge.exe will do this...it is available at download.microsoft.com.
> >
> >
> >
> >
> > "Griff" <Griff@discussions.microsoft.com> wrote in message
> > news:886F1600-5F60-43F1-9F64-968C2F0FB115@microsoft.com...
> > > We created a duplicate junk mail folder and want to delete it across
> > > multiple
> > > mailboxes.  Is there a utility that will do this or do we need to open
> > > each
> > > mailbox individually?  We have 1200 mailboxes.
> > > Thank you
> >
> >
> >


0
sconkey (3059)
1/11/2006 6:23:28 PM
My Bad....it doesn't.  NEver mind...


"Susan" <sconkey@mgmmirage.nospam.com> wrote in message 
news:etN5bwtFGHA.3064@TK2MSFTNGP10.phx.gbl...
>i was wondering about that...I don't know that exmerge will delete
> folders...
>
> --
> Susan Conkey [MVP]
>
>
>
> "Griff" <Griff@discussions.microsoft.com> wrote in message
> news:4F43B389-B63A-4AE8-B1A4-C92BCD2C7409@microsoft.com...
>> I am able to delete individual emails across the board, but not folders.
> Am
>> I missing something.
>> Thank you,
>> Griff
>>
>> "Tom Felts" wrote:
>>
>> > Exmerge.exe will do this...it is available at download.microsoft.com.
>> >
>> >
>> >
>> >
>> > "Griff" <Griff@discussions.microsoft.com> wrote in message
>> > news:886F1600-5F60-43F1-9F64-968C2F0FB115@microsoft.com...
>> > > We created a duplicate junk mail folder and want to delete it across
>> > > multiple
>> > > mailboxes.  Is there a utility that will do this or do we need to 
>> > > open
>> > > each
>> > > mailbox individually?  We have 1200 mailboxes.
>> > > Thank you
>> >
>> >
>> >
>
> 


0
tfelts (292)
1/11/2006 8:05:59 PM
I too am looking to delete about 30 folders that came over from a linux 
migration and would love to find a way to script these folders away.  There 
are over 200 mailboxes that is a whole lot of click delete click delete.  
Know what I am saying?

I found this script, but it seems to only work on Exchange 2000.

'================================================================================
' Copyright (c) 2005 Ted Crow, Information Technology Manager
' Tuttle Services, Inc.  [ tedc@tuttlenet.com / +1-419-228-6262 ]
'
' This file is provided free of charge and may be distributed freely so
' long as it is not modified in any way and this header remains completely
' intact.
'
'DISCLAIMER OF WARRANTY
' THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND WHETHER
' EXPRESSED OR IMPLIED.  IN NO EVENT SHALL THE AUTHOR BE HELD LIABLE FOR ANY
' DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF 
BUSINESS
' PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS OR PERSONAL INFORMATION, OR
' ANY OTHER LOSS ARISING FROM THE USE OR INABILITY TO USE THE SOFTWARE.
'================================================================================

Option Explicit

Dim objCommand, objConnection, strBase, strFilter, strAttributes
Dim objSysInfo, strQuery, objRecordset, strName, strFolderName
Dim strServerName, strDomainDNSName, res, ShowConfirmation

strServerName = "mail server name"
strFolderName = "Spam"
strBase = "<LDAP://dc=mydomain,dc=com>"
ShowConfirmation = 1

'================================================================================
'             YOU SHOULD NOT NEED TO EDIT ANYTHING BELOW THIS LINE!
'================================================================================

'Set objSysInfo = CreateObject("ADSystemInfo")
'strDomainDNSName = objSysInfo.DomainDNSName

Set objCommand = CreateObject("ADODB.Command")
Set objConnection = CreateObject("ADODB.Connection")

objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
objCommand.ActiveConnection = objConnection

strFilter = "(&(&(& (mailnickname=*) (| 
(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))) ))))"
strAttributes = "sAMAccountName,cn"

strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree"

objCommand.CommandText = strQuery
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Timeout") = 30
objCommand.Properties("Cache Results") = False
objCommand.Properties("Sort On") = "sAMAccountName"

Set objRecordSet = objCommand.Execute

Do Until objRecordSet.EOF

  strName = objRecordSet.Fields("sAMAccountName").Value
  
  res = DeleteFolderFromMailbox ( strServerName, strName, strFolderName )
  
  objRecordSet.MoveNext

Loop

objConnection.Close

'================================================================================
' THE CORE OF THIS SCRIPT
'================================================================================

Function DeleteFolderFromMailbox(strServerName,strMailboxName,strFolderName)
	
	On Error Resume Next

	Dim objRecord, strObjectUrl, ConfirmDelete
	
	ConfirmDelete = 7 'vbNo

	Set objRecord = CreateObject("ADODB.Record")
	
	' Specify the URL to the item to be deleted
	strObjectUrl = "http://" & strServerName & "/exchange/" & strMailboxName & 
"/" & strFolderName
	
	'MsgBox "strObjectUrl : " & strObjectUrl
	
	' Open the record
	objRecord.Open strObjectUrl,,3 ' adModeReadWrite
	
	If (Err.Number = 0) Then
		If (ShowConfirmation = 1) Then
			ConfirmDelete = MsgBox("Delete Folder '" & strFolderName & "' from 
mailbox : " & strMailboxName & " (" & strServerName & ")",4,"Delete Folder")
		Else
			'MsgBox "DAV:href : " & objRecord.Fields("DAV:href")
			ConfirmDelete = 6 ' vbYes
		End If
		
		' Delete the folder record
		If (ConfirmDelete = 6) Then
			objRecord.DeleteRecord
		End If
		
  End If

	' Close the record and clean up
	objRecord.Close
	Set objRecord = Nothing
	
End Function

"Griff" wrote:

> We created a duplicate junk mail folder and want to delete it across multiple 
> mailboxes.  Is there a utility that will do this or do we need to open each 
> mailbox individually?  We have 1200 mailboxes.
> Thank you
0
Greg7423 (349)
1/11/2006 11:31:02 PM
Yes.  If i find anything I will let you know.

"Greg" wrote:

> I too am looking to delete about 30 folders that came over from a linux 
> migration and would love to find a way to script these folders away.  There 
> are over 200 mailboxes that is a whole lot of click delete click delete.  
> Know what I am saying?
> 
> I found this script, but it seems to only work on Exchange 2000.
> 
> '================================================================================
> ' Copyright (c) 2005 Ted Crow, Information Technology Manager
> ' Tuttle Services, Inc.  [ tedc@tuttlenet.com / +1-419-228-6262 ]
> '
> ' This file is provided free of charge and may be distributed freely so
> ' long as it is not modified in any way and this header remains completely
> ' intact.
> '
> 'DISCLAIMER OF WARRANTY
> ' THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND WHETHER
> ' EXPRESSED OR IMPLIED.  IN NO EVENT SHALL THE AUTHOR BE HELD LIABLE FOR ANY
> ' DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF 
> BUSINESS
> ' PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS OR PERSONAL INFORMATION, OR
> ' ANY OTHER LOSS ARISING FROM THE USE OR INABILITY TO USE THE SOFTWARE.
> '================================================================================
> 
> Option Explicit
> 
> Dim objCommand, objConnection, strBase, strFilter, strAttributes
> Dim objSysInfo, strQuery, objRecordset, strName, strFolderName
> Dim strServerName, strDomainDNSName, res, ShowConfirmation
> 
> strServerName = "mail server name"
> strFolderName = "Spam"
> strBase = "<LDAP://dc=mydomain,dc=com>"
> ShowConfirmation = 1
> 
> '================================================================================
> '             YOU SHOULD NOT NEED TO EDIT ANYTHING BELOW THIS LINE!
> '================================================================================
> 
> 'Set objSysInfo = CreateObject("ADSystemInfo")
> 'strDomainDNSName = objSysInfo.DomainDNSName
> 
> Set objCommand = CreateObject("ADODB.Command")
> Set objConnection = CreateObject("ADODB.Connection")
> 
> objConnection.Provider = "ADsDSOObject"
> objConnection.Open "Active Directory Provider"
> objCommand.ActiveConnection = objConnection
> 
> strFilter = "(&(&(& (mailnickname=*) (| 
> (&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))) ))))"
> strAttributes = "sAMAccountName,cn"
> 
> strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree"
> 
> objCommand.CommandText = strQuery
> objCommand.Properties("Page Size") = 1000
> objCommand.Properties("Timeout") = 30
> objCommand.Properties("Cache Results") = False
> objCommand.Properties("Sort On") = "sAMAccountName"
> 
> Set objRecordSet = objCommand.Execute
> 
> Do Until objRecordSet.EOF
> 
>   strName = objRecordSet.Fields("sAMAccountName").Value
>   
>   res = DeleteFolderFromMailbox ( strServerName, strName, strFolderName )
>   
>   objRecordSet.MoveNext
> 
> Loop
> 
> objConnection.Close
> 
> '================================================================================
> ' THE CORE OF THIS SCRIPT
> '================================================================================
> 
> Function DeleteFolderFromMailbox(strServerName,strMailboxName,strFolderName)
> 	
> 	On Error Resume Next
> 
> 	Dim objRecord, strObjectUrl, ConfirmDelete
> 	
> 	ConfirmDelete = 7 'vbNo
> 
> 	Set objRecord = CreateObject("ADODB.Record")
> 	
> 	' Specify the URL to the item to be deleted
> 	strObjectUrl = "http://" & strServerName & "/exchange/" & strMailboxName & 
> "/" & strFolderName
> 	
> 	'MsgBox "strObjectUrl : " & strObjectUrl
> 	
> 	' Open the record
> 	objRecord.Open strObjectUrl,,3 ' adModeReadWrite
> 	
> 	If (Err.Number = 0) Then
> 		If (ShowConfirmation = 1) Then
> 			ConfirmDelete = MsgBox("Delete Folder '" & strFolderName & "' from 
> mailbox : " & strMailboxName & " (" & strServerName & ")",4,"Delete Folder")
> 		Else
> 			'MsgBox "DAV:href : " & objRecord.Fields("DAV:href")
> 			ConfirmDelete = 6 ' vbYes
> 		End If
> 		
> 		' Delete the folder record
> 		If (ConfirmDelete = 6) Then
> 			objRecord.DeleteRecord
> 		End If
> 		
>   End If
> 
> 	' Close the record and clean up
> 	objRecord.Close
> 	Set objRecord = Nothing
> 	
> End Function
> 
> "Griff" wrote:
> 
> > We created a duplicate junk mail folder and want to delete it across multiple 
> > mailboxes.  Is there a utility that will do this or do we need to open each 
> > mailbox individually?  We have 1200 mailboxes.
> > Thank you
0
Griff (32)
1/13/2006 1:44:02 PM
Reply:

Similar Artilces: