Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Exchange server GAL entry parameters

by cole3rd (Initiate)
on Jan 26, 2012 at 22:01 UTC ( #950226=perlquestion: print w/replies, xml ) Need Help??
cole3rd has asked for the wisdom of the Perl Monks concerning the following question:

How do you obtain user email information, like email1address under the Global Address List on the Windows Exchange server. No matter what I try, I only get the user name. My code so far:

use strict; use Win32::OLE; use Win32::OLE::Const 'Microsoft Outlook'; my $Outlook = Win32::OLE->GetActiveObject('Outlook.Application') or di +e "GetActiveObject failed\n"; my $namespace = $Outlook->GetNamespace("MAPI"); my $GAL = $namespace->AddressLists("Global Address List")->{AddressEnt +ries}; my $Filter = $GAL->Filter(); my $list_name = "addr_ent"; # set it to real name $Filter->{Name} = $list_name; my $Folder = $namespace->GetDefaultFolder(olFolderContacts); my $DL = $GAL->GetFirst(); # Depends on match above my $Members = $DL->{Members}; for ( my $Member = $Members->GetFirst();$Member != undef; $Member = $M +embers->GetNext() ) { my $fname = $Member->{FullName}; my $email = $Member->{Email1Address}; print "$fname $email\n"; }
Thanks...

Replies are listed 'Best First'.
Re: Exchange server GAL entry parameters
by Anonymous Monk on Jan 27, 2012 at 09:17 UTC

    No matter what I try, I only get the user name

    What docs are you reading?

      Mostly examples from the Internet, Perlmonks, etc.; there are dozens of examples reading all the user profile parameters from the contact folders, not any examples of reading user profile parameters from entries under the GAL... Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://950226]
Approved by Eliya
help
Chatterbox?
[Corion]: Meh. I have a very simple mechanism to scrape+track prices, and even to send me mail if something changes (via cron), but SQLite doesn't support window functions, so my simple SQL to determine a price change won't work :-( Maybe I should store the DB ...
[Corion]: ... in Pg, but that would mean that I'd have to deal with credentials and stuff :)
[Corion]: In fact, the whole thing is just four simple programs, one App::scrape, another being DBIx::RunSQL, and one some glue to convert a JSON object into an SQL INSERT statement (+DBI connect/execute), so it would be an incredibly simple solution...
[Corion]: ... but that simplicity falls down due to SQLite letting me down and me being too lazy to move to a real DB. Maybe DBD::CSV can handle window functions...
[hippo]: Pg has the "trust" mechanism if you don't fancy using credentials for a trivial db.
[Corion]: hippo: Oooh, that sounds quite nice - let me read the documentation on that :)
[hippo]: https://www. postgresql.org/ docs/current/ static/auth- methods.html#AUTH- TRUST
[erix]: or compile & run an instance as yourself (not user 'postgres')

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2018-02-23 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (302 votes). Check out past polls.

    Notices?