Skip to content

Latest commit

 

History

History
220 lines (172 loc) · 5.01 KB

Set-ProfileOwner.md

File metadata and controls

220 lines (172 loc) · 5.01 KB
external help file Module Name online version schema
Win32_UserProfile.cdxml-help.xml
userprofile
2.0.0

Set-ProfileOwner

SYNOPSIS

Changes user profile owner.

SYNTAX

ByPath (Default)

Set-ProfileOwner -LocalPath <String[]> -SID <String> [-Flags <Flags>] [-CimSession <CimSession[]>]
 [-ThrottleLimit <Int32>] [-AsJob] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]

InputObject (cdxml)

Set-ProfileOwner -InputObject <CimInstance[]> -SID <String> [-Flags <Flags>] [-CimSession <CimSession[]>]
 [-ThrottleLimit <Int32>] [-AsJob] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

The Set-ProfileOwner cmdlet replaces owner of one or more user profiles.

EXAMPLES

Example 1

@{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.

PARAMETERS

-InputObject

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

-SID

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

-Flags

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

-CimSession

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

-ThrottleLimit

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

-AsJob

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

-PassThru

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

-WhatIf

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

-Confirm

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

-LocalPath

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

CommonParameters

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).

INPUTS

Microsoft.Management.Infrastructure.CimInstance#root/cimv2/Win32_UserProfile

User Profile CIM object

OUTPUTS

None

RELATED LINKS

Get-UserProfile