Skip to content

Commit

Permalink
Merge branch 'main' into enganga/usability-params-set-entrauserextension
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveMutungi254 authored Oct 30, 2024
2 parents 55c772e + 6727a28 commit 4fb7f7b
Show file tree
Hide file tree
Showing 57 changed files with 285 additions and 425 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,29 @@ Add-EntraBetaGroupMember

The `Add-EntraBetaGroupMember` cmdlet adds a member to a group. Specify the `GroupId` and `RefObjectId` parameters to add a member to a group.

`-GroupId` - specifies the unique identifier (Object ID) of the group to which you want to add a member.
In delegated scenarios, the signed-in user needs a supported Microsoft Entra role or a custom role with the `microsoft.directory/groups/members/update` permission. The minimum roles required for this operation, excluding role-assignable groups, are:

`-RefObjectId` - specifies the unique identifier (Object ID) of the member to be added to the group.
- Group owners
- Directory Writers
- Groups Administrator
- User Administrator

## Examples

### Example 1: Add a member to a group

```powershell
Connect-Entra -Scopes 'GroupMember.ReadWrite.All'
$params = @{
GroupId = 'dddddddd-2222-3333-5555-rrrrrrrrrrrr'
RefObjectId = 'bbbbbbbb-1111-2222-3333-cccccccccccc'
}
Add-EntraBetaGroupMember @params
$group = Get-EntraBetaGroup -Filter "DisplayName eq 'Contoso Marketing Group'"
$user = Get-EntraBetaUser -UserId '[email protected]'
Add-EntraBetaGroupMember -GroupId $group.Id -RefObjectId $user.Id
```

This example demonstrates how to add a member to a group.

- `-GroupId` - specifies the unique identifier (Object ID) of the group to which you want to add a member.
- -RefObjectId` - specifies the unique identifier (Object ID) of the member to be added to the group.

## Parameters

### -GroupId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ Add-EntraBetaGroupOwner

The `Add-EntraBetaGroupOwner` cmdlet adds an owner to a Microsoft Entra ID group. Specify the `GroupId` and `RefObjectId` parameters to add an owner to a group.

`-GroupId` - specifies the unique identifier (Object ID) of the group to which you want to add an owner.
In delegated scenarios, the signed-in user must have either a supported Microsoft Entra role or a custom role with the necessary permissions. The minimum roles required for this operation are:

`-RefObjectId` - specifies the unique identifier (Object ID) of the owner to be added to the group (user or service principal).
- Group owners
- User Administrator
- Directory Writers
- Groups Administrator

## Examples

Expand All @@ -47,16 +50,14 @@ The `Add-EntraBetaGroupOwner` cmdlet adds an owner to a Microsoft Entra ID group
Connect-Entra -Scopes 'Group.ReadWrite.All'
$group = Get-EntraBetaGroup -Filter "DisplayName eq 'HelpDesk Team Leaders'"
$user = Get-EntraBetaUser -UserId '[email protected]'
$params = @{
GroupId = $group.ObjectId
RefObjectId = $user.ObjectId
}
Add-EntraBetaGroupOwner @params
Add-EntraBetaGroupOwner -GroupId $group.Id -RefObjectId $user.Id
```

This example demonstrates how to add an owner to a group.

- `-GroupId` - specifies the unique identifier (Object ID) of the group to which you want to add an owner.
- `-RefObjectId` - specifies the unique identifier (Object ID) of the owner to be added to the group.

## Parameters

### -GroupId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ The `Add-EntraBetaLifecyclePolicyGroup` cmdlet adds a group to a lifecycle polic
Connect-Entra -Scopes 'Directory.ReadWrite.All'
$group = Get-EntraBetaGroup -Filter "DisplayName eq 'Office365 group'"
$policy = Get-EntraBetaGroupLifecyclePolicy | Select-Object -First 1
$params = @{
GroupLifecyclePolicyId = $policy.Id
groupId = $group.ObjectId
}
Add-EntraBetaLifecyclePolicyGroup @params
Add-EntraBetaLifecyclePolicyGroup -GroupLifecyclePolicyId $policy.Id -GroupId $group.Id
```

This example adds a group to the lifecycle policy.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ schema: 2.0.0

## Synopsis

This cmdlet is used to retrieve the soft deleted groups in a Microsoft Entra ID.
Retrieves soft-deleted groups in Microsoft Entra ID.

## Syntax

Expand Down Expand Up @@ -57,9 +57,9 @@ Get-EntraBetaDeletedGroup

## Description

This cmdlet retrieves soft-deleted groups from a directory. When a group is deleted, it is soft deleted and can be recovered within 30 days. After 30 days, the group is permanently deleted and cannot be recovered.
The `Get-EntraBetaDeletedGroup` cmdlet retrieves soft-deleted groups from the directory. Deleted groups can be recovered within 30 days, after which they are permanently deleted.

Please note that soft delete currently applies only to Unified Groups (also known as Office 365 Groups).
Soft delete currently applies only to Unified Groups (Office 365 Groups).

## Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ This example demonstrates how to get all groups from Microsoft Entra ID.

```powershell
Connect-Entra -Scopes 'GroupMember.Read.All'
Get-EntraBetaGroup -GroupId 'eeeeeeee-4444-5555-6666-ffffffffffff'
$group = Get-EntraBetaGroup -Filter "DisplayName eq 'Azure Panda'"
Get-EntraBetaGroup -GroupId $group.Id
```

```Output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ The `Get-EntraBetaGroupAppRoleAssignment` cmdlet gets a group application role a

```powershell
Connect-Entra -Scopes 'Directory.Read.All'
$GroupId = (Get-EntraBetaGroup -Top 1).ObjectId
Get-EntraBetaGroupAppRoleAssignment -GroupId $GroupId
$group = Get-EntraBetaGroup -SearchString 'Contoso marketing'
Get-EntraBetaGroupAppRoleAssignment -GroupId $group.Id
```

```Output
Expand All @@ -63,7 +63,8 @@ This example retrieves the application role assignments of a group.

```powershell
Connect-Entra -Scopes 'Directory.Read.All'
Get-EntraBetaGroupAppRoleAssignment -GroupId 'eeeeeeee-4444-5555-6666-ffffffffffff' -All
$group = Get-EntraBetaGroup -SearchString 'Contoso marketing'
Get-EntraBetaGroupAppRoleAssignment -GroupId $group.Id -All
```

```Output
Expand All @@ -82,7 +83,8 @@ This example retrieves all application role assignments of the specified group.

```powershell
Connect-Entra -Scopes 'Directory.Read.All'
Get-EntraBetaGroupAppRoleAssignment -GroupId 'cccccccc-8888-9999-0000-dddddddddddd' -Top 2
$group = Get-EntraBetaGroup -SearchString 'Contoso marketing'
Get-EntraBetaGroupAppRoleAssignment -GroupId $group.Id -Top 2
```

```Output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ This example demonstrates how to retrieve the properties and relationships of al

```powershell
Connect-Entra -Scopes 'Directory.Read.All'
Get-EntraBetaGroupLifecyclePolicy -GroupLifecyclePolicyId 'ffffffff-5555-6666-7777-aaaaaaaaaaaa'
$policy = Get-EntraBetaGroupLifecyclePolicy | Where-Object {$_.AlternateNotificationEmails -eq '[email protected]'}
Get-EntraBetaGroupLifecyclePolicy -GroupLifecyclePolicyId $policy.Id
```

```Output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,33 @@ To list members of a hidden group, the `Member.Read.Hidden` permission is also r

## Examples

### Example 1: Get a group member by ID
### Example 1: Retrieve and Select Group Member Properties

```powershell
Connect-Entra -Scopes 'GroupMember.Read.All'
Get-EntraBetaGroupMember -GroupId 'eeeeeeee-4444-5555-6666-ffffffffffff'
$group = Get-EntraBetaGroup -Filter "DisplayName eq 'Sales and Marketing'"
Get-EntraBetaGroup -GroupId $group.Id | Get-EntraBetaGroupMember | Select-Object Id, DisplayName, '@odata.type'
```

```Output
Id DeletedDateTime
-- ---------------
bbbbbbbb-7777-8888-9999-cccccccccccc
Id DisplayName @odata.type
------------------------------------ ----------------- -------------------------------
dddddddd-3333-4444-5555-eeeeeeeeeeee Sawyer Miller #microsoft.graph.user
eeeeeeee-4444-5555-6666-ffffffffffff Alex Wilber #microsoft.graph.user
aaaaaaaa-6666-7777-8888-bbbbbbbbbbbb My Application #microsoft.graph.servicePrincipal
cccccccc-8888-9999-0000-dddddddddddd Contoso Group #microsoft.graph.group
```

This example demonstrates how to retrieve group member by ID.
This example retrieves the members of a specified group by its `GroupId`.

- `-GroupId` Specifies the ID of a group.
- `-GroupId` specifies the ID of a group.

### Example 2: Get two group member

```powershell
Connect-Entra -Scopes 'GroupMember.Read.All'
Get-EntraBetaGroupMember -GroupId 'bbbbbbbb-7777-8888-9999-cccccccccccc' -Top 2
$group = Get-EntraBetaGroup -Filter "DisplayName eq 'Sales and Marketing'"
Get-EntraBetaGroupMember -GroupId $group.Id -Top 2
```

```Output
Expand All @@ -94,7 +99,8 @@ This example demonstrates how to retrieve top two groups from Microsoft Entra ID

```powershell
Connect-Entra -Scopes 'GroupMember.Read.All'
Get-EntraBetaGroupMember -GroupId 'dddddddd-9999-0000-1111-eeeeeeeeeeee' -All
$group = Get-EntraBetaGroup -Filter "DisplayName eq 'Sales and Marketing'"
Get-EntraBetaGroupMember -GroupId $group.Id -All
```

```Output
Expand All @@ -111,23 +117,21 @@ This example retrieves all members within a group by group ID.

- `-GroupId` specifies the ID of a group.

### Example 4: Retrieve and Select Group Member Properties
### Example 4: Get a group member by ID

```powershell
Connect-Entra -Scopes 'GroupMember.Read.All'
Get-EntraBetaGroupMember -GroupId 'tttttttt-0000-2222-0000-aaaaaaaaaaaa' | Select-Object DisplayName, '@odata.type'
$group = Get-EntraBetaGroup -Filter "DisplayName eq 'Sales and Marketing'"
Get-EntraBetaGroupMember -GroupId $group.Id
```

```Output
displayName @odata.type
----------- -----------
test1 #microsoft.graph.user
test2 #microsoft.graph.user
test2 #microsoft.graph.servicePrincipal
test3 #microsoft.graph.servicePrincipal
Id DeletedDateTime
-- ---------------
bbbbbbbb-7777-8888-9999-cccccccccccc
```

This example retrieves the members of a specified group by its `GroupId` and selects only the `DisplayName` and `@odata.type` properties for each member.
This example demonstrates how to retrieve group member by ID.

- `-GroupId` specifies the ID of a group.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,26 @@ In delegated scenarios, the signed-in user must have a supported Microsoft Entra

```powershell
Connect-Entra -Scopes 'GroupMember.Read.All'
Get-EntraBetaGroupOwner -GroupId 'bbbbbbbb-1111-2222-3333-cccccccccccc'
$group = Get-EntraBetaGroup -Filter "DisplayName eq 'Sales and Marketing'"
Get-EntraBetaGroup -GroupId $group.Id | Get-EntraBetaGroupOwner | Select-Object Id, DisplayName, '@odata.type'
```

```Output
Id DeletedDateTime
-- ---------------
cccccccc-2222-3333-4444-dddddddddddd
id displayName @odata.type
-- ----------- -----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Adele Vance #microsoft.graph.user
```

This example demonstrates how to retrieve the owner of a specific group.

- `-GroupId` parameter specifies the ID of a group.
- `-GroupId` specifies the ID of a group.

### Example 2: Gets all group owners

```powershell
Connect-Entra -Scopes 'GroupMember.Read.All'
Get-EntraBetaGroupOwner -GroupId 'ffffffff-5555-6666-7777-aaaaaaaaaaaa' -All
$group = Get-EntraBetaGroup -Filter "DisplayName eq 'Sales and Marketing'"
Get-EntraBetaGroupOwner -GroupId $group.Id -All
```

```Output
Expand All @@ -86,7 +88,8 @@ This example demonstrates how to retrieve the all owner of a specific group.

```powershell
Connect-Entra -Scopes 'GroupMember.Read.All'
Get-EntraBetaGroupOwner -GroupId 'bbbbbbbb-7777-8888-9999-cccccccccccc' -Top 2
$group = Get-EntraBetaGroup -Filter "DisplayName eq 'Sales and Marketing'"
Get-EntraBetaGroupOwner -GroupId $group.Id -Top 2
```

```Output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ The `Get-EntraBetaLifecyclePolicyGroup` retrieves the lifecycle policy object to

```powershell
Connect-Entra -Scopes 'Directory.Read.All'
Get-EntraBetaLifecyclePolicyGroup -GroupId 'bbbbbbbb-1111-2222-3333-cccccccccccc'
$group = Get-EntraBetaGroup -Filter "DisplayName eq 'Sales and Marketing'"
Get-EntraBetaLifecyclePolicyGroup -GroupId $group.Id
```

```Output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,8 @@ The `Get-EntraBetaObjectSetting` cmdlet retrieves an object setting from Microso

```powershell
Connect-Entra -Scopes 'Directory.Read.All'
$params = @{
TargetType = 'Groups'
TargetObjectId = 'aaaaaaaa-1111-1111-1111-000000000000'
}
Get-EntraBetaObjectSetting @params
$group = Get-EntraBetaGroup -Filter "DisplayName eq 'Sales and Marketing'"
Get-EntraBetaObjectSetting -TargetType 'Groups' -TargetObjectId $group.Id
```

```Output
Expand All @@ -81,12 +78,9 @@ This command retrieves object setting from Microsoft Entra ID.

```powershell
Connect-Entra -Scopes 'Directory.Read.All'
$params = @{
TargetType = 'Groups'
TargetObjectId = 'aaaaaaaa-1111-1111-1111-000000000000'
Id ='aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb'
}
Get-EntraBetaObjectSetting @params
$group = Get-EntraBetaGroup -Filter "DisplayName eq 'Sales and Marketing'"
$setting = Get-EntraBetaObjectSetting -TargetType 'Groups' -TargetObjectId $group.Id | Where-Object {$_.displayName -eq 'Group.Unified.Guest'}
Get-EntraBetaObjectSetting -TargetType 'Groups' -TargetObjectId $group.Id -Id $setting.Id
```

```Output
Expand All @@ -105,11 +99,8 @@ This command retrieves Specific object setting from Microsoft Entra ID.

```powershell
Connect-Entra -Scopes 'Directory.Read.All'
$params = @{
TargetType = 'Groups'
TargetObjectId = 'aaaaaaaa-1111-1111-1111-000000000000'
}
Get-EntraBetaObjectSetting @params -Top 1
$group = Get-EntraBetaGroup -Filter "DisplayName eq 'Sales and Marketing'"
Get-EntraBetaObjectSetting -TargetType 'Groups' -TargetObjectId $group.Id -Top 1
```

```Output
Expand All @@ -127,11 +118,8 @@ This command retrieves top one object setting from Microsoft Entra ID.

```powershell
Connect-Entra -Scopes 'Directory.Read.All'
$params = @{
TargetType = 'Groups'
TargetObjectId = 'aaaaaaaa-1111-1111-1111-000000000000'
}
Get-EntraBetaObjectSetting @params -All
$group = Get-EntraBetaGroup -Filter "DisplayName eq 'Sales and Marketing'"
Get-EntraBetaObjectSetting -TargetType 'Groups' -TargetObjectId $group.Id -All
```

```Output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,7 @@ In delegated scenarios with work or school accounts, the signed-in user must be

## Examples

### Example 1: Retrieve the OAuth2 permission grants for a user

```powershell
Connect-Entra -Scopes 'Directory.Read.All'
Get-EntraBetaUserOAuth2PermissionGrant -UserId '[email protected]'
```

```Output
Id ClientId ConsentType ExpiryTime
-- -------- ----------- ----------
HXFXwKLgoUC4rwbZbCDIdffW8XpadQNIoHik9aQxrVHR6StBYBRhQI7tzKID_LIV 00001111-aaaa-2222-bbbb-3333cccc4444 Principal 08-01-2024 10:0...
9uBzRwC0s0CFCDQN6O4Ik_fW8XpadQNIoHik9aQxrVHR6StBYBRhQI7tzKID_LIV 11112222-bbbb-3333-cccc-4444dddd5555 Principal 13-01-2024 08:0...
```

This example retrieves the OAuth2 permission grants for a user using the ObjectId parameter. Use the `Get-EntraBetaUser` cmdlet to obtain the `UserId` value.

### Example 2: Retrieve the OAuth2 permission grants for a user using object ID parameter
### Example 1: Retrieve the OAuth2 permission grants for a user using object ID parameter

```powershell
Connect-Entra -Scopes 'Directory.Read.All'
Expand All @@ -86,7 +70,7 @@ This example retrieves the OAuth2 permission grants for a user using object ID p

- `-UserId` parameter specifies the user ID.

### Example 3: Retrieve the OAuth2 permission grants for a user using All parameter
### Example 2: Retrieve the OAuth2 permission grants for a user using All parameter

```powershell
Connect-Entra -Scopes 'Directory.Read.All'
Expand All @@ -104,7 +88,7 @@ This example retrieves the OAuth2 permission grants for a user using All paramet

- `-UserId` parameter specifies the user ID.

### Example 4: Retrieve top one OAuth2 permission grant
### Example 3: Retrieve top one OAuth2 permission grant

```powershell
Connect-Entra -Scopes 'Directory.Read.All'
Expand Down
Loading

0 comments on commit 4fb7f7b

Please sign in to comment.