in reply to Windows Authentication through IIS

Perhaps try Net::LDAP instead of going through Win32::OLE as a workaround?

My only thought for the above is that when run as a CGI, it's running as the IIS user windows account (but when you try from cmdline you're using your windows account), which for some reason doesn't have permission to create or use the LDAP OLE object. What is the value of Win32::OLE->LastError()?

Replies are listed 'Best First'.
Re^2: Windows Authentication through IIS
by Anonymous Monk on Jun 16, 2005 at 13:52 UTC
    Thats interesting. the error is:
    Win32::OLE(0.1502) error 0x8007054b: "The specified domain either does + not exist or could not be contacted" in METHOD/PROPERTYGET "OpenDSOb +ject"

    Which looks like it can't find the domain. However, when i run it from the commandline on the same box its fine.

    I wonder if IIS has a setting that needs toggled to make this work. I'll start digging. This is the first time I've done anything for IIS in several years, normally I code for linux/apache.

      Looks like the useraccount IUSR_srvname doesn't know anything about the domain and can't find your domain controller automatically...

      Try one of the following:

      my $ad_server = Win32::OLE->GetObject ("LDAP://servername") or die $!;
      or
      my $adpath = "LDAP://$server/DC=my,DC=domain,DC=edu";
      or perhaps use GC: instead of LDAP: (GC is Global Catalog)

      Best regards,
      perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"