I am running into a problem, when I execute a simple script to add a computer to an AD when I do it through a cgi script.

This is the code that I am running:

my $strBase = "OU=iLab - iLab Gatekeeper,OU=InfrApps - Infrastructure Managed Apps,OU=Applications,OU=US-DC1,DC=resdm50,DC=ilab,DC=siemensmedasp,DC=com";
my $strComp = "alex";      # e.g. joe-xp
my $strDescr = "none";      # e.g. Joe’s Windows XP workstation

use Win32::OLE;
$Win32::OLE::Warn = 3;
# $ADS_USER_FLAG_ENUM
my $ADS_UF_WORKSTATION_TRUST_ACCOUNT = 0x1000;

my $objCont = Win32::OLE->GetObject("LDAP://" . $strBase);
my $objComp = $objCont->Create("computer", "cn=" . $strComp);
$objComp->Put("sAMAccountName", $strComp . "\$");
#$objComp->Put("description", $strDesc);
$objComp->Put("userAccountControl", $ADS_UF_WORKSTATION_TRUST_ACCOUNT);
$objComp->SetInfo;

This code works fine when I run it as a stand alone program.

When it runs under IIS, as cgi I am running into this error:

The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:


Win32::OLE(0.1701) error 0x80005000
    after character 0 in
"LDAP://OU=US-DC1,DC=resdm50,DC=ilab,DC=siemensmedasp,DC=com" at F:\ttx218\dev\joincomputer.pl line 22
     eval {...} called at F:\ttx218\dev\joincomputer.pl line 22

I have integrated windows authentication enabled, so the script runs under the same security permissions when i run it as IIS or as stand alone.

Has anyone encountered this issue?  

I have googled this error and found a couple of threads having similar issue

http://lists.ee.ethz.ch/realmen/msg00035.html

Unfortunately no resolution but they are getting the same OLE error.

 
-------------------------------------------------------------------------------
This message and any included attachments are from Siemens Medical Solutions
USA, Inc. and are intended only for the addressee(s).
The information contained herein may include trade secrets or privileged or
otherwise confidential information. Unauthorized review, forwarding, printing,
copying, distributing, or using such information is strictly prohibited and may
be unlawful. If you received this message in error, or have reason to believe
you are not authorized to receive it, please promptly delete this message and
notify the sender by e-mail with a copy to [EMAIL PROTECTED]

Thank you
_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to