locked
Get IIS Server health from Multiple remote computers RRS feed

Answers

  • I used code as per your suggestion but same error I am getting.
    $website = gwmi -ns root\webadministration -class site -computer $ServerName -authentication 6 | where-object {$_.__CLASS -eq "IIsWebServerSetting"}

    gwmi : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
    At line:8 char:12
    + $website = gwmi -ns root\webadministration -class site -computer $ServerName -au ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Get-WmiObject], UnauthorizedAccessException
        + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

    Monday, January 29, 2018 8:46 AM

All replies

  • Please fix you post.  Post code with the code posting tool provided.


    \_(ツ)_/

    Monday, January 29, 2018 5:37 AM
  • It would be better if you fixed your first post.  It is completely unreadable.  Go back and edit it so it makes sense.


    \_(ツ)_/

    Monday, January 29, 2018 6:07 AM
  • post fixed, can you please give me any suggesting related my post?

    Monday, January 29, 2018 7:21 AM
  • Thank you.  now that we can read your post it is clear that you have not asked a question.  Stating what you want to do is not a question.

    We do not fix or rewrite scripts found on the Internet.  You must post scripts that you have written and a clear question as well as any full error messages.


    \_(ツ)_/

    Monday, January 29, 2018 7:25 AM
  • This Script is written by me and I have question regarding method I am using to pulling IIS Sites and App pool Setting. I am not able to pool IIS website and application pool data from remote Servers. for Local Server the script is working fine.
    Monday, January 29, 2018 7:28 AM
  • What is the error you are getting?


    \_(ツ)_/

    Monday, January 29, 2018 7:29 AM
  • The WMI calls will only work with IIS 6.0 or when IIS ^ support is installed..


    \_(ツ)_/

    Monday, January 29, 2018 7:36 AM
  • IIS 6 support is not installed on Web Servers.
    Monday, January 29, 2018 7:39 AM
  • I am getting below error.
    get-wmiobject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
    At line:8 char:12
    + $website = get-wmiobject -namespace "root\microsoftiisv2" -class iissetting -com ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Get-WmiObject], UnauthorizedAccessException
        + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

    
    Monday, January 29, 2018 7:44 AM
  • Your code will not work if IIS 6 support is not installed.

    The new WMI classes are here:

     gwmi -ns root\webadministration -class site -ComputerName alpha


    \_(ツ)_/

    Monday, January 29, 2018 7:49 AM
  • I used code as per your suggestion but same error I am getting.
    $website = gwmi -ns root\webadministration -class site -computer $ServerName -authentication 6 | where-object {$_.__CLASS -eq "IIsWebServerSetting"}

    gwmi : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
    At line:8 char:12
    + $website = gwmi -ns root\webadministration -class site -computer $ServerName -au ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Get-WmiObject], UnauthorizedAccessException
        + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

    Monday, January 29, 2018 8:46 AM
  • Sorry but WebAdministration has to be installed and you have to be an administrator.  On the local system you must run elevated.

    To learn how to use and work with IIS post here: http://forums.iis.net

    Do not add "Authintiation".  The Where cannot be used with this namespace.


    \_(ツ)_/

    Monday, January 29, 2018 9:05 AM
  • I have installed Webadministration on my test environment but still same error. can you please test the share code and revert me with updated one?

    
    Tuesday, January 30, 2018 2:34 AM
  • So far it has become clear that you have no PowerShell experience other than a few locl commands.  I recommend taking the time to learn PowerSHell to a reasonable technical level before attempting more complex ventures.

    WebAdminstration has to be installed on all IIS servers to use.  You would then remote into each server to manage the local IIS on that  server.


    \_(ツ)_/

    Tuesday, January 30, 2018 2:38 AM
  • Thanks for your comments.
    Tuesday, January 30, 2018 7:18 AM
  • I will try to fix it myself, yes you are correct I have only 1 year exp in powershell, not champ like you. That why I posted my code to Microsoft portal to analyse and give me the suggestions and fix. but instead of giving me a fix. you are raising concern about my knowledge.

    Anyway Mr Champ, I will try to learn technology asap and will come back again to Microsoft portal.

    Thanks for your efforts.

    Tuesday, January 30, 2018 7:27 AM
  • You may have been using PowerShell but with no formal training.  That is good but now it is time to go back and learn what you have missed. Copying what others have done or reading forums is good for familiarizing but not good for learning the technical basics.

    Here is a good place to learn the fundamentals and to get a full review of what PowerShell is and how it is intended to work: Learn PowerShell  


    \_(ツ)_/


    • Edited by jrv Tuesday, January 30, 2018 7:34 AM
    Tuesday, January 30, 2018 7:34 AM