Skip to content

Weekly PowerShell Microsoft Graph Reference Docs Refresh #691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Repaired examples and descriptions
  • Loading branch information
Microsoft Graph DevX Tooling authored and Microsoft Graph DevX Tooling committed Jun 20, 2025
commit 1e2451d1f581dfd11cc8abd6b83d94f9ff42d82e
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
Expand Up @@ -68,34 +68,38 @@ You can use the Update application operation to perform an update instead.
| Application | Application.ReadWrite.OwnedBy, Directory.ReadWrite.All, Application.ReadWrite.All, |

## EXAMPLES
### Example 1: Add a new key credential to an application

```powershell

### EXAMPLE 1
```
Import-Module Microsoft.Graph.Applications
```

$params = @{
keyCredential = @{
type = "AsymmetricX509Cert"
usage = "Verify"
key = \[System.Text.Encoding\]::ASCII.GetBytes("MIIDYDCCAki...")
key = [System.Text.Encoding]::ASCII.GetBytes("MIIDYDCCAki...")
}
passwordCredential = $null
proof = "eyJ0eXAiOiJ..."
}

Add-MgApplicationKey -ApplicationId $applicationId -BodyParameter $params

### EXAMPLE 2
```
This example will add a new key credential to an application

### Example 2: Add a key credential and an associated password for the key

```powershell

Import-Module Microsoft.Graph.Applications
```

$params = @{
keyCredential = @{
type = "X509CertAndPassword"
usage = "Sign"
key = \[System.Text.Encoding\]::ASCII.GetBytes("MIIDYDCCAki...")
key = [System.Text.Encoding]::ASCII.GetBytes("MIIDYDCCAki...")
}
passwordCredential = @{
secretText = "MKTr0w1..."
Expand All @@ -105,6 +109,10 @@ $params = @{

Add-MgApplicationKey -ApplicationId $applicationId -BodyParameter $params

```
This example will add a key credential and an associated password for the key


## PARAMETERS

### -AdditionalProperties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ You can also add passwords while creating the application.
| Application | Application.ReadWrite.OwnedBy, Directory.ReadWrite.All, Application.ReadWrite.All, |

## EXAMPLES
### Example 1: Add a password credential to an application with a six month expiry

```powershell

### EXAMPLE 1
```
Connect-MgGraph -Scopes 'Application.ReadWrite.All'
```

$appObjectId = 'eaf1e531-0d58-4874-babe-b9a9f436e6c3'

Expand All @@ -83,13 +83,17 @@ Hint : Q_e
KeyId : c82bb763-741b-4575-9d9d-df7e766f6999
SecretText : Q_e8Q~ZDWJD.bkgajbREp-VFFUayCuEk8b1hDcr9
StartDateTime : 26/5/2022 1:03:31 pm
AdditionalProperties : {\[@odata.context,
https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.passwordCredential\]}

### EXAMPLE 2
AdditionalProperties : {[@odata.context,
https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.passwordCredential]}
```

Add a password to an application that expires in six months from the current date.

### Example 2: Add a password credential to an application with a start date

```powershell

Connect-MgGraph -Scopes 'Application.ReadWrite.All'
```

$appObjectId = 'eaf1e531-0d58-4874-babe-b9a9f436e6c3'

Expand All @@ -112,8 +116,13 @@ Hint : TiA
KeyId : 082bf20f-63d6-4970-bb4e-55e504f50d8b
SecretText : TiA8Q~Zs7ej1cGtlW0qnmuFi~JlxXTZew_tU1bGA
StartDateTime : 26/5/2022 2:00:00 pm
AdditionalProperties : {\[@odata.context,
https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.passwordCredential\]}
AdditionalProperties : {[@odata.context,
https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.passwordCredential]}
```

Add a password to an application that becomes valid at 12:00 am the next day and is valid for six months.

Use `$secret.StartDateTime.ToLocalTime()` to convert the returned dates from UTC to the local timezone.

## PARAMETERS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,34 +65,38 @@ Update servicePrincipal can be used to perform an update instead.
| Application | Application.ReadWrite.OwnedBy, Directory.ReadWrite.All, Application.ReadWrite.All, |

## EXAMPLES
### Example 1: Adding a new key credential to a servicePrincipal

```powershell

### EXAMPLE 1
```
Import-Module Microsoft.Graph.Applications
```

$params = @{
keyCredential = @{
type = "AsymmetricX509Cert"
usage = "Verify"
key = \[System.Text.Encoding\]::ASCII.GetBytes("MIIDYDCCAki...")
key = [System.Text.Encoding]::ASCII.GetBytes("MIIDYDCCAki...")
}
passwordCredential = $null
proof = "eyJ0eXAiOiJ..."
}

Add-MgServicePrincipalKey -ServicePrincipalId $servicePrincipalId -BodyParameter $params

### EXAMPLE 2
```
This example shows adding a new key credential to a serviceprincipal

### Example 2: Adding a key credential and an associated password for the key

```powershell

Import-Module Microsoft.Graph.Applications
```

$params = @{
keyCredential = @{
type = "X509CertAndPassword"
usage = "Sign"
key = \[System.Text.Encoding\]::ASCII.GetBytes("MIIDYDCCAki...")
key = [System.Text.Encoding]::ASCII.GetBytes("MIIDYDCCAki...")
}
passwordCredential = @{
secretText = "MKTr0w1..."
Expand All @@ -102,6 +106,10 @@ $params = @{

Add-MgServicePrincipalKey -ServicePrincipalId $servicePrincipalId -BodyParameter $params

```
This example shows adding a key credential and an associated password for the key


## PARAMETERS

### -AdditionalProperties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ Add a strong password or secret to a servicePrincipal object.
| Application | Application.ReadWrite.OwnedBy, Directory.ReadWrite.All, Application.ReadWrite.All, |

## EXAMPLES
### Example 1: Code snippet

```powershell

### EXAMPLE 1
```
Import-Module Microsoft.Graph.Applications
```

$params = @{
passwordCredential = @{
Expand All @@ -69,6 +69,10 @@ $params = @{

Add-MgServicePrincipalPassword -ServicePrincipalId $servicePrincipalId -BodyParameter $params

```
This example shows how to use the Add-MgServicePrincipalPassword Cmdlet.


## PARAMETERS

### -AdditionalProperties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,23 @@ The endDateTime can be up to three years after the certificate is created.
| Application | Application.ReadWrite.OwnedBy, Directory.ReadWrite.All, Application.ReadWrite.All, |

## EXAMPLES
### Example 1: Code snippet

```powershell

### EXAMPLE 1
```
Import-Module Microsoft.Graph.Applications
```

$params = @{
displayName = "CN=customDisplayName"
endDateTime = \[System.DateTime\]::Parse("2024-01-25T00:00:00Z")
endDateTime = [System.DateTime]::Parse("2024-01-25T00:00:00Z")
}

Add-MgServicePrincipalTokenSigningCertificate -ServicePrincipalId $servicePrincipalId -BodyParameter $params

```
This example shows how to use the Add-MgServicePrincipalTokenSigningCertificate Cmdlet.


## PARAMETERS

### -AdditionalProperties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,18 @@ Unset the verifiedPublisher previously set on an application, removing all verif
For more information, see Publisher verification.

## EXAMPLES
### Example 1: Code snippet

```powershell

### EXAMPLE 1
```
Import-Module Microsoft.Graph.Applications
```

Clear-MgApplicationVerifiedPublisher -ApplicationId $applicationId

```
This example shows how to use the Clear-MgApplicationVerifiedPublisher Cmdlet.


## PARAMETERS

### -ApplicationId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,6 @@ You can check up to a maximum of 20 groups per request.
This function supports all groups provisioned in Microsoft Entra ID.
Because Microsoft 365 groups cannot contain other groups, membership in a Microsoft 365 group is always direct.

## EXAMPLES

### EXAMPLE 1
```
{{ Add code here }}
```

### EXAMPLE 2
```
{{ Add code here }}
```

## PARAMETERS

### -AdditionalProperties
Expand Down Expand Up @@ -297,5 +285,6 @@ INPUTOBJECT `<IApplicationsIdentity>`: Identity Parameter






Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,6 @@ Confirm-MgApplicationMemberObject -InputObject <IApplicationsIdentity>
## DESCRIPTION
Invoke action checkMemberObjects

## EXAMPLES

### EXAMPLE 1
```
{{ Add code here }}
```

### EXAMPLE 2
```
{{ Add code here }}
```

## PARAMETERS

### -AdditionalProperties
Expand Down Expand Up @@ -286,5 +274,6 @@ INPUTOBJECT `<IApplicationsIdentity>`: Identity Parameter






Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,6 @@ Because Microsoft 365 groups cannot contain other groups, membership in a Micros
| Delegated (personal Microsoft account) | Not supported |
| Application | Application.Read.All, Application.ReadWrite.All, User.Read.All, GroupMember.Read.All, Group.ReadWrite.All, Group.Read.All, User.ReadWrite.All, Directory.Read.All, Device.ReadWrite.All, Device.Read.All, Directory.ReadWrite.All, |

## EXAMPLES

### EXAMPLE 1
```
{{ Add code here }}
```

### EXAMPLE 2
```
{{ Add code here }}
```

## PARAMETERS

### -AdditionalProperties
Expand Down Expand Up @@ -305,5 +293,6 @@ INPUTOBJECT `<IApplicationsIdentity>`: Identity Parameter






Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,6 @@ Invoke action checkMemberObjects
| Delegated (personal Microsoft account) | Not supported |
| Application | Application.Read.All, Application.ReadWrite.All, User.Read.All, GroupMember.Read.All, Group.ReadWrite.All, Group.Read.All, User.ReadWrite.All, Directory.Read.All, Device.ReadWrite.All, Device.Read.All, Directory.ReadWrite.All, |

## EXAMPLES

### EXAMPLE 1
```
{{ Add code here }}
```

### EXAMPLE 2
```
{{ Add code here }}
```

## PARAMETERS

### -AdditionalProperties
Expand Down Expand Up @@ -294,5 +282,6 @@ INPUTOBJECT `<IApplicationsIdentity>`: Identity Parameter






Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@ Find-MgApplicationSynchronizationJobSchemaDirectory -InputObject <IApplicationsI
## DESCRIPTION
Discover the latest schema definition for provisioning to an application.

## EXAMPLES

### EXAMPLE 1
```
{{ Add code here }}
```

### EXAMPLE 2
```
{{ Add code here }}
```

## PARAMETERS

### -ApplicationId
Expand Down Expand Up @@ -252,5 +240,6 @@ INPUTOBJECT `<IApplicationsIdentity>`: Identity Parameter






Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@ Find-MgApplicationSynchronizationTemplateSchemaDirectory -InputObject <IApplicat
## DESCRIPTION
Discover the latest schema definition for provisioning to an application.

## EXAMPLES

### EXAMPLE 1
```
{{ Add code here }}
```

### EXAMPLE 2
```
{{ Add code here }}
```

## PARAMETERS

### -ApplicationId
Expand Down Expand Up @@ -252,5 +240,6 @@ INPUTOBJECT `<IApplicationsIdentity>`: Identity Parameter






Loading