Unable to re-add user to site: " The user name could not be found. (Error code 2221) "

Created:

2016-11-16 13:20:42 UTC

Modified:

2017-04-24 11:11:43 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to re-add user to site: " The user name could not be found. (Error code 2221) "

Applicable to:

  • Plesk 10.4 for Windows
  • Plesk 11.0 for Windows
  • Plesk 11.5 for Windows
  • Plesk 12.0 for Windows
  • Plesk 12.5 for Windows

Symptoms

The following error appears when reconfiguring the domain:

websrvmng.exe --reconfigure-vhost --vhost-name=example.com
The user name could not be found. (Error code 2221) at NetUserSetInfo()

Domain is assigned to dedicated application pool.

Cause

Incorrect application pool identity for the domain is set.

Resolution

Correct the application pool identity based on the permission assigned to the domain directories:

  1. Find application pool assigned to domain example.com :

    %systemroot%\\system32\\inetsrv\\appcmd list apppool | findstr example.com
    APPPOOL "example.com(domain)(4.0)(pool)" (MgdVersion:v2.0,MgdMode:Integrated,state:Started)
  2. Specify the account identity for an application pool to use:

    appcmd set config /section:applicationPools /[name='example.com(domain)(4.0)(pool)'].processModel.identityType:LocalService

In case if domain has dedicated application pool assigned, perform steps 1 and 2 from above and then:

  1. Determine the name of web user which owns the domain example.com :

    cd %plesk_vhosts%
    icacls example.com | findstr IUSR
    SERVER_NAME\\IUSR_domain_user:(RX)
  2. Change the password for the system user:

    net user IUSR_domain_user <new_password>
  3. Configure an application pool 'example.com(domain)(4.0)(pool)' to use a custom identity with a user name of 'IUSR_domain_user' and a password ' ', type the following at the command prompt, and then press ENTER:

    appcmd set config /section:applicationPools /[name='IUSR_domain_user'].processModel.identityType:SpecificUser /[name='IUSR_domain_user'].processModel.userName: IUSR_domain_user /[name='IUSR_domain_user'].processModel.password: <new_password>
  4. Rerun domain reconfiguration:

    websrvmng.exe --reconfigure-vhost --vhost-name=example.com
Have more questions? Submit a request
Please sign in to leave a comment.