Win32::OLE with IIS AppGetStatus()

Posted on 2004-10-28
Last Modified: 2012-05-05
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://LocalHost/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.
Question by:easycgi
    LVL 6

    Expert Comment

    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.

    Author Comment

    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.

    Author Comment

    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.

    Accepted Solution

    PAQed with points refunded (500)

    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
    A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (,  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    846 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now