• Facebook
  • RSS Feed
  • Instagram
  • LinkedIn
  • Twitter
Jun 052012
 

Here is a little script that I wrote the other day.  I had the need for this because  I was looking at a log file which showed Entry ID’s of folders, but not the folder names..

[vb gutter=”off”]
debugon=true
servername="EXCH1"
mailboxname="john1"

Set objSession = CreateObject("MAPI.Session")
objSession.Logon "","",false,true,true,true,servername & vbLF & mailboxname
Set CdoInfoStore = objSession.GetInfoStore
Set CdoFolderRoot = CdoInfoStore.RootFolder

‘ Start at the very top of the information store
set oFolders = cdoFolderRoot.folders
if ofolders.count > 0 then
for each ofolder in oFolders
if debugon = true then
wscript.echo "Processing : " & oFolder.Name & " : " & ofolder.ID
end if

t = checkmsgsinfolder(ofolder, objSession)
next
else
wscript.echo "No folders to process"
end if

wscript.echo ""
wscript.echo "Finished"

wscript.quit

function checkmsgsinfolder(folder, objsession)

for each mfolder in folder.folders
wscript.echo "Sub folder found : " & mfolder.name & " : " & mfolder.ID
x = checkmsgsinfolder(mfolder, objsession)
next

end function
[/vb]

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

  One Response to “Simple script to list entry ID’s”

  1. […] Simple script to list entry ID’s […]

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)