Set-EntraUserManager
Updates a user's manager.
Syntax
Set-EntraUserManager
-UserId <String>
-RefObjectId <String>
[<CommonParameters>]
Description
The Set-EntraUserManager
cmdlet update the manager for a user in Microsoft Entra ID. Specify the UserId
and RefObjectId
parameters to update the manager for a user in Microsoft Entra ID.
Examples
Example 1: Update a user's manager
Connect-Entra -Scopes 'User.ReadWrite.All'
$manager = Get-EntraUser -UserId 'Manager@contoso.com'
Set-EntraUserManager -UserId 'SawyerM@contoso.com' -RefObjectId $manager.Id
This example demonstrates how to update the manager for the specified user.
Parameters
-RefObjectId
Specifies the ID of the Microsoft Entra ID object to assign as owner/manager/member.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-UserId
Specifies the ID (as a User Principle Name or ObjectId) of a user in Microsoft Entra ID.
Type: | System.String |
Aliases: | ObjectId |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |