easycgi
asked on
Win32::OLE with IIS AppGetStatus()
I'm trying to use Win32::OLE with IIS 5.0. The AppGetStatus() method is not returning any values when run on an IIsWebDirectory. I've tried this both with and without an application installed on the directory. Code example follows:
use Win32;
use Win32::OLE;
$obj = Win32::OLE->GetObject("IIS ://LocalHo st/W3SVC/9 /ROOT/foo" )
or die "Can't access IIS on the local machine\n";
print $obj->AppGetStatus();
The IIS 5.0 documentation refers to three constants (APPSTATUS_NOTDEFINED, APPSTATUS_RUNNING, and APPSTATUS_STOPPED) that can be returned, but no values are returned at all, so I can't check on any equality.
use Win32;
use Win32::OLE;
$obj = Win32::OLE->GetObject("IIS
or die "Can't access IIS on the local machine\n";
print $obj->AppGetStatus();
The IIS 5.0 documentation refers to three constants (APPSTATUS_NOTDEFINED, APPSTATUS_RUNNING, and APPSTATUS_STOPPED) that can be returned, but no values are returned at all, so I can't check on any equality.
The first thing I would try is to change the user ID, under which the IIS virtual directory, executing this script is running to a Local Administrator - just to check if this is a permission issue and the IIS Anonymous user might have no access to the Object Path.
ASKER
The test was ran from the command line while logged in as a Domain Admin. We can get other objects like the application name just fine. It is just the GetAppStatus() we are having the problem with.
ASKER
So we gave up on using GetAppStatus(), instead we are just checking to see if the FriendlyName exists which accomplishes the same task. Thanks for your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.