200 likes | 374 Views
Pushing the Envelope With Perl: Using Perl With Microsoft Exchange. Rick Tatem Systems Programmer SAS Rick.Tatem@sas.com. About the speaker…. Started in the UNIX world (’92-99) Perl user since ~ ’94 Moved into NT by choice (’96) Something new Not backups No Guru…. Microsoft Exchange.
E N D
Pushing the Envelope With Perl:Using Perl With Microsoft Exchange Rick Tatem Systems Programmer SAS Rick.Tatem@sas.com O'Reilly Open Source Convention
About the speaker… • Started in the UNIX world (’92-99) • Perl user since ~ ’94 • Moved into NT by choice (’96) • Something new • Not backups • No Guru… O'Reilly Open Source Convention
Microsoft Exchange • Exchange version 5.5 • Information Store • transactional database • Private (mailboxes) and Public • Directory Service • LDAP compliant • Separate from the accounts database O'Reilly Open Source Convention
Perl and Windows NT/2000 • Windows/UNIX issues • Binary distribution from ActiveState • Key modules • Win32::OLE • Win32::OLE::Enum • Perl Development Kit • PerlCtrl – create COM objects • Visual debugger • Perl2exe O'Reilly Open Source Convention
Perl and Windows NT/2000 • Most example code is VBScript • Don’t reinvent the wheel • Translation is easy O'Reilly Open Source Convention
Perl and Windows NT/2000 • VB to Perl example • All perl scripts begin with: use strict; use Win32::OLE; • Methods vs. Properties • Dot notation • ADO Connection example O'Reilly Open Source Convention
Perl and Windows NT/2000 • VB Set conn = CreateObject("ADODB.Connection") conn.Provider = "ADSDSOObject" conn.Open "ADsProvider;CN=uid,DC=domain;pwd" • Perl my $conn = Win32::OLE->new("ADODB.Connection"); $conn->{'Provider'} = "ADsDSOObject"; $conn->Open("ADs Provider;CN=uid,DC=domain;pwd"); O'Reilly Open Source Convention
Exchange-related Tasks • Message Tracking • Information Stores • Directory Services O'Reilly Open Source Convention
Message Tracking Logs • Simple tab delimited text • Exchange Admin GUI tool for following messages throughout site • Usefulness (find source of virus outbreak) O'Reilly Open Source Convention
Message Tracking Logs • Perl featured in Exchange Admin newsletter article (July, 2000) • Good • Used Perl • Useful concept – overall message flow • Not good for multiple-server • Code Example O'Reilly Open Source Convention
Directory Services • Most tools • High visibility • Even more important after transition to Active Directory • Major projects • Rules-based Distribution Lists • DLManager O'Reilly Open Source Convention
Rules-based Distribution Lists • Examples lacking • Only creation shown • No concept of ‘update’ • Perl makes it easier • Easy to compare lists • Win32::OLE gives you access to ADSI O'Reilly Open Source Convention
Rules-based Distribution Lists • Membership rules are in Perl syntax (($unit eq ‘DEPT’) && ($loc eq ‘City’)) • For each list… • Rule is eval’ed for each employee • Current membership compared to eval’ed membership • Adds/Deletes/Creates as necessary O'Reilly Open Source Convention
DLManager • Requirements • Decommission ListServ on VM • Provide same functionality (80/20) • 2/3 already done • “Closed” lists – regular DLs • Automated lists – autodl.pl • “OPEN” lists – not available O'Reilly Open Source Convention
DLManager • Available solutions lacking in one way or another • Microsoft’s EXLIST • Reddfish ListServer • NTP ListManager O'Reilly Open Source Convention
DLManager • Major features • Actually USES the existing directory • Leverages security • Written in Perl • PerlCtrl – part of Perl Development Kit from ActiveState O'Reilly Open Source Convention
DLManager • Sample code • Demo O'Reilly Open Source Convention
Exchange 2000/Active Directory • MAJOR changes/improvements • Directory • NT Account (SAM)/Exchange Directory consolidation • Distribution List = Security Group + mail • Extensible Schema O'Reilly Open Source Convention
Exchange 2000/Active Directory • Information Store • IFS – ‘cd’ into your mailbox! • WebDAV • XML • Store Events/Sinks • Synchronous events • More robust O'Reilly Open Source Convention
Conclusion • Currently updating code for Windows2000 Active Directory and Exchange2000 • Code available from me • Rick.Tatem@sas.com • PerlCtrl available as part of Perl Development Kit from ActiveState • Q&A… Thank you! O'Reilly Open Source Convention