Using the Command Get-WebApplicaton pulls back nothingRSS

5 replies

Last post Nov 01, 2011 01:47 PM by HCamper

  • Using the Command Get-WebApplicaton pulls back nothing

    Oct 26, 2011 04:30 PM|jeffincognito|LINK

    I'm creating a script that remotely gathers website information and restarts websites and recycles application pools on several servers across a network.

    On my test server the command "Invoke-command -computername "TestServer" -scriptblock {import-module webadministration;Get-WebApplicationl}" pulls back information for every running application pool as expected, However when I got to run my script against one or any of our production servers, this command returns nothing

    I've RDC'd into the server and run get-webapplication directly on the box and still get nothing back. I've verfied the web administration module in installed (server 2008 Rc2) and am able to run any other IIS Administration commands and get back results, it's just this one command that I'm having issues with. I need this as part of the script to return a list of currently running application pools to the user.

    Any Ideas?

    Of Note. the one difference I can identify between my test server and production server is that the production server is part of a clustered pair.

    iis 7 WebAdministration get-webapplication

  • Re: Using the Command Get-WebApplicaton pulls back nothing

    Oct 28, 2011 02:15 AM|HCamper|LINK

    Hi,

    From what you describe "Elevated Permissions" are needed before running the script.

    Another user had problems running Power Shell http://forums.iis.net/p/1181442/1995457.aspx#1995457 .

    You might look at the Technet Elevation Power Toys http://blogs.technet.com/b/elevationpowertoys/ and

    the suggestions for Power Shell.

    Martin

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: Using the Command Get-WebApplicaton pulls back nothing

    Oct 28, 2011 12:50 PM|jeffincognito|LINK

    Thanks Martin

    However, I would think that if I were having an issue with elevated permissions none of the web administration commands would work. I can call the commands Get-Website or Restart-Webapppool and they both work as expected, but Get-Webapplication is the only command I've tried that doesn't return expected data. I even RDC into the machine as an Admin and run the PS prompt as administrator and still have the same issue.

    I always run my scripts as either Administrator or schedule my task with elevated permissions when testing across our network, I've verified that the same command with the same permissions runs on my test server but not the production server.

    the only difference between the servers is my Production Server is part of the clustered group where the test server isn't.

  • Re: Using the Command Get-WebApplicaton pulls back nothing

    Oct 29, 2011 09:04 PM|HCamper|LINK

    Ok,

    Then have you looked at Windows Event logs for PowerShell on the machines ?

    When your doing this "I even RDC into the machine as an Admin and run the PS

     prompt as administrator and still have the same issue." what does the Powershell log show?

    Everything works on the Test Server but not on the Production Server FW  Security Restrictions Group Policy ?

    On the Production server Test Server  what are the differences ?

    Martin

     

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: Using the Command Get-WebApplicaton pulls back nothing

    Nov 01, 2011 01:35 PM|jeffincognito|LINK

    Unfortunately I don't seen anything in the Powershell log event log on the server in question. I looked in the system log, application log and the new 2008 windows powershell log The only difference between the servers is the test server is a stand alone machine and the Production server is part of a Clustered group as mentioned earlier. Otherwise the servers are configured the same and go through the same build checklist. I've confirmed I have full administrative rights on both servers.
  • Re: Power-Shell-Using:The cmdlet-Get-WebApplicaton-Empty

    Nov 01, 2011 01:47 PM|HCamper|LINK

    Hi,

    Is the IIS Server part of  Clustered Group  http://blogs.msdn.com/b/clustering/archive/2010/04/28/10003627.aspx 

    Regards,

    Martin

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011