Skip to content

Commit 7e13e5e

Browse files
authored
Merge pull request #2987 from microsoftgraph/WeeklyExamplesUpdate/202410040310
[v2] Examples Update
2 parents b685838 + 962d256 commit 7e13e5e

File tree

82 files changed

+930
-169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+930
-169
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Example
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Beta.Applications
6+
7+
Get-MgBetaServicePrincipalSynchronizationTemplate -ServicePrincipalId $servicePrincipalId
8+
9+
```
10+
This example will### example
11+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
### Example 1: Code snippet
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Beta.Applications
6+
7+
$params = @{
8+
"@odata.type" = "#microsoft.graph.customClaimsPolicy"
9+
includeBasicClaimSet = "Boolean"
10+
includeApplicationIdInIssuer = "Boolean"
11+
audienceOverride = "String"
12+
claims = @(
13+
@{
14+
"@odata.type" = "microsoft.graph.customClaim"
15+
}
16+
)
17+
}
18+
19+
Set-MgBetaServicePrincipalClaimPolicy -ServicePrincipalId $servicePrincipalId -BodyParameter $params
20+
21+
```
22+
This example shows how to use the Set-MgBetaServicePrincipalClaimPolicy Cmdlet.
23+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Example
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Applications
6+
7+
Get-MgServicePrincipalSynchronizationTemplate -ServicePrincipalId $servicePrincipalId
8+
9+
```
10+
This example will### example
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Example 1: Code snippet
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Beta.Bookings
6+
7+
New-MgBetaApproval
8+
9+
```
10+
This example shows how to use the New-MgBetaApproval Cmdlet.
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Example 1: Code snippet
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Beta.Bookings
6+
7+
Stop-MgBetaApprovalItem -ApprovalItemId $approvalItemId
8+
9+
```
10+
This example shows how to use the Stop-MgBetaApprovalItem Cmdlet.
11+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
### Example 1: Activate an inactive protection policy
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Bookings
6+
7+
Initialize-MgBackupRestoreProtectionPolicy -ProtectionPolicyBaseId $protectionPolicyBaseId
8+
9+
```
10+
This example will activate an inactive protection policy
11+
12+
### Example 2: Activate an active protection policy
13+
14+
```powershell
15+
16+
Import-Module Microsoft.Graph.Bookings
17+
18+
Initialize-MgBackupRestoreProtectionPolicy -ProtectionPolicyBaseId $protectionPolicyBaseId
19+
20+
```
21+
This example will activate an active protection policy
22+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### Example 1: Code snippet
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Bookings
6+
7+
$params = @{
8+
effectiveDateTime = [System.DateTime]::Parse("2024-04-19T12:01:03.45Z")
9+
}
10+
11+
Initialize-MgBackupRestoreServiceApp -ServiceAppId $serviceAppId -BodyParameter $params
12+
13+
```
14+
This example shows how to use the Initialize-MgBackupRestoreServiceApp Cmdlet.
15+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Example 1: Code snippet
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Bookings
6+
7+
Initialize-MgBackupRestoreSession -RestoreSessionBaseId $restoreSessionBaseId
8+
9+
```
10+
This example shows how to use the Initialize-MgBackupRestoreSession Cmdlet.
11+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
### Example 1: Deactivate an active protection policy
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Bookings
6+
7+
Invoke-MgDeactivateSolutionBackupRestoreProtectionPolicy -ProtectionPolicyBaseId $protectionPolicyBaseId
8+
9+
```
10+
This example will deactivate an active protection policy
11+
12+
### Example 2 : Deactivate a protection policy in updating state
13+
14+
```powershell
15+
16+
Import-Module Microsoft.Graph.Bookings
17+
18+
Invoke-MgDeactivateSolutionBackupRestoreProtectionPolicy -ProtectionPolicyBaseId $protectionPolicyBaseId
19+
20+
```
21+
This example will### example 2 : deactivate a protection policy in updating state
22+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Example 1: Code snippet
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Bookings
6+
7+
Invoke-MgDeactivateSolutionBackupRestoreServiceApp -ServiceAppId $serviceAppId
8+
9+
```
10+
This example shows how to use the Invoke-MgDeactivateSolutionBackupRestoreServiceApp Cmdlet.
11+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
### Example 1: Search request
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Bookings
6+
7+
$params = @{
8+
protectionUnitIds = @(
9+
"23014d8c-71fe-4d00-a01a-31850bc5b42a"
10+
"43014d8c-71fe-4d00-a01a-31850bc5b42b"
11+
"63014d8c-71fe-4d00-a01a-31850bc5b42c"
12+
"83014d8c-71fe-4d00-a01a-31850bc5b42d"
13+
)
14+
protectionTimePeriod = @{
15+
startDateTime = [System.DateTime]::Parse("2021-01-01T00:00:00Z")
16+
endDateTime = [System.DateTime]::Parse("2021-01-08T00:00:00Z")
17+
}
18+
restorePointPreference = "latest"
19+
tags = "fastRestore"
20+
}
21+
22+
Search-MgBackupRestorePoint -BodyParameter $params
23+
24+
```
25+
This example will search request
26+
27+
### Example 2: Search with artifactQuery expression
28+
29+
```powershell
30+
31+
Import-Module Microsoft.Graph.Bookings
32+
33+
$params = @{
34+
artifactQuery = @{
35+
queryExpression = "(Sender -eq 'abc@contoso.com') -and (Subject -like '*Check email*' -or Subject -like ' Important') -and (HasAttachment -eq 'true') -and (PitrDumpsterActionTriggeredTime -gt '{2024-09-21T08:20:00.0000000Z}')"
36+
artifactType = "message"
37+
}
38+
protectionUnitIds = @(
39+
"23014d8c-71fe-4d00-a01a-31850bc5b42a"
40+
)
41+
protectionTimePeriod = @{
42+
startDateTime = [System.DateTime]::Parse("2021-01-01T00:00:00Z")
43+
}
44+
restorePointPreference = "oldest"
45+
}
46+
47+
Search-MgBackupRestorePoint -BodyParameter $params
48+
49+
```
50+
This example will search with artifactquery expression
51+

src/CloudCommunications/beta/examples/Invoke-MgBetaAnswerCommunicationCall.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ $params = @{
1616
callOptions = @{
1717
"@odata.type" = "#microsoft.graph.incomingCallOptions"
1818
isContentSharingNotificationEnabled = $true
19+
isDeltaRosterEnabled = $true
1920
}
2021
participantCapacity = 200
2122
}

src/DeviceManagement.Administration/beta/examples/Update-MgBetaDeviceManagementVirtualEndpointProvisioningPolicy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ $params = @{
2525
autopatch = @{
2626
autopatchGroupId = "91197a0b-3a74-408d-ba88-bce3fdc4e5eb"
2727
}
28+
autopilotConfiguration = @{
29+
devicePreparationProfileId = "59e5d3d2-ec68-4bfe-9693-27975b318990"
30+
applicationTimeoutInMinutes = 30
31+
onFailureDeviceAccessDenied = $false
32+
}
2833
}
2934
3035
Update-MgBetaDeviceManagementVirtualEndpointProvisioningPolicy -CloudPcProvisioningPolicyId $cloudPcProvisioningPolicyId -BodyParameter $params

src/DeviceManagement.Administration/v1.0/examples/New-MgDeviceManagementRoleDefinition.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Import-Module Microsoft.Graph.DeviceManagement.Administration
66
77
$params = @{
8-
"@odata.type" = "#microsoft.graph.roleDefinition"
8+
"@odata.type" = "#microsoft.graph.deviceAndAppManagementRoleDefinition"
99
displayName = "Display Name value"
1010
description = "Description value"
1111
rolePermissions = @(

src/DeviceManagement.Administration/v1.0/examples/Update-MgDeviceManagementRoleDefinition.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Import-Module Microsoft.Graph.DeviceManagement.Administration
66
77
$params = @{
8-
"@odata.type" = "#microsoft.graph.roleDefinition"
8+
"@odata.type" = "#microsoft.graph.deviceAndAppManagementRoleDefinition"
99
displayName = "Display Name value"
1010
description = "Description value"
1111
rolePermissions = @(

src/DeviceManagement.Enrollment/beta/examples/New-MgBetaRoleManagementCloudPcRoleDefinition.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Import-Module Microsoft.Graph.Beta.DeviceManagement.Enrollment
66
77
$params = @{
88
description = "An example custom role"
9+
### Example 2
910
rolePermissions = @(
1011
@{
1112
allowedResourceActions = @(

src/DeviceManagement.Enrollment/beta/examples/Update-MgBetaRoleManagementCloudPcRoleDefinition.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Import-Module Microsoft.Graph.Beta.DeviceManagement.Enrollment
66
77
$params = @{
88
description = "Update basic properties and permission of application registrations"
9+
### Example 2
910
rolePermissions = @(
1011
@{
1112
allowedResourceActions = @(

src/DeviceManagement/v1.0/examples/New-MgDeviceManagementDeviceCompliancePolicy.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,21 @@
55
Import-Module Microsoft.Graph.DeviceManagement
66
77
$params = @{
8-
"@odata.type" = "#microsoft.graph.macOSCompliancePolicy"
8+
"@odata.type" = "#microsoft.graph.windowsPhone81CompliancePolicy"
99
description = "Description value"
1010
displayName = "Display Name value"
1111
version = 7
12-
passwordRequired = $true
1312
passwordBlockSimple = $true
1413
passwordExpirationDays =
1514
passwordMinimumLength =
1615
passwordMinutesOfInactivityBeforeLock =
17-
passwordPreviousPasswordBlockCount =
1816
passwordMinimumCharacterSetCount =
1917
passwordRequiredType = "alphanumeric"
18+
passwordPreviousPasswordBlockCount =
19+
passwordRequired = $true
2020
osMinimumVersion = "Os Minimum Version value"
2121
osMaximumVersion = "Os Maximum Version value"
22-
systemIntegrityProtectionEnabled = $true
23-
deviceThreatProtectionEnabled = $true
24-
deviceThreatProtectionRequiredSecurityLevel = "secured"
2522
storageRequireEncryption = $true
26-
firewallEnabled = $true
27-
firewallBlockAllIncoming = $true
28-
firewallEnableStealthMode = $true
2923
}
3024
3125
New-MgDeviceManagementDeviceCompliancePolicy -BodyParameter $params

src/DeviceManagement/v1.0/examples/New-MgDeviceManagementDeviceConfiguration.md

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,50 +5,11 @@
55
Import-Module Microsoft.Graph.DeviceManagement
66
77
$params = @{
8-
"@odata.type" = "#microsoft.graph.windowsUpdateForBusinessConfiguration"
8+
"@odata.type" = "#microsoft.graph.windows10EnterpriseModernAppManagementConfiguration"
99
description = "Description value"
1010
displayName = "Display Name value"
1111
version = 7
12-
deliveryOptimizationMode = "httpOnly"
13-
prereleaseFeatures = "settingsOnly"
14-
automaticUpdateMode = "notifyDownload"
15-
microsoftUpdateServiceAllowed = $true
16-
driversExcluded = $true
17-
installationSchedule = @{
18-
"@odata.type" = "microsoft.graph.windowsUpdateScheduledInstall"
19-
scheduledInstallDay = "everyday"
20-
scheduledInstallTime = "11:59:31.3170000"
21-
}
22-
qualityUpdatesDeferralPeriodInDays =
23-
featureUpdatesDeferralPeriodInDays =
24-
qualityUpdatesPaused = $true
25-
featureUpdatesPaused = $true
26-
qualityUpdatesPauseExpiryDateTime = "2017-01-01T00:00:22.9594683-08:00"
27-
featureUpdatesPauseExpiryDateTime = "2016-12-31T23:58:08.068669-08:00"
28-
businessReadyUpdatesOnly = "all"
29-
skipChecksBeforeRestart = $true
30-
updateWeeks = "firstWeek"
31-
qualityUpdatesPauseStartDate = "2016-12-31"
32-
featureUpdatesPauseStartDate = "2016-12-31"
33-
featureUpdatesRollbackWindowInDays =
34-
qualityUpdatesWillBeRolledBack = $true
35-
featureUpdatesWillBeRolledBack = $true
36-
qualityUpdatesRollbackStartDateTime = "2016-12-31T23:57:01.05526-08:00"
37-
featureUpdatesRollbackStartDateTime = "2017-01-01T00:03:21.6080517-08:00"
38-
engagedRestartDeadlineInDays =
39-
engagedRestartSnoozeScheduleInDays =
40-
engagedRestartTransitionScheduleInDays =
41-
deadlineForFeatureUpdatesInDays =
42-
deadlineForQualityUpdatesInDays =
43-
deadlineGracePeriodInDays =
44-
postponeRebootUntilAfterDeadline = $true
45-
autoRestartNotificationDismissal = "automatic"
46-
scheduleRestartWarningInHours =
47-
scheduleImminentRestartWarningInMinutes =
48-
userPauseAccess = "enabled"
49-
userWindowsUpdateScanAccess = "enabled"
50-
updateNotificationLevel = "defaultNotifications"
51-
allowWindows11Upgrade = $true
12+
uninstallBuiltInApps = $true
5213
}
5314
5415
New-MgDeviceManagementDeviceConfiguration -BodyParameter $params

src/DeviceManagement/v1.0/examples/Update-MgDeviceManagementDeviceCompliancePolicy.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,21 @@
55
Import-Module Microsoft.Graph.DeviceManagement
66
77
$params = @{
8-
"@odata.type" = "#microsoft.graph.macOSCompliancePolicy"
8+
"@odata.type" = "#microsoft.graph.windowsPhone81CompliancePolicy"
99
description = "Description value"
1010
displayName = "Display Name value"
1111
version = 7
12-
passwordRequired = $true
1312
passwordBlockSimple = $true
1413
passwordExpirationDays =
1514
passwordMinimumLength =
1615
passwordMinutesOfInactivityBeforeLock =
17-
passwordPreviousPasswordBlockCount =
1816
passwordMinimumCharacterSetCount =
1917
passwordRequiredType = "alphanumeric"
18+
passwordPreviousPasswordBlockCount =
19+
passwordRequired = $true
2020
osMinimumVersion = "Os Minimum Version value"
2121
osMaximumVersion = "Os Maximum Version value"
22-
systemIntegrityProtectionEnabled = $true
23-
deviceThreatProtectionEnabled = $true
24-
deviceThreatProtectionRequiredSecurityLevel = "secured"
2522
storageRequireEncryption = $true
26-
firewallEnabled = $true
27-
firewallBlockAllIncoming = $true
28-
firewallEnableStealthMode = $true
2923
}
3024
3125
Update-MgDeviceManagementDeviceCompliancePolicy -DeviceCompliancePolicyId $deviceCompliancePolicyId -BodyParameter $params

0 commit comments

Comments
 (0)