UserEnvCreateProfile Method
Creates a new user profile.
The caller must have administrative privileges to create a user's profile.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("UserEnv.dll", CharSet := CharSet.Auto, ThrowOnUnmappableChar := true,
SetLastError := true>]
Public Shared Function CreateProfile (
userSid As String,
userName As String,
<OutAttribute> profilePath As StringBuilder,
bufferSize As UInteger
) As Integer
Dim userSid As String
Dim userName As String
Dim profilePath As StringBuilder
Dim bufferSize As UInteger
Dim returnValue As Integer
returnValue = UserEnv.CreateProfile(userSid,
userName, profilePath, bufferSize)
public:
[DllImportAttribute(L"UserEnv.dll", CharSet = CharSet::Auto, ThrowOnUnmappableChar = true,
SetLastError = true)]
static int CreateProfile(
String^ userSid,
String^ userName,
[OutAttribute] StringBuilder^ profilePath,
unsigned int bufferSize
)
[<DllImportAttribute("UserEnv.dll", CharSet = CharSet.Auto, ThrowOnUnmappableChar = true,
SetLastError = true)>]
static member CreateProfile :
userSid : string *
userName : string *
profilePath : StringBuilder byref *
bufferSize : uint32 -> int
No code example is currently available or this language may not be supported.
- 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.
Int32
Returns
S_OK if successful, otherwise, an
HRESULT error value.