CreateUserAccount
ITcUserManager::CreateUserAccount
Sets up a new local user account.
HRESULT CreateUserAccount(
BSTR bstrUserName,
BSTR bstrPassword,
VARIANT varUserGroup,
VARIANT varDomain
);
Parameters
bstrUserName | [in] Name of the new user account. |
bstrPassword | [in] Character string for the desired password. |
varUserGroup | [in, optional] There is an option to specify a user group to which the new user account is to belong. The parameter provided must be of BSTR type to be accepted. |
varDomain | [in, optional] Similarly, there is an option to provide the domain in which the new user account is to be created. The parameter provided must be of BSTR type to be accepted. At the present time this option is not yet supported. |
Return Values
HRESULT = S_OK | User account has successfully been created. |
HRESULT <> S_OK | If an error occurs an error code generated by Windows NT appears in HRESULT. In order to instigate a COM/OLE error handling sequence, an HRESULT is created from the error code from HRESULT_FROM_NT(nErrror). Here it should be noted that the Windows NT error code is displayed in low-order 16 bit format. |
Comments
Along with the new user account CreateUserAccount creates additional user privileges, that are required for further functions of the TwinCAT User Manager (e.g. CreateProcessAsUser). | |
SE_TCB_NAME | "Act as part of the operating system". This privilege is required internally to log in a user. |
SE_ASSIGNPRIMARYTOKEN_NAME | "Replace process level token", is required for CreateProcessAsUser. |
SE_INCREASE_QUOTA_NAME | "Increase quotas", is also required for CreateProcessAsUser. |