473,397 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Exchange 5.5 Public Folder Discovery Scripts

I am in the process of trying to find out exactly what is in the public folders on a 5.5 server.

I need a script that will tell me what file types are in the folders, who put them there and the date.
I also need the same information for the calendars. I am not sure how to do this efficiently.

So I need to look for the office file types (XLS, DOC, PPT, etc...) and ones for faxes like TIF files.
The last piece is a script to find out what the Rules Assistant has on each folder. That would tell me the FROM and TO rules for mail messages that are dropped in the folders and the dates.

This needs to export to a CSV with the full path to the folder where the files live.

Has anybody done this and have a script that they can send me?
May 10 '07 #1
5 1573
r035198x
13,262 8TB
I am in the process of trying to find out exactly what is in the public folders on a 5.5 server.

I need a script that will tell me what file types are in the folders, who put them there and the date.
I also need the same information for the calendars. I am not sure how to do this efficiently.

So I need to look for the office file types (XLS, DOC, PPT, etc...) and ones for faxes like TIF files.
The last piece is a script to find out what the Rules Assistant has on each folder. That would tell me the FROM and TO rules for mail messages that are dropped in the folders and the dates.

This needs to export to a CSV with the full path to the folder where the files live.

Has anybody done this and have a script that they can send me?
I'm not a VB expert myself but I'll contact all the VB experts and let them know about it.
Good luck and

God bless
May 16 '07 #2
still no update yet
May 16 '07 #3
danp129
323 Expert 256MB
I am in the process of trying to find out exactly what is in the public folders on a 5.5 server.

I need a script that will tell me what file types are in the folders, who put them there and the date.
Do you want the date the postitem/mailitem was created, modified, sent, or recieved?
I supposed you want e-mail address if available but it's not for exchange users.. Do you want their login or their "display name" (ie BARTOLINI or Bart O. Lini.)
Did you want the message subject to?
Also, a sample of what you WANT the final CSV to look would be helpful.

I also need the same information for the calendars. I am not sure how to do this efficiently.
I'm not sure I can do calendars or Rules but haven't worked on that part yet... maybe you can look for an example and post what you find?

Has anybody done this and have a script that they can send me?
I haven't, no. I will try to do what I can but I'm limited to using Outlook 2003 / Exchange 2000, so what I come up with may not be compatible.
May 17 '07 #4
danp129
323 Expert 256MB
This has stuff commented out because it's a work in progress and I may use some of it.. anyhow, run it and let me know of any errors so far.

Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2. Dim oFile As Scripting.TextStream
  3. 'Set path to your export file here
  4. Const sFilePath As String = "c:\PublicFolderExport.csv"
  5. 'Set file extensions to look for
  6. Const sExtensionsToLog As String = "doc ppt xls tif"
  7.  
  8. Sub PublicFolders2CSV()
  9.     Dim oFSO As New FileSystemObject
  10.     On Error Resume Next
  11.     Set oFile = oFSO.CreateTextFile(sFilePath, True)
  12.     If Err.Number <> 0 Then
  13.         MsgBox "Could not create '" & sFilePath & "'.  Make sure it is not read locked by another program."
  14.         GoTo Quit:
  15.     End If
  16.     On Error GoTo 0
  17.     Call ExportPublicMessages(Application.GetNamespace("MAPI").GetDefaultFolder(olPublicFoldersAllPublicFolders).EntryID)
  18. Quit:
  19. Set oFile = Nothing
  20. Set oFSO = Nothing
  21. End Sub
  22.  
  23. Private Sub ExportPublicMessages(ByVal sEntryID As String)
  24.     Dim i As Integer
  25.     Dim lngCount As Long
  26.     Dim oSubFolder As Outlook.MAPIFolder
  27.     Dim oFolder As Outlook.MAPIFolder
  28.     Dim itm As Object
  29.     Dim oAppointment As AppointmentItem
  30.     Dim oContact As ContactItem
  31.     Dim oDistListItem As DistListItem
  32.     Dim oJournalItem As JournalItem
  33.     Dim oMailItem As MailItem
  34.     Dim oNoteItem As NoteItem
  35.     Dim oPostItem As PostItem
  36.     Dim oTaskItem As TaskItem
  37.  
  38.     Dim sSender As String
  39.     Dim sFiles As String
  40.     'Get folder from entryID
  41.     Set oFolder = Application.GetNamespace("MAPI").GetFolderFromID(sEntryID)
  42. '
  43. '    If oFolder Is Nothing Then
  44. '        GoTo Quit
  45. '    End If
  46.  
  47. Dim filename
  48.  
  49.  
  50.  
  51.     For Each itm In oFolder.Items
  52.         If itm.Class = olMail Or itm.Class = olPost Then
  53.             sFiles = ParseFilesWithExtension(itm)
  54.             If sFiles <> Empty Then oFile.WriteLine ("""" & oFolder.FolderPath & """,""" & itm.ReceivedTime & """,""" & itm.Subject & """,""" & ParseEmailOrX400(itm.SenderEmailAddress) & """,""" & sFiles & """")
  55.         End If
  56. '        If itm.Class = olMail Then
  57. '            Set oMailItem = itm
  58. '            Dim sfrom
  59. '            sfrom = oMailItem.SenderEmailAddress
  60. '            Stop
  61. '        ElseIf itm.Class = olPost Then
  62. '            Set oPostItem = itm
  63. '            Stop
  64. '        End If
  65.     Next 'itm
  66.  
  67.     For Each oSubFolder In oFolder.Folders
  68.         ExportPublicMessages (oSubFolder.EntryID)
  69.     Next 'folder
  70.  
  71. Quit:
  72.  
  73. End Sub
  74.  
  75. Function ParseFilesWithExtension(itm As Object) As String
  76.     Dim Atmt As Attachment
  77.     Dim sFiles As String
  78.     Dim arTmp
  79. '        If Not oMail Is Nothing Then
  80.             For Each Atmt In itm.Attachments
  81.                 arTmp = Split(Atmt.filename, ".")
  82.                 If sFiles <> Empty Then sFiles = ";" & sFiles
  83.                 If InStr(1, sExtensionsToLog, arTmp(UBound(arTmp))) Then sFiles = sFiles & Atmt.filename
  84.                 'Atmt.SaveAsFile filename
  85.             Next Atmt
  86. '            Set oMail = Nothing
  87. '        End If
  88. ParseFilesWithExtension = sFiles
  89. End Function
  90.  
  91.  
  92. Function ParseEmailOrX400(ByVal sIn As String) As String
  93.     If InStr(1, sIn, "/") > 0 Then
  94.         Dim arUser
  95.         arUser = Split(sIn, "/")
  96.         ParseEmailOrX400 = Replace(arUser(UBound(arUser)), "CN=", "")
  97.     Else
  98.         ParseEmailOrX400 = sIn
  99.     End If
  100. End Function
  101.  
May 17 '07 #5
Thanks for helping out.
I ran the script and here is the error message;

Line 2 Column 17

Microsoft VB Script compilation error

Expected end of statement
May 19 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Patrick | last post by:
I'm trying to create a link from Access 2003 to an Exchange 2000 Public Folder called "WMContacts" I choose File => Get External Data=> Link Tables. I choose Exchange() and the wizard give me the...
1
by: Kim Nørby Andersen | last post by:
I'm in a situation, where i'm supposed to develop a windows service, connecting to an external source, and insert new contact persons to an Exchange public folder. Everything is going well, until I...
3
by: maria.s | last post by:
Hi, I try to create a calender-item in the personal calendar folder from an ASP.NET application using XML-HTTP Request (WebDAV). System: Windows 2003 SP1, Exchange 2003 SP1 Configuration...
3
by: Krach | last post by:
Hi everybody! I'm decided to develop (at least try) a custom pop3 connector / mail downloader for Exchange 2003. The question is simple: How do I start? I use MS Visual Studio 2003 (VB .Net). I...
1
by: Chris Thunell | last post by:
I have some vb.net code that goes and gets some information from our Contacts Public folder named "Pierce Contacts". As you see from the code below, i reference this folder by first navigating to...
2
by: Andy | last post by:
Hi, I'm trying to get a users free/busy status from exchange from within a website and using the code below, but when I run this a login page from MS Outlook Web Access is retrieved from the...
0
by: arjen1984 | last post by:
I am now working on C# with WebDAV on Exchange now to get appointments. When I work local on the domain where the server is, i can get the appointments no problem. When I work outside of it, i get an...
7
by: Wiebe Tijsma | last post by:
Hi, I'm using C# + webDAV to create a draft message to be sent in a user's Drafts folder. I can create the message successfully, however when I open the message in outlook, it doesn't show...
5
by: krasman | last post by:
hi everyone, i hope you might help me on this one. i need to create a contact in a exchange public folder using dotnet (vb or c#) and exchange 2003, without using outlook object model. i'm...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.