Amar has asked for the wisdom of the Perl Monks concerning the following question:

hi monks-

Using perl cgi script from browser, trying to create a OLE object on server returns following error.

User credentials cannot be used for local connections

Win32::OLE(0.1702) error 0x80041064 in METHOD/PROPERTYGET "ConnectServer" at D:/cgi-bin/simkill.pl

below is my sample code :

my $loc = Win32::OLE->new("WbemScripting.SWbemLocator") + or die "err stms here"; my $servCon = $loc->ConnectServer($server, "root/cimv2", $username, $p +assword, "MS_409", "ntlmdomain:".$strDomain);

I checked out that user runs with Iusr_ComputerName privilege using IE on IIS which is only a guest Account. So i am supplying administrator user name and password when creating an OLE object in the code above. same code from command prompt runs well both on local and remote machines but when a cgi script is made it fails to run from the browser. I feel there is some security aspect to it.

I tried hard to find a solution but could not.

Help me wise monks...

regards

amar

Replies are listed 'Best First'.
Re: OLE object creation from browser returns error
by jdporter (Paladin) on May 25, 2005 at 10:55 UTC
    The problem is that permission to create OLE objects is different from permission to connect to the wbem server. If the user that the script is running as doesn't have permission to create OLE objects, you'll never even get to the point of being able to log in to the server with the supplied username/password. So I'd say you're out of luck, unless you can get an administrator to help you out with the permissions.
      thank u for a speedy reply.

      I am able to create OLE Object and unable to connect to wbem server.

      To connect to wbem server i am using administrator username and password without sucess.

      May be IIS always uses Iusr_ComputerName account to connect to Wbem server.Am i right!!!!. If so, is there a work around