Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

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"; }

Comment on Exchange server GAL entry parameters
Download Code
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://950226]
Approved by Eliya
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2015-11-30 06:22 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (759 votes), past polls