|
| 1 | +--- |
| 2 | +Module Name: PnP.PowerShell |
| 3 | +schema: 2.0.0 |
| 4 | +applicable: SharePoint Online |
| 5 | +online version: https://pnp.github.io/powershell/cmdlets/Enable-PnPPriviledgedIdentityManagement.html |
| 6 | +external help file: PnP.PowerShell.dll-Help.xml |
| 7 | +title: Enable-PnPPriviledgedIdentityManagement |
| 8 | +--- |
| 9 | + |
| 10 | +# Enable-PnPPriviledgedIdentityManagement |
| 11 | + |
| 12 | +## SYNOPSIS |
| 13 | + |
| 14 | +**Required Permissions** |
| 15 | + |
| 16 | +* Microsoft Graph: RoleAssignmentSchedule.ReadWrite.Directory |
| 17 | + |
| 18 | +Temporarily enables a Privileged Identity Management role for a user |
| 19 | + |
| 20 | +## SYNTAX |
| 21 | + |
| 22 | +### By Role Name And Principal |
| 23 | + |
| 24 | +```powershell |
| 25 | +Enable-PnPPriviledgedIdentityManagement -Role <PriviledgedIdentityManagementRolePipeBind> [-PrincipalId <Guid>] [-Justification <string>] [-StartAt <DateTime>] [-ExpireInHours <short>] [-Connection <PnPConnection>] |
| 26 | +``` |
| 27 | + |
| 28 | +### By Role Name And User |
| 29 | + |
| 30 | +```powershell |
| 31 | +Enable-PnPPriviledgedIdentityManagement -Role <PriviledgedIdentityManagementRolePipeBind> -User <AzureADUserPipeBind> [-Justification <string>] [-StartAt <DateTime>] [-ExpireInHours <short>] [-Connection <PnPConnection>] |
| 32 | +``` |
| 33 | + |
| 34 | +### By Eligible Role Assignment |
| 35 | + |
| 36 | +```powershell |
| 37 | +Enable-PnPPriviledgedIdentityManagement -EligibleAssignment <PriviledgedIdentityManagementRolePipeBind> [-Justification <string>] [-StartAt <DateTime>] [-ExpireInHours <short>] [-Connection <PnPConnection>] |
| 38 | +``` |
| 39 | + |
| 40 | +## DESCRIPTION |
| 41 | +Temporarily enables a Privileged Identity Management role for the provided allowing the user to perform actions that require the role. The role will be enabled starting at the specified date and time and will expire after the specified number of hours. The reason for the elevation of rights can be provided as justification. |
| 42 | + |
| 43 | +## EXAMPLES |
| 44 | + |
| 45 | +### Example 1 |
| 46 | +```powershell |
| 47 | +Enable-PnPPriviledgedIdentityManagement -Role "Global Administrator" |
| 48 | +``` |
| 49 | + |
| 50 | +Enables the global administrator role for the current user through Privileged Identity Management starting immediately and expiring in 1 hour |
| 51 | + |
| 52 | +### Example 2 |
| 53 | +```powershell |
| 54 | +Enable-PnPPriviledgedIdentityManagement -Role "Global Administrator" -Justification "Just because" |
| 55 | +``` |
| 56 | + |
| 57 | +Enables the global administrator role for the current user through Privileged Identity Management starting immediately and expiring in 1 hour, adding the justification provided to be logged as the reason for the elevation of rights |
| 58 | + |
| 59 | +### Example 3 |
| 60 | +```powershell |
| 61 | +Enable-PnPPriviledgedIdentityManagement -Role "Global Administrator" -Justification "Just because" -StartAt (Get-Date).AddHours(2) -ExpireInHours 2 |
| 62 | +``` |
| 63 | + |
| 64 | +Enables the global administrator role for the current user through Privileged Identity Management starting in 2 hours from now and expiring 2 hours thereafter, adding the justification provided to be logged as the reason for the elevation of rights |
| 65 | + |
| 66 | +### Example 4 |
| 67 | +```powershell |
| 68 | +Enable-PnPPriviledgedIdentityManagement -Role "Global Administrator" -User "someone@contoso.onmicrosoft.com" |
| 69 | +``` |
| 70 | + |
| 71 | +Enables the global administrator role for the provided user through Privileged Identity Management starting immediately and expiring in 1 hour |
| 72 | + |
| 73 | +## PARAMETERS |
| 74 | + |
| 75 | +### -Connection |
| 76 | +Optional connection to be used by the cmdlet. |
| 77 | +Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. |
| 78 | + |
| 79 | +```yaml |
| 80 | +Type: PnPConnection |
| 81 | +Parameter Sets: (All) |
| 82 | +Aliases: |
| 83 | + |
| 84 | +Required: False |
| 85 | +Position: Named |
| 86 | +Default value: None |
| 87 | +Accept pipeline input: False |
| 88 | +Accept wildcard characters: False |
| 89 | +``` |
| 90 | +
|
| 91 | +### -ExpireInHours |
| 92 | +Indication of after how many hours the elevation should expire. If omitted, the default value is 1 hour. |
| 93 | +
|
| 94 | +```yaml |
| 95 | +Type: short |
| 96 | +Parameter Sets: (All) |
| 97 | +Aliases: |
| 98 | + |
| 99 | +Required: False |
| 100 | +Position: Named |
| 101 | +Default value: 1 |
| 102 | +Accept pipeline input: False |
| 103 | +Accept wildcard characters: False |
| 104 | +``` |
| 105 | +
|
| 106 | +### -Justification |
| 107 | +Text to be logged as the reason for the elevation of rights. If omitted, the default value is "Elevated by PnP PowerShell". |
| 108 | +
|
| 109 | +```yaml |
| 110 | +Type: string |
| 111 | +Parameter Sets: (All) |
| 112 | +Aliases: |
| 113 | + |
| 114 | +Required: False |
| 115 | +Position: Named |
| 116 | +Default value: "Elevated by PnP PowerShell" |
| 117 | +Accept pipeline input: False |
| 118 | +Accept wildcard characters: False |
| 119 | +``` |
| 120 | +
|
| 121 | +### -PrincipalId |
| 122 | +The Id of of the principal to elevate. If omitted, the default value is the current user, if the connection has been made using a delegated identity. With an application identity, this parameter is required. |
| 123 | +
|
| 124 | +```yaml |
| 125 | +Type: Guid |
| 126 | +Parameter Sets: By Role Name And Principal |
| 127 | +Aliases: |
| 128 | + |
| 129 | +Required: False |
| 130 | +Position: Named |
| 131 | +Default value: None |
| 132 | +Accept pipeline input: False |
| 133 | +Accept wildcard characters: False |
| 134 | +``` |
| 135 | +
|
| 136 | +### -Role |
| 137 | +The Id, name or instance of a role to elevate the current user to. Use `Get-PnPPriviledgedIdentityManagementRole` to retrieve the available roles. |
| 138 | + |
| 139 | +```yaml |
| 140 | +Type: PriviledgedIdentityManagementRolePipeBind |
| 141 | +Parameter Sets: By Role Name And Principal, By Role Name And User |
| 142 | +Aliases: |
| 143 | +
|
| 144 | +Required: True |
| 145 | +Position: Named |
| 146 | +Default value: None |
| 147 | +Accept pipeline input: True |
| 148 | +Accept wildcard characters: False |
| 149 | +``` |
| 150 | + |
| 151 | +### -StartAt |
| 152 | +Date and time at which to start the elevation. If omitted, the default value is the current date and time, meaning the activation will happen immediately. |
| 153 | + |
| 154 | +```yaml |
| 155 | +Type: DateTime |
| 156 | +Parameter Sets: (All) |
| 157 | +Aliases: |
| 158 | +
|
| 159 | +Required: False |
| 160 | +Position: Named |
| 161 | +Default value: Get-Date |
| 162 | +Accept pipeline input: False |
| 163 | +Accept wildcard characters: False |
| 164 | +``` |
| 165 | + |
| 166 | +### -User |
| 167 | +The Id, username or instance of a user which needs to be elevated |
| 168 | + |
| 169 | +```yaml |
| 170 | +Type: AzureADUserPipeBind |
| 171 | +Parameter Sets: By Role Name And User |
| 172 | +Aliases: |
| 173 | +
|
| 174 | +Required: True |
| 175 | +Position: Named |
| 176 | +Default value: None |
| 177 | +Accept pipeline input: False |
| 178 | +Accept wildcard characters: False |
| 179 | +``` |
| 180 | + |
| 181 | +## RELATED LINKS |
| 182 | + |
| 183 | +[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) |
0 commit comments