Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2017-11-21 22:17 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (312 votes). Check out past polls.