how i recycle an iis apppool powershell?
i haven't unequivocally finished any windows scripting during all, i am during detriment lift off. anyway, fundamentally wish have book take an justification iis apppool recycle. i have finished investigate google haven't many success removing things work.
here i am perplexing now:
$apppoolname = $args[0]
$apppool = get-wmiobject -namespace "root\microsoftiisv2" -class "iisapplicationpools" where-object {$_.name -eq "w3svc/apppools/$apppoolname"}
$apppool.recycle()
and blunder i get:
get-wmiobject : parameter can't found matches parameter name '$_.name -eq "w3svc/apppools/$apppoolname"'.
anyway, good i also knew debug things this. i already bound bug uncanny book doing gwmi -namespace "root\microsoftiisv2" -list. any tips great.
thanks!
update: here some-more info
$apppool = gwmi -namespace "root\microsoftiisv2" -class "iisapplicationpools" | get-member
. typename: system.management.managementobject#root\microsoftiisv2\iisapplicationpools
name membertype definition
---- ---------- ----------
caption ability system.string streamer {get;set;}
description ability system.string outline {get;set;}
installdate ability system.string installdate {get;set;}
name ability system.string name {get;set;}
status ability system.string station {get;set;}
__class ability system.string __class {get;set;}
__derivation ability system.string[] __derivation {get;set;}
__dynasty ability system.string __dynasty {get;set;}
__genus ability system.int32 __genus {get;set;}
__namespace ability system.string __namespace {get;set;}
__path ability system.string __path {get;set;}
__property_count ability system.int32 __property_count {get;set;}
__relpath ability system.string __relpath {get;set;}
__server ability system.string __server {get;set;}
__superclass ability system.string __superclass {get;set;}
convertfromdatetime scriptmethod system.object convertfromdatetime();
converttodatetime scriptmethod system.object converttodatetime();
delete scriptmethod system.object delete();
gettype scriptmethod system.object gettype();
put scriptmethod system.object put();
gwmi -namespace "root\microsoftiisv2" -class "iisapplicationpools"
__genus : 2
__class : iisapplicationpools
__superclass : cim_logicalelement
__dynasty : cim_managedsystemelement
__relpath : iisapplicationpools.name="w3svc/apppools"
__property_count : 5
__derivation : {cim_logicalelement, cim_managedsystemelement}
__server : iron
__namespace : root\microsoftiisv2
__path : \\iron\root\microsoftiisv2:iisapplicationpools.name="w3svc/a
pppools"
caption :
description :
installdate :
name : w3svc/apppools
status :
Comments
Post a Comment