Skip to content

Commit

Permalink
Cmdlet improvements based on Pull Request review exercise (#1017)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveMutungi254 authored Aug 22, 2024
1 parent 6d5630e commit ed1bf66
Show file tree
Hide file tree
Showing 36 changed files with 194 additions and 175 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ This example adds a predefined value to a custom security attribute definition.
The unique identifier for a custom security attribute definition in Microsoft Entra ID.

```yaml
Type: Sysetm.String
Type: System.String
Parameter Sets: (All)
Aliases:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Remove-EntraBetaScopedRoleMembership @params
This cmdlet removes a specific scoped role membership from Microsoft Entra ID. You can use the command `Get-EntraBetaAdministrativeUnit` to get administrative unit Id.

- `-ObjectId` parameter specifies the ID of an administrative unit.
- `-ScopedRoleMembershipId` parameter specifies the ID of the scoped role membership to remove.
- `-ScopedRoleMembershipId` parameter specifies the ID of the scoped role membership to remove. To obtain the details of a scoped role membership, you can use the `Get-EntraScopedRoleMembership` command.

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ The `Remove-EntraBetaServicePrincipalPasswordCredential` cmdlet removes a passwo

```powershell
Connect-Entra -Scopes 'Application.ReadWrite.All','Application.ReadWrite.OwnedBy'
$ServicePrincipal = Get-EntraBetaServicePrincipal -Filter "DisplayName eq '<service-principal-display-name>'"
$Params = @{
ObjectId = 'aaaaaaaa-6666-7777-8888-bbbbbbbbbbbb'
ObjectId = $ServicePrincipal.ObjectId
KeyId = 'bbbbbbbb-1c1c-2d2d-3e3e-444444444444'
}
Remove-EntraBetaServicePrincipalPasswordCredential @Params
Expand Down Expand Up @@ -97,3 +98,9 @@ This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVar
## Notes

## Related Links

[Get-EntraBetaServicePrincipal](Get-EntraBetaServicePrincipal.md)

[Get-EntraBetaServicePrincipalPasswordCredential](Get-EntraBetaServicePrincipalPasswordCredential.md)

[New-EntraBetaServicePrincipalPasswordCredential](New-EntraBetaServicePrincipalPasswordCredential.md)
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Connect-Entra -Scopes 'Domain.ReadWrite.All'
Confirm-EntraDomain -Name Contoso.com
```

This command confirms your domain; changing the status to "Verified".
This example verifies a domain and updates its status to `verified`.

### Example 2: Confirm the domain with a cross cloud verification code

Expand All @@ -55,7 +55,7 @@ Connect-Entra -Scopes 'Domain.ReadWrite.All'
Confirm-EntraDomain -Name Contoso.com -CrossCloudVerificationCode ms84324896
```

This command confirms your domain for dual federation scenarios.
This example confirms a domain in dual federation scenarios.

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ Get-EntraAccountSku

```powershell
Get-EntraAccountSku
[-TenantId <Guid>]
[-TenantId <String>]
[<CommonParameters>]
```

## Description

The `Get-EntraAccountSku` retrieves the list of commercial subscriptions acquired by an organization.

To map license names as displayed in the Microsoft Entra admin center or the Microsoft 365 admin center to their Microsoft Graph skuId and skuPartNumber properties, refer to the provided mapping information.
For a list of license names in the Microsoft Entra or Microsoft 365 admin centers and their corresponding Microsoft Graph `skuId` and `skuPartNumber` properties, refer to the [mapping information](https://learn.microsoft.com/entra/identity/users/licensing-service-plan-reference).

## Examples

### EXAMPLE 1: Gets a list of SKUs
### Example 1: Gets a list of SKUs

```powershell
Connect-Entra -Scopes 'Organization.Read.All'
Expand All @@ -65,7 +65,7 @@ dddddddd-3333-4444-5555-eeeeeeeeeeee aaaabbbb-0000-cccc-1111-dddd2222eeee Contos

This command returns a list of SKUs.

### EXAMPLE 2: Gets a list of SKUs by TenantId
### Example 2: Gets a list of SKUs by TenantId

```powershell
Connect-Entra -Scopes 'Organization.Read.All'
Expand All @@ -80,18 +80,20 @@ ffffffff-5555-6666-7777-aaaaaaaaaaaa aaaabbbb-0000-cccc-1111-dddd2222eeee Contos
dddddddd-3333-4444-5555-eeeeeeeeeeee aaaabbbb-0000-cccc-1111-dddd2222eeee Contoso User
```

This command returns a list of SKUs for a tenant.
This command returns a list of SKUs for a specified tenant.

- `-TenantId` parameter specifies the unique ID of the tenant.

## Parameters

### -TenantId

The unique ID of the tenant to perform the operation on.
If this isn't provided then the value defaults to
the tenant of the current user.
If this isn't provided, then the value will default to the tenant of the current user.
This parameter is only applicable to partner users.

```yaml
Type: Guid
Type: System.String
Parameter Sets: GetById
Aliases:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ The contract object contains the following attributes:

Possible values are:

++ "SyndicationPartner", which indicates a partner that exclusively resells and manages O365 and Intune for this customer.
1. SyndicationPartner - indicates a partner that exclusively resells and manages O365 and Intune for this customer.
They resell and support their customers.
++ "BreadthPartner", which indicates that the partner has the ability to provide administrative support for this customer.
1. BreadthPartner - indicates that the partner has the ability to provide administrative support for this customer.
However the partner isn't allowed to resell to the customer.
++ "ResellerPartner", which indicates a partner that is similar to a syndication partner, except that it doesn't have exclusive access to a tenant.
In the syndication case, the customer can't buy additional direct subscriptions from Microsoft or from other partners.
1. ResellerPartner - indicates a partner that is similar to a syndication partner, except that it doesn't have exclusive access to a tenant. In the syndication case, the customer can't buy additional direct subscriptions from Microsoft or from other partners.

- `customerContextId` - unique identifier for the customer tenant referenced by this partnership.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ schema: 2.0.0

## Synopsis

Gets a registered user.
Retrieve a list of users that are registered users of the device.

## Syntax

Expand Down Expand Up @@ -59,12 +59,6 @@ ffffffff-4444-5555-6666-gggggggggggg

This example demonstrates how to retrieve registered user for a specific Microsoft Entra ID device.

- The first command gets the object ID of a device by using the Get-EntraDevice (./Get-EntraDevice.md) cmdlet, and then stores it in the `$DevId` variable.

- The second command gets the registered users of the device in `$DevId`.

- `-ObjectId` Parameter specifies an object ID of a device, which you want to retrieve.

### Example 2: Get all registered users of a device

```powershell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ Gets the directory synchronization settings.

```powershell
Get-EntraDirSyncConfiguration
[-TenantId <Guid>]
[-TenantId <String>]
[<CommonParameters>]
```

## Description

The `Get-EntraDirSyncConfiguration` cmdlet gets the directory synchronization settings.

For delegated scenarios, the user needs to be assigned the Global Administrator role.

## Examples

### Example 1: Get directory synchronization settings
Expand All @@ -43,34 +45,36 @@ The `Get-EntraDirSyncConfiguration` cmdlet gets the directory synchronization se
Get-EntraDirSyncConfiguration
```

```output
```Output
AccidentalDeletionThreshold DeletionPreventionType
--------------------------- ----------------------
500 enabledForCount
```

This command gets directory synchronization settings.
This example gets directory synchronization settings.

### Example 2: Get directory synchronization settings by TenantId

```powershell
Get-EntraDirSyncConfiguration -TenantId 'aaaabbbb-0000-cccc-1111-dddd2222eeee'
```

```output
```Output
AccidentalDeletionThreshold DeletionPreventionType
--------------------------- ----------------------
500 enabledForCount
```

This command gets directory synchronization settings by TenantId.
This example gets directory synchronization settings by TenantId.

- `-TenantId` Specifies the unique ID of the tenant.

## Parameters

### -TenantId

The unique ID of the tenant to perform the operation on.
If this isn't provided then it defaults to the tenant of the current user.
If TenantId isn't provided, then it defaults to the tenant of the current user.
This parameter is only applicable to partner users.

```yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ Some of the features that can be used with this cmdlet include:

The cmdlet can be run without specifying any features, in which case it returns a list of all features and their enabled or disabled status.

For delegated scenarios, the user needs to be assigned the Global Administrator role.

## Examples

### EXAMPLE 1: Return a list of all directory synchronization features
### Example 1: Return a list of all directory synchronization features

```powershell
Connect-Entra -Scopes 'OnPremDirectorySynchronization.Read.All'
Expand Down Expand Up @@ -85,7 +87,7 @@ Enabled DirSyncFeature

This example gets a list of all directory synchronization features and shows if they are enabled (True) or disabled (False).

### EXAMPLE 2: Return PasswordSync feature status
### Example 2: Return the PasswordSync feature status

```powershell
Connect-Entra -Scopes 'OnPremDirectorySynchronization.Read.All'
Expand All @@ -100,7 +102,7 @@ Enabled DirSyncFeature

This example shows if PasswordSync is enabled (True) or disabled (False) for the tenant.

- `Feature` specifies the directory synchronization feature to check the status of.
- `-Feature` specifies the directory synchronization feature to check the status of.

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ Get-EntraDomain

The `Get-EntraDomain` cmdlet gets a domain in Microsoft Entra ID.

The work or school account must be assigned to at least one of the following Microsoft Entra roles:

- User Administrator
- Helpdesk Administrator
- Service Support Administrator
- Directory Readers
- AdHoc License Administrator
- Application Administrator
- Security Reader
- Security Administrator
- Privileged Role Administrator
- Cloud Application Administrator

## Examples

### Example 1: Get a list of Domains that are created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ schema: 2.0.0

## Synopsis

This cmdlet retrieves the objects that are referenced with a given domain name.
Retrieves the objects that are referenced by a given domain name.

## Syntax

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Returns whether Microsoft Entra ID has objects with DirSync provisioning error.

```powershell
Get-EntraHasObjectsWithDirSyncProvisioningError
[-TenantId <Guid>]
[-TenantId <String>]
[<CommonParameters>]
```

Expand All @@ -40,6 +40,8 @@ The `Get-EntraHasObjectsWithDirSyncProvisioningError` returns whether Microsoft
### Example 1: Return whether Microsoft Entra ID has objects with DirSync provisioning error

```powershell
Connect-Entra -Scopes 'User.Read.All', 'Directory.Read.All', 'Group.Read.All', 'Contacts.Read'
Get-EntraHasObjectsWithDirSyncProvisioningError
```

Expand All @@ -49,6 +51,22 @@ False

This command returns whether Microsoft Entra ID has objects with DirSync provisioning error.

### Example 2: Return whether Microsoft Entra ID has objects with DirSync provisioning error

```powershell
Connect-Entra -Scopes 'User.Read.All', 'Directory.Read.All', 'Group.Read.All', 'Contacts.Read'
Get-EntraHasObjectsWithDirSyncProvisioningError -TenantId '0000aaaa-11bb-cccc-dd22-eeeeee333333'
```

```Output
False
```

This command returns whether Microsoft Entra ID has objects with DirSync provisioning error.

- `-TenantId` Specifies the unique ID of the tenant.

## Parameters

### -TenantId
Expand All @@ -60,7 +78,7 @@ If this isn't provided then the value defaults to the tenant of the current user
This parameter is only applicable to partner users.

```yaml
Type: Guid
Type: System.String
Parameter Sets: (All)
Aliases:

Expand All @@ -77,7 +95,7 @@ This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVar

## Inputs

### System. Nullable`1[[System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
### System.Nullable`1[[System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

## Outputs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ Get-EntraOAuth2PermissionGrant

The `Get-EntraOAuth2PermissionGrant` cmdlet gets OAuth2PermissionGrant entities in Microsoft Entra ID.

In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with the necessary permissions. The following least privileged roles are supported for this operation:

- Application Administrator
- Application Developer
- Cloud Application Administrator
- Directory Writers
- Privileged Role Administrator
- User Administrator
- Directory Readers
- Global Reader

## Examples

### Example 1: Get the OAuth2 permission grants
Expand Down
Loading

0 comments on commit ed1bf66

Please sign in to comment.