Genpact Cora Knowledge Center

Support

Changing the Application Pool Account

V9.0

Description

Use this script to change the identity for a Cora SeQuence site application pool in IIS. 

NOTE
This identity will be used for activities with the credential type “Application.”

Procedure

  1. In the Get-CoraSeQuenceSite, replace the SiteType parameter with the site type for which you need to set the application pool identity: Administration or Flowtime.
  2. Run the script.
  3. When prompted, enter the user credentials for the new application pool account.  

NOTE
If you want to use a built-in account, comment or comment out the areas indicated in the sample script.

Sample

#Get the site
$site = Get-CoraSeQuenceSite -SiteType Administration
if (-not ($site))
{
    Write-Error -Message "Site not found!"
}
else
{
    #Get the application pool object
    $applicationPool = Get-Item -Path "IIS:\AppPools\$($site.applicationPool)"


    #region custom account (comment out for built-in account)
        #Get the credentials to use for this application pool
        $applicationPoolAccount = Get-Credential
        #Set application pool properties for the service account
        $applicationPool | Set-ItemProperty -Name processModel.identityType -Value SpecificUser
        $applicationPool | Set-ItemProperty -Name processModel.userName -Value $applicationPoolAccount.UserName
        $applicationPool | Set-ItemProperty -Name processModel.password -Value $applicationPoolAccount.GetNetworkCredential().Password
    #endregion custom account


    #region built-in account (uncomment for built-in account)
        #$applicationPool | Set-ItemProperty -Name processModel.identityType -Value NetworkService
    #endregion built-in account


    #See available options for identityType here: https://docs.microsoft.com/en-us/iis/configuration/system.applicationhost/applicationpools/add/processmodel#configuration


    #Recycle the application pool
    $applicationPool.Recycle()
}