I'm in the process of a mail system migration project, from MS Exchange to Linux based Scalix.
The Scalix migration toolkit doesn't have a clean way to migrate the few important aspects of Public Folders. Namely
A Public folder owners, ACL list and the folder hierarchy.
I've pulled some code from this site to list through the names of the folders from this site, and modified it a little to read the public folders. This works great.
The issue I'm having now is that I'm not a windows programmer and don't know what methods or actions to use to get the data I need for each public folder.
I've started looking at the UserProperties item but don't know how to list all the properties of an item.
Here is the code as it stands now
#!/bin/perl
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Outlook';
# or 'Microsoft Outlook 9.0 Object Library';
# Const module defines many usefule constants - like olFolderContacts
+, etc.
my $Outlook = Win32::OLE->GetActiveObject('Outlook.Application') or di
+e "oops 1";
my $namespace = $Outlook->GetNamespace("MAPI");
my $folder = $namespace->GetDefaultFolder(olPublicFoldersAllPublicFold
+ers);
my $items = $folder->Items;
print STDERR "Folder: ", $folder->Name,"\n";
print STDERR "Total entries: ",$items->Count,"\n";
print_folders($folder);
sub print_folders
{
my $folder = shift;
my $subfolderlevel=0;
print "Folder: " . $folder->Name , $subfolderlevel,"\n";
foreach my $fld (in $folder->(UserProperties)) {
print "Field Name", $fld->{Name},"\n";
print "Field Value", $fld->Value, "\n";
}
if ($folder->Folders->Count)
{
$subfolderlevel++;
foreach my $i (1..$folder->Folders->Count)
{
print_folders($folder->Folders($i));
}
}
}
I see that you can get the message subject by using item->Subject etc.. but its not clear what use when I'm looking for a Public Folders Owner ACL list and sub folder hierarchy
Thanks
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.