#  DisplayADSIProviders.pl
#  Example 9.1:
#  ----------------------------------------
#  From "Win32 Perl Scripting: Administrators Handbook" by Dave Roth
#  Published by New Riders Publishing.
#  ISBN # 1-57870-215-1
#
#  This script displays all ADSI providers that are installed on 
#  the local machine.
#
print "From the book 'Win32 Perl Scripting: The Administrator's Handbook' by Dave Roth\n\n";


use Win32::OLE qw( in );

$ADsPath = "ADs:";
if( $DS = Win32::OLE->GetObject( $ADsPath ) )
{
  my $iCount = 0;
  print "This machine has the following ADSI providers installed:\n";
  foreach my $Provider ( in( $DS ) )
  {
    print ++$iCount . ") $Provider->{Name}\n";
  }
}
