SPWebApplication.RemoveIdentityFromLocalGroups Method
Removes the current application pool from local groups if it is not used by other Web applications on the server.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No