Collapse the table of content
Expand the table of content

RemapAndMoveUser Function

Windows Server 2003

The RemapAndMoveUser function transfers the security settings and user profile from one user account to another.


BOOL WINAPI RemapAndMoveUserA(
  __in LPCSTR pComputer,
  __in DWORD dwFlags,
  __in LPCSTR pCurrentUser,
  __in LPCSTR pNewUser

BOOL WINAPI RemapAndMoveUserW(
  __in LPCWSTR pComputer,
  __in DWORD dwFlags,
  __in LPCWSTR pCurrentUser,
  __in LPCWSTR pNewUser



Parameter Description

pComputer [in]

Specifies the name of the computer on which the function is run. This is a pointer to a null-terminated string, and the format of the string must be “.” or \\computer. If pComputer is NULL, the function will run locally.

dwFlags [in]

Specifies how the settings and user profile will be transferred. The following flag is optional.


If pCurrentUser is a local user account, then the user account is retained.

pCurrentUser [in]

Specifies the existing user account. Specify the user account in DOMAIN\user or COMPUTER\user format. This user account must have a local profile.

pNewUser [in]

Specifies the new user account where the security settings and profile of pCurrentUser will be transferred. Specify the user account in DOMAIN\user or COMPUTER\user format.

Return Value

True if the settings and user profile are successfully transferred; otherwise, False. Use GetLastError to get the failure code.


For more information about moving user profiles on a computer running the Windows Vista operating system, see the Knowledge Base article at the Microsoft Web site (




Requires Windows XP


Requires profmap.dll

© 2015 Microsoft