ChangeOwner method of the Win32_UserProfile class
The ChangeOwner method changes the owner of a user profile to a different user.
Syntax
uint32 ChangeOwner( [in] string NewOwnerSID, [in] uint32 Flags );
Parameters
- NewOwnerSID [in]
-
Specifies the SID of the new owner of the profile.
- Flags [in]
-
Specifies a set of bit flags to replace or delete a profile. This parameter can be set to one or more of the following values.
Remarks
Because the ChangeOwner method modifies the SID of the user profile, the user of the WMI object must perform one of these steps when using this method:
-
Call ChangeOwner, and then reinstall all apps.
Note If this step is taken, access control lists (ACLs) may contain incorrect settings. -
Remove all apps before calling ChangeOwner, and then reinstall those apps after the call.
Note This step is the cleaner solution, but app state and settings may be lost.
Examples
To use Win32_UserProfile to migrate a user to a new domain, see the following Vista’s MoveUser.exe replacement article on TechNet.
Requirements
|
Minimum supported client | Windows Vista with SP1 |
|---|---|
|
Minimum supported server | Windows Server 2008 |
|
Namespace |
Root\CIMV2 |
|
MOF |
|
|
DLL |
|
See also