Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added parameter IncreaseRequestTimeout to `Get-PnPSearchCrawlLog` cmdlet. [#5223](https://github.com/pnp/powershell/pull/5223)

### Fixed
- Fix `Get-PnPEntraIDUser` to align supported Graph permission metadata, preserve `-Select` for GUID-based identity lookups, and expose `-UseBeta` consistently across parameter sets. [#5290](https://github.com/pnp/powershell/pull/5290)
- Fix `Set-PnPView -Aggregations` parameter not showing aggregations in SharePoint online. [#4868](https://github.com/pnp/powershell/pull/4868)
- Fix `-CreateDrive` parameter not working correctly in `Connect-PnPOnline`. [#4869](https://github.com/pnp/powershell/pull/4869)
- Fix `Get/Remove/Restore-PnPFileVersion` cmdlets to properly handle file names which have encoded values.
Expand Down
20 changes: 17 additions & 3 deletions documentation/Get-PnPEntraIDUser.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ Retrieves users from Entra ID. By default the following properties will be loade

### Return a list (Default)
```powershell
Get-PnPEntraIDUser [-Filter <String>] [-OrderBy <String>] [-Select <String[]>] [-StartIndex <Int32>] [-EndIndex<Int32>] [-Connection <PnPConnection>]
Get-PnPEntraIDUser [-Filter <String>] [-OrderBy <String>] [-Select <String[]>] [-StartIndex <Int32>] [-EndIndex <Int32>] [-UseBeta] [-Connection <PnPConnection>]
```

### Return by specific ID
```powershell
Get-PnPEntraIDUser [-Identity <String>] [-Select <String[]>] [-Connection <PnPConnection>]
Get-PnPEntraIDUser [-Identity <String>] [-Select <String[]>] [-UseBeta] [-Connection <PnPConnection>]
```

### Return the delta
```powershell
Get-PnPEntraIDUser [-Filter <String>] [-OrderBy <String>] [-Select <String[]>] [-Delta] [-DeltaToken <String>] [-StartIndex <Int32>] [-EndIndex<Int32>] [-Connection <PnPConnection>]
Get-PnPEntraIDUser [-Filter <String>] [-OrderBy <String>] [-Select <String[]>] [-Delta] [-DeltaToken <String>] [-StartIndex <Int32>] [-EndIndex <Int32>] [-UseBeta] [-Connection <PnPConnection>]
```

## DESCRIPTION
Expand Down Expand Up @@ -226,6 +226,20 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -UseBeta
Uses the Microsoft Graph beta endpoint instead of the v1.0 endpoint.

```yaml
Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Connection
Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Expand Down
7 changes: 6 additions & 1 deletion src/Commands/EntraID/GetEntraIDUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
namespace PnP.PowerShell.Commands.EntraID
{
[Cmdlet(VerbsCommon.Get, "PnPEntraIDUser", DefaultParameterSetName = ParameterSet_LIST)]
[RequiredApiDelegatedOrApplicationPermissions("graph/Directory.Read.All")]
[RequiredApiDelegatedOrApplicationPermissions("graph/Directory.ReadWrite.All")]
[RequiredApiDelegatedOrApplicationPermissions("graph/User.Read.All")]
[RequiredApiDelegatedOrApplicationPermissions("graph/User.ReadWrite.All")]
[Alias("Get-PnPAzureADUser")]
public class GetAzureADUser : PnPGraphCmdlet
{
Expand Down Expand Up @@ -49,6 +52,8 @@ public class GetAzureADUser : PnPGraphCmdlet
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_LIST)]
public SwitchParameter IgnoreDefaultProperties;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_BYID)]
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_LIST)]
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_DELTA)]
public SwitchParameter UseBeta;

Expand All @@ -64,7 +69,7 @@ protected override void ExecuteCmdlet()
PnP.PowerShell.Commands.Model.AzureAD.User user;
if (Guid.TryParse(Identity, out Guid identityGuid))
{
user = Utilities.EntraIdUtility.GetUser(AccessToken, identityGuid, ignoreDefaultProperties: IgnoreDefaultProperties, useBetaEndPoint: UseBeta.IsPresent, azureEnvironment: Connection.AzureEnvironment);
user = Utilities.EntraIdUtility.GetUser(AccessToken, identityGuid, Select, ignoreDefaultProperties: IgnoreDefaultProperties, useBetaEndPoint: UseBeta.IsPresent, azureEnvironment: Connection.AzureEnvironment);
}
else
{
Expand Down
Loading