UserEnvCreateProfile Method

Creates a new user profile.

The caller must have administrative privileges to create a user's profile.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("UserEnv.dll", CharSet = CharSet.Auto, ThrowOnUnmappableChar = true, 
	SetLastError = true)]
public static int CreateProfile(
	string userSid,
	string userName,
	StringBuilder profilePath,
	uint bufferSize
)

Parameters

userSid  String
Pointer to the SID of the user as a string.
userName  String
The user name of the new user.

This name is used as the base name for the profile directory.

profilePath  StringBuilder
When this function returns, contains a pointer to the full path of the profile.
bufferSize  UInt32
Size of the buffer pointed to by profilePath parameter, in characters.

Return Value

Int32
Returns S_OK if successful, otherwise, an HRESULT error value.

Remarks

See Also