AppFabric Cmdlets Overview
A Windows PowerShell cmdlet for AppFabric is a simple command used for managing AppFabric and WCF and WF services hosted in WAS.
The action that the cmdlet takes, and the entity that is acted upon by the cmdlet, are indicated by the cmdlet name. Each cmdlet name includes a verb that indicates the action that the cmdlet takes, and a noun that indicates the entity that the cmdlet acts upon. For example, for the Stop-ASAppServiceInstance cmdlet, the verb is “stop” and the noun is “ASAppServiceInstance”, indicating that the cmdlet will stop the service instance specified in a parameter. A cmdlet with a verb of “stop” can be considered a control cmdlet, and a cmdlet with a noun of “ASAppServiceInstance” can be considered an instance cmdlet. As a result, the Stop-ASAppServiceInstance cmdlet is both a control cmdlet and an instance cmdlet. All AppFabric cmdlets can be categorized by what they do and what they act upon.
AppFabric Cmdlets and Their Actions
AppFabric cmdlets perform three basic actions: configuration, control operations, and queries. These three actions provide the basic functionality for managing applications, AppFabric databases, and system services. The verb in the cmdlet name provides an indication of which type of action the cmdlet performs.
Some cmdlets can fall into two action categories. For example, some Enable cmdlets and some Disable cmdlets can be control cmdlets as well as configuration cmdlets, based upon the situation.
Configuration Cmdlets
Configuration cmdlets perform their operations on one or more configuration files. In IIS, much of server, site, application, virtual directory, and service functionality is determined by entries in configuration files. Configuration cmdlets add, edit, or remove configuration elements from these files. Configuration cmdlets sometimes work with query cmdlets that return the applications or services that apply, such as Get-ASApplication, Get-ASAppService, or Get-ASAppServiceEndpoint. Configuration cmdlets work with the following configuration files:
For configuring applications and services, they work with Web.config files at the virtual directory, application, site, or server level.
For some server configuration settings, they work with machine.config.
For auto-start configuration at the application level, they work with applicationHost.config.
Some WCF/WF configuration can be performed using either configuration files or WCF/WF APIs. When this is the case, AppFabric uses configuration files, rather than APIs, to make the process more straightforward and transparent.
AppFabric configuration cmdlets often use Microsoft Web Administration (MWA) to adjust configuration settings. MWA is an API that edits the hierarchy of Web.config files. To work with MWA, AppFabric uses schema files in the folder <drive>:\Windows\System32\intersrv\config\schema. For more information about MWA, see Overview of MWA and MWM for IIS 7.0.
Control Cmdlets
Control cmdlets perform control operations on a service instance or application. The operations on a service instance include resuming, cancelling, terminating, or suspending a service instance. The operations on an application include starting and stopping.
Instance control cmdlets operate asynchronously. The command is enqueued and execution occurs in the background. Instance control cmdlets exercise WCF/WF APIs against the Instance Control Endpoint. Control cmdlets work through the WCFEndpoint service. In some cases, instance control cmdlets save or remove a service instance from memory, depending upon the state of the service instance and the nature of the cmdlet.
Query Cmdlets
Query cmdlets run queries against SQL databases, and in some cases against configuration files, to return enumeration lists and/or monitoring metrics. Query cmdlets include application cmdlets, tracking query cmdlets, and performance cmdlets. These cmdlets can return instances (persisted or tracked), services, endpoints, tracked events, applications, sites, and virtual directories. The verb for these cmdlets is Get. Examples are Get-ASAppServiceInstance and Get-ASAppServiceTrackingProfile, which return results from database queries. Examples of query cmdlets that also return results from configuration files are Get-ASAppServiceTrackingProfile, Get-ASApplication, Get-ASAppService, and Get-ASAppServiceEndpoint.
Database Management Cmdlets
Database management cmdlets perform operations on both the persistence and monitoring databases. These operations include initializing the databases, clearing or removing the databases, and setting the connection string.
What AppFabric Cmdlets Act Upon
AppFabric cmdlets act upon three basic scopes: the service, the application, and the server.
Service management cmdlets. Service cmdlets act upon services and service instances, including service configuration, service instance control, and service or instance enumerations and metrics. The noun of a service management cmdlet often includes the term “service” or “instance”.
Application management cmdlets. Application cmdlets perform application configuration, enumerations, and metrics. The noun of an application management cmdlet often includes the term “application”.
Server management cmdlets. Server cmdlets act upon the persistence and monitoring databases and the system services. The user interface that you use to configure the databases and the system services (the Workflow Management Service and the Event Collection Service) executes these cmdlets. The noun of a server management cmdlet often includes the term “database” or “event collector”.
Cmdlet Security
AppFabric cmdlets do not perform any security validation. Instead, they rely on the technologies that underlie them to perform security validation for them, as shown in the following list. For more information about cmdlet security, see Security and Protection.
Configuration cmdlets rely upon the file system for authorization. They also use MWA to prevent elevation of privilege, because MWA’s security measures prevent any unauthorized user from accessing restricted sites and applications.
Control cmdlets rely upon the service to authorize the caller of the cmdlet.
Query cmdlets use SQL security groups for authorization.
2012-09-12