Skip to content

[v2] Examples Update #2854

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

Merged
merged 2 commits into from
Jul 22, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Applications

Get-MgBetaServicePrincipalClaimPolicy -ServicePrincipalId $servicePrincipalId

```
This example shows how to use the Get-MgBetaServicePrincipalClaimPolicy Cmdlet.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Applications

Get-MgBetaServicePrincipalPermissionGrantPreApprovalPolicy -ServicePrincipalId $servicePrincipalId -PermissionGrantPreApprovalPolicyId $permissionGrantPreApprovalPolicyId

```
This example shows how to use the Get-MgBetaServicePrincipalPermissionGrantPreApprovalPolicy Cmdlet.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example

```powershell

Import-Module Microsoft.Graph.Beta.Applications

Get-MgBetaServicePrincipalSynchronizationTemplate -ServicePrincipalId $servicePrincipalId

```
This example will### example

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

15 changes: 15 additions & 0 deletions src/Bookings/beta/examples/Enable-MgBetaBackupRestore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### Example 1: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

$params = @{
appOwnerTenantId = "23014d8c-71fe-4d00-a01a-31850bc5b42a"
}

Enable-MgBetaBackupRestore -BodyParameter $params

```
This example shows how to use the Enable-MgBetaBackupRestore Cmdlet.

11 changes: 11 additions & 0 deletions src/Bookings/beta/examples/Get-MgBetaBackupRestore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Get-MgBetaBackupRestore

```
This example shows how to use the Get-MgBetaBackupRestore Cmdlet.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: List all the driveProtectionUnits in a tenant

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Get-MgBetaBackupRestoreDriveProtectionUnit

```
This example will list all the driveprotectionunits in a tenant

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Get a mailboxInclusionRule associated with an Exchange protection policy

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Get-MgBetaBackupRestoreExchangeProtectionPolicyMailboxInclusionRule -ExchangeProtectionPolicyId $exchangeProtectionPolicyId -MailboxProtectionRuleId $mailboxProtectionRuleId

```
This example will get a mailboxinclusionrule associated with an exchange protection policy

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Get-MgBetaBackupRestoreExchangeRestoreSessionMailboxRestoreArtifact -ExchangeRestoreSessionId $exchangeRestoreSessionId

```
This example shows how to use the Get-MgBetaBackupRestoreExchangeRestoreSessionMailboxRestoreArtifact Cmdlet.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Get-MgBetaBackupRestoreMailboxProtectionUnit

```
This example shows how to use the Get-MgBetaBackupRestoreMailboxProtectionUnit Cmdlet.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Get a driveInclusionRule associated with an OneDriveForBusiness protection policy

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Get-MgBetaBackupRestoreOneDriveForBusinessProtectionPolicyDriveInclusionRule -OneDriveForBusinessProtectionPolicyId $oneDriveForBusinessProtectionPolicyId -DriveProtectionRuleId $driveProtectionRuleId

```
This example will get a driveinclusionrule associated with an onedriveforbusiness protection policy

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: List the driveProtectionUnits associated with a OneDrive for Business protection policy

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Get-MgBetaBackupRestoreOneDriveForBusinessProtectionPolicyDriveProtectionUnit -OneDriveForBusinessProtectionPolicyId $oneDriveForBusinessProtectionPolicyId

```
This example will list the driveprotectionunits associated with a onedrive for business protection policy

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Get-MgBetaBackupRestoreOneDriveForBusinessRestoreSessionDriveRestoreArtifact -OneDriveForBusinessRestoreSessionId $oneDriveForBusinessRestoreSessionId

```
This example shows how to use the Get-MgBetaBackupRestoreOneDriveForBusinessRestoreSessionDriveRestoreArtifact Cmdlet.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Get-MgBetaBackupRestoreProtectionUnit -ProtectionUnitBaseId $protectionUnitBaseId

```
This example shows how to use the Get-MgBetaBackupRestoreProtectionUnit Cmdlet.

11 changes: 11 additions & 0 deletions src/Bookings/beta/examples/Get-MgBetaBackupRestoreServiceApp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Get-MgBetaBackupRestoreServiceApp

```
This example shows how to use the Get-MgBetaBackupRestoreServiceApp Cmdlet.

11 changes: 11 additions & 0 deletions src/Bookings/beta/examples/Get-MgBetaBackupRestoreSession.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Get-MgBetaBackupRestoreSession

```
This example shows how to use the Get-MgBetaBackupRestoreSession Cmdlet.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Get siteInclusionRule associated with a SharePoint protection policy

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Get-MgBetaBackupRestoreSharePointProtectionPolicySiteInclusionRule -SharePointProtectionPolicyId $sharePointProtectionPolicyId -SiteProtectionRuleId $siteProtectionRuleId

```
This example will get siteinclusionrule associated with a sharepoint protection policy

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: List the siteProtectionUnits associated with a SharePoint protection policy

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Get-MgBetaBackupRestoreSharePointProtectionPolicySiteProtectionUnit -SharePointProtectionPolicyId $sharePointProtectionPolicyId

```
This example will list the siteprotectionunits associated with a sharepoint protection policy

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Get-MgBetaBackupRestoreSharePointRestoreSessionSiteRestoreArtifact -SharePointRestoreSessionId $sharePointRestoreSessionId

```
This example shows how to use the Get-MgBetaBackupRestoreSharePointRestoreSessionSiteRestoreArtifact Cmdlet.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: List all the siteProtectionUnits in a tenant

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Get-MgBetaBackupRestoreSiteProtectionUnit

```
This example will list all the siteprotectionunits in a tenant

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
### Example 1 : Activate an inactive protection policy

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Initialize-MgBetaBackupRestoreProtectionPolicy -ProtectionPolicyBaseId $protectionPolicyBaseId

```
This example will### example 1 : activate an inactive protection policy

### Example 2 : Activate an active protection policy

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Initialize-MgBetaBackupRestoreProtectionPolicy -ProtectionPolicyBaseId $protectionPolicyBaseId

```
This example will### example 2 : activate an active protection policy

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### Example 1: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

$params = @{
effectiveDateTime = [System.DateTime]::Parse("2024-04-19T12-01-03.45Z")
}

Initialize-MgBetaBackupRestoreServiceApp -ServiceAppId $serviceAppId -BodyParameter $params

```
This example shows how to use the Initialize-MgBetaBackupRestoreServiceApp Cmdlet.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Initialize-MgBetaBackupRestoreSession -RestoreSessionBaseId $restoreSessionBaseId

```
This example shows how to use the Initialize-MgBetaBackupRestoreSession Cmdlet.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
### Example 1: Deactivate an active protection policy

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Invoke-MgBetaDeactivateSolutionBackupRestoreProtectionPolicy -ProtectionPolicyBaseId $protectionPolicyBaseId

```
This example will deactivate an active protection policy

### Example 2 : Deactivate a protection policy in updating state

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Invoke-MgBetaDeactivateSolutionBackupRestoreProtectionPolicy -ProtectionPolicyBaseId $protectionPolicyBaseId

```
This example will### example 2 : deactivate a protection policy in updating state

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

Invoke-MgBetaDeactivateSolutionBackupRestoreServiceApp -ServiceAppId $serviceAppId

```
This example shows how to use the Invoke-MgBetaDeactivateSolutionBackupRestoreServiceApp Cmdlet.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
### Example 1: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

$params = @{
displayName = "Exchange Protection Policy"
mailboxProtectionUnits = @(
@{
userId = "cdd3a849-dcaf-4a85-af82-7e39fc14019a"
}
@{
userId = "9bc069da-b746-41a4-89ab-26125c6373c7"
}
@{
userId = "b218eb4a-ea72-42bd-8f0b-d0bbf794bec7"
}
)
}

New-MgBetaBackupRestoreExchangeProtectionPolicy -BodyParameter $params

```
This example shows how to use the New-MgBetaBackupRestoreExchangeProtectionPolicy Cmdlet.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
### Example 1: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

$params = @{
displayName = "OneDrive For Business Protection Policy"
driveProtectionUnits = @(
@{
userId = "cdd3a849-dcaf-4a85-af82-7e39fc14019"
}
@{
userId = "9bc069da-b746-41a4-89ab-26125c6373c7"
}
@{
userId = "b218eb4a-ea72-42bd-8f0b-d0bbf794bec7"
}
)
}

New-MgBetaBackupRestoreOneDriveForBusinessProtectionPolicy -BodyParameter $params

```
This example shows how to use the New-MgBetaBackupRestoreOneDriveForBusinessProtectionPolicy Cmdlet.

14 changes: 14 additions & 0 deletions src/Bookings/beta/examples/New-MgBetaBackupRestoreServiceApp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### Example 1: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Bookings

$params = @{
}

New-MgBetaBackupRestoreServiceApp -BodyParameter $params

```
This example shows how to use the New-MgBetaBackupRestoreServiceApp Cmdlet.

Loading
Loading