external help file | Module Name | online version | schema |
---|---|---|---|
Win32_UserProfile.cdxml-help.xml |
userprofile |
2.0.0 |
Changes user profile owner.
Set-ProfileOwner -LocalPath <String[]> -SID <String> [-Flags <Flags>] [-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>] [-AsJob] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-ProfileOwner -InputObject <CimInstance[]> -SID <String> [-Flags <Flags>] [-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>] [-AsJob] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
The Set-ProfileOwner cmdlet replaces owner of one or more user profiles.
@{paragraph=PS C:\>}
$oldOwner = Get-AdUser John
$newOwner = Get-AdUser Joe
Get-UserProfile -SID $oldOwner.SID | Set-ProfileOwner -SID $newOwner.SID
This example takes user profile of John and replaces the owner with user Joe.
Specifies the user profile to process. Enter a User Profile CIM object, which you can get by using the Get-UserProfile cmdlet.
Type: CimInstance[]
Parameter Sets: InputObject (cdxml)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Specifies new owner's Security ID (SID) for user profile.
Type: String
Parameter Sets: (All)
Aliases: NewSID
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies, whether do you want to overwrite new owner's existing profile.
Type: Flags
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 1
Accept pipeline input: False
Accept wildcard characters: False
Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.
Type: CimSession[]
Parameter Sets: (All)
Aliases: Session
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies that the cmdlet should output an object representing a user profile. By default, this cmdlet does not generate any output.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies a path to one or more user profiles. Wildcards are permitted.
Type: String[]
Parameter Sets: ByPath
Aliases: Path
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
User Profile CIM object
None