Deprecated: Return type of Requests_Cookie_Jar::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Cookie/Jar.php on line 63

Deprecated: Return type of Requests_Cookie_Jar::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Cookie/Jar.php on line 73

Deprecated: Return type of Requests_Cookie_Jar::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Cookie/Jar.php on line 89

Deprecated: Return type of Requests_Cookie_Jar::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Cookie/Jar.php on line 102

Deprecated: Return type of Requests_Cookie_Jar::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Cookie/Jar.php on line 111

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 40

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 51

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 68

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 82

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 91
PowerShell komande za proveru IIS-a i stanja Application Pools – Linux, Windows, Heklanje, Kuhinja

PowerShell komande za proveru IIS-a i stanja Application Pools

PS pre početka :
Lokacija PowerShell modula na Internetu : https://www.powershellgallery.com/
Ako vam treba spisak PowerShell modula i njihovi folderi (radi dodavanja u PATH varijablu za WIN 10), to se lista iz PS-a (kao Administrator), sa komadom :
PS IIS:\> Get-Module -ListAvailable *
Kada PS moluls foldere ubacite u PATH variablu (link), onda ih možete prizvati sa bilo koje lokacije na datoj mašini.
*****
Mertod 1 : PowerShell
Za proveru stanja Application Pools na lokalnoj mašini (link) :
PS IIS:\> Get-IISAppPool
Name Status CLR Ver Pipeline Mode Start Mode
—- —— ——- ————- ———-
DefaultAppPool Started v4.0 Integrated OnDemand
*****
Stvar je u tome što meni treba da proveravam stanje Application Pools za IIS-ove na udaljenim serverima.
Evo kako to može (istina radim sa localhost, ali za početak nije loše) (link) :
PS IIS:\> enter-pssession -computername localhost
[localhost]: PS D:\Moja Dokumenta> get-iisapppool
Name Status CLR Ver Pipeline Mode Start Mode
—- —— ——- ————- ———-
DefaultAppPool Started v4.0 Integrated OnDemand
Napomena1 : moj WIN 10 je u domenu, a ja sam Admin za udaljene servere koje proveravam, tako da nema potrebe ubacivati username+pass kombinaciju.
Napomena2 : ovo naravno ne funkcioniše ako date PowerShell komande nisu instalirane na udaljenom serveru. A uglavnom nisu. Cvrc.
*****
Kako naći PID procesa za pojedinačni Application Pool, zavisi da li je u pitanju IIS 6 ili IIS 7 (link).
*****
Metod 2 : Command Line Interface (CLI)
Može se koristiti komanda appcmd (link) u kombinaciji sa PSTools setom komandi koje je napravio Microsoft i koje baš i služe za ovakve stvari (link), a appcmd komanda se nalazi ovde : C:\Windows\System32\inetsrv (to je slučaj sa manje-više svim MS serverima).
Iz komandne linije pokrenute kao AD nalog koji ima Administrativna prava nad udaljenim serverom :
c:\PSTools>psexec \\udaljeni.server c:\Windows\System32\inetsrv\appcmd list apppools
PsExec v2.2 – Execute processes remotely
Copyright (C) 2001-2016 Mark Russinovich
Sysinternals – www.sysinternals.com
APPPOOL “DefaultAppPool” (MgdVersion:v2.0,MgdMode:Integrated,state:Started)
APPPOOL “Classic .NET AppPool” (MgdVersion:v2.0,MgdMode:Classic,state:Started)
APPPOOL “ASP.NET v4.0” (MgdVersion:v4.0,MgdMode:Integrated,state:Started)
APPPOOL “ASP.NET v4.0 Classic” (MgdVersion:v4.0,MgdMode:Classic,state:Started)
c:\Windows\System32\inetsrv\appcmd exited on udaljeni.server with error code 0.
###########################
Napomena : ovakav remote prostup takođe daje i mogućnost (a moj nalog ima ta prava) da se Application Pool restartuje sa moje mašine, ali o tome drugi put 😉