次の方法で共有


ChangeOwner method of the Win32_UserProfile class

Changes a user profile's owner.

Syntax

uint32 ChangeOwner(
  [in] string NewOwnerSID,
  [in] uint32 Flags
);

Parameters

NewOwnerSID [in]

The new owner's security identifier (SID).

Flags [in]

Flag values that control what happens to the new owner's existing profile, if such a profile exists.

Flag value Meaning
ReplaceNewOwnerProfile
0x00000001
If this flag is set and the new owner already has a profile, the new owner's existing profile will be replaced.
If this flag is not set and the new owner already has a profile, the call to ChangeOwner will fail with HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS).
If the new owner doesn't already have a profile, this flag has no effect.
DeleteReplacedProfile
0x00000002
If the ReplaceNewOwnerProfile flag is not set, this flag has no effect.
Otherwise, if this flag is set and the new owner already has a profile, the new owner's existing profile will be deleted when it is replaced.
If this flag is not set, the existing profile is replaced but not deleted. The replaced profile will not be enumerated, and no user will automatically use it.

Requirements

Minimum supported client
Windows 8 [desktop apps only]
Minimum supported server
Windows Server 2012 [desktop apps only]
Namespace
Root\CIMv2
MOF
UserProfileWmiProvider.mof

See also

Win32_UserProfile