Wednesday, 18 April 2018

appcmd - to list sites using wildcard mapping

You can use wildcard characters with appcmd using the following syntax:

appcmd list apppool /name:"$=*2007"
This command will list all application pools with a name ending in "2007". Using a variation on the same method, you can find all application pools running under the identify of users in a particular domain.
appcmd list apppool /processModel.userName:"$=MyDomain\*"
This will list all application pools with running with an identity of users in the "MyDomain" domain.
appcmd list site /name:"$=*cdo*"
This will list all sites with a name having "cdo".
Tip: You can find out all of the attributes that can be used with appcmd by querying for help after using an attribute. For example:
appcmd list apppools /name:DefaultAppPool -?
ERROR ( message:-name 
-queueLength 
-autoStart 
-enable32BitAppOnWin64 
-managedRuntimeVersion 
-enableConfigurationOverride 
-managedPipelineMode 
-passAnonymousToken 
-processModel.identityType 
-processModel.userName 
-processModel.password 
-processModel.loadUserProfile 
-processModel.manualGroupMembership 
-processModel.idleTimeout 
-processModel.maxProcesses 
-processModel.shutdownTimeLimit 
-processModel.startupTimeLimit 
-processModel.pingingEnabled 
-processModel.pingInterval 
-processModel.pingResponseTime 
-recycling.disallowOverlappingRotation 
-recycling.disallowRotationOnConfigChange 
-recycling.logEventOnRecycle 
-recycling.periodicRestart.memory 
-recycling.periodicRestart.privateMemory 
-recycling.periodicRestart.requests 
-recycling.periodicRestart.time 
-recycling.periodicRestart.schedule.[value='timespan'].value 
-failure.loadBalancerCapabilities 
-failure.orphanWorkerProcess 
-failure.orphanActionExe 
-failure.orphanActionParams 
-failure.rapidFailProtection 
-failure.rapidFailProtectionInterval 
-failure.rapidFailProtectionMaxCrashes 
-failure.autoShutdownExe 
-failure.autoShutdownParams 
-cpu.limit 
-cpu.action 
-cpu.resetInterval 
-cpu.smpAffinitized 
-cpu.smpProcessorAffinityMask 
-cpu.smpProcessorAffinityMask2 
)
By appending "-?" to the command above, appcmd generates an error that lists all of the attributes that can be used with application pools.

Source : https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc771280(v%3dws.10)