Quantcast
Channel: SharePoint 2010 - Setup, Upgrade, Administration and Operations forum
Viewing all articles
Browse latest Browse all 13778

How to get appPool status of remote machine using powershell ?

$
0
0

Hello,

I have PS script that get appPool status of current machine as below :

try{
Import-Module WebAdministration
Get-WebApplication

$webapps = Get-WebApplication
$list = @()
foreach ($webapp in get-childitem IIS:\AppPools\)
{
$name = "IIS:\AppPools\" + $webapp.name
$item = @{}

$item.WebAppName = $webapp.name
$item.Version = (Get-ItemProperty $name managedRuntimeVersion).Value
$item.State = (Get-WebAppPoolState -Name $webapp.name).Value
$item.UserIdentityType = $webapp.processModel.identityType
$item.Username = $webapp.processModel.userName
$item.Password = $webapp.processModel.password

$obj = New-Object PSObject -Property $item
$list += $obj
}
}catch
{
$ExceptionMessage = "Error in Line: " + $_.Exception.Line + ". " + $_.Exception.GetType().FullName + ": " + $_.Exception.Message + " Stacktrace: " + $_.Exception.StackTrace
$ExceptionMessage
}

$IISAppPool = $list | select WebAppName,UserIdentityType,Username,State

However, I require to run above code for remote machine.

I have tried creating above as custom function to specify via invoke command but it has thrown error saying function was not getting recognized.

 would you please help me to resolve the same ?

Thanks and Regards,


Dipti Chhatrapati


Viewing all articles
Browse latest Browse all 13778

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>