Skip to content

Commit

Permalink
Merge pull request #2895 from microsoftgraph/WeeklyExamplesUpdate/202…
Browse files Browse the repository at this point in the history
…408090307

[v2] Examples Update
  • Loading branch information
timayabi2020 authored Aug 12, 2024
2 parents 908a17b + 8dc85c7 commit a493370
Show file tree
Hide file tree
Showing 61 changed files with 712 additions and 328 deletions.
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,11 @@
### Example 1: Code snippet

```powershell
Import-Module Microsoft.Graph.Beta.Bookings
Get-MgBetaVirtualEventWebinarRegistrationSession -VirtualEventWebinarId $virtualEventWebinarId -VirtualEventRegistrationId $virtualEventRegistrationId
```
This example shows how to use the Get-MgBetaVirtualEventWebinarRegistrationSession Cmdlet.

Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ $params = @{
displayName = "Exchange Protection Policy"
mailboxProtectionUnits = @(
@{
userId = "cdd3a849-dcaf-4a85-af82-7e39fc14019a"
directoryObjectId = "cdd3a849-dcaf-4a85-af82-7e39fc14019a"
}
@{
userId = "9bc069da-b746-41a4-89ab-26125c6373c7"
directoryObjectId = "9bc069da-b746-41a4-89ab-26125c6373c7"
}
@{
userId = "b218eb4a-ea72-42bd-8f0b-d0bbf794bec7"
directoryObjectId = "b218eb4a-ea72-42bd-8f0b-d0bbf794bec7"
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ $params = @{
displayName = "OneDrive For Business Protection Policy"
driveProtectionUnits = @(
@{
userId = "cdd3a849-dcaf-4a85-af82-7e39fc14019"
directoryObjectId = "cdd3a849-dcaf-4a85-af82-7e39fc14019"
}
@{
userId = "9bc069da-b746-41a4-89ab-26125c6373c7"
directoryObjectId = "9bc069da-b746-41a4-89ab-26125c6373c7"
}
@{
userId = "b218eb4a-ea72-42bd-8f0b-d0bbf794bec7"
directoryObjectId = "b218eb4a-ea72-42bd-8f0b-d0bbf794bec7"
}
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
### Example 1: Creating registration record with delegated permission

```powershell
Import-Module Microsoft.Graph.Beta.Bookings
$params = @{
preferredTimezone = "Pacific Standard Time"
preferredLanguage = "en-us"
registrationQuestionAnswers = @(
@{
questionId = "95320781-96b3-4b8f-8cf8-e6561d23447a"
value = $null
booleanValue = $null
multiChoiceValues = @(
"Seattle"
)
}
@{
questionId = "4577afdb-8bee-4219-b482-04b52c6b855c"
value = $null
booleanValue = $true
multiChoiceValues = @(
)
}
@{
questionId = "80fefcf1-caf7-4cd3-b8d7-159e17c47f20"
value = $null
booleanValue = $null
multiChoiceValues = @(
"Cancun"
"Hoboken"
"Beijing"
)
}
)
}
New-MgBetaVirtualEventWebinarRegistration -VirtualEventWebinarId $virtualEventWebinarId -BodyParameter $params
```
This example shows creating registration record with delegated permission

### Example 2: Creating registration record with application permission

```powershell
Import-Module Microsoft.Graph.Beta.Bookings
$params = @{
firstName = "Diane"
lastName = "Demoss"
email = "DianeDemoss@contoso.com"
preferredTimezone = "Pacific Standard Time"
preferredLanguage = "en-us"
registrationQuestionAnswers = @(
@{
questionId = "95320781-96b3-4b8f-8cf8-e6561d23447a"
value = $null
booleanValue = $null
multiChoiceValues = @(
"Seattle"
)
}
@{
questionId = "4577afdb-8bee-4219-b482-04b52c6b855c"
value = $null
booleanValue = $true
multiChoiceValues = @(
)
}
@{
questionId = "80fefcf1-caf7-4cd3-b8d7-159e17c47f20"
value = $null
booleanValue = $null
multiChoiceValues = @(
"London"
"New York City"
)
}
)
}
New-MgBetaVirtualEventWebinarRegistration -VirtualEventWebinarId $virtualEventWebinarId -BodyParameter $params
```
This example shows creating registration record with application permission

Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ $params = @{
displayName = "Exchange Policy - Inadvertent data loss"
"mailboxProtectionUnits@delta" = @(
@{
userId = "1b014d8c-71fe-4d00-a01a-31850bc5b32c"
directoryObjectId = "1b014d8c-71fe-4d00-a01a-31850bc5b32c"
}
@{
userId = "2b014d8c-71fe-4d00-a01a-31850bc5b32c"
directoryObjectId = "2b014d8c-71fe-4d00-a01a-31850bc5b32c"
}
@{
"@removed" = @{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ $params = @{
displayName = "One Drive Policy - Inadvertent data loss"
"driveProtectionUnits@delta" = @(
@{
userId = "1b014d8c-71fe-4d00-a01a-31850bc5b32c"
directoryObjectId = "1b014d8c-71fe-4d00-a01a-31850bc5b32c"
}
@{
userId = "2b014d8c-71fe-4d00-a01a-31850bc5b32c"
directoryObjectId = "2b014d8c-71fe-4d00-a01a-31850bc5b32c"
}
@{
"@removed" = @{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Import-Module Microsoft.Graph.Bookings
Get-MgVirtualEventWebinarRegistration -VirtualEventWebinarId $virtualEventWebinarId
Get-MgVirtualEventWebinarRegistration -VirtualEventWebinarId $virtualEventWebinarId -VirtualEventRegistrationId $virtualEventRegistrationId
```
This example shows how to use the Get-MgVirtualEventWebinarRegistration Cmdlet.
Expand Down
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 @@

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Example 1: Code snippet
### Example 1: Invite one participant to an existing call

```powershell
Expand All @@ -8,6 +8,7 @@ $params = @{
participants = @(
@{
"@odata.type" = "#microsoft.graph.invitationParticipantInfo"
replacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db"
identity = @{
"@odata.type" = "#microsoft.graph.identitySet"
user = @{
Expand All @@ -16,7 +17,6 @@ $params = @{
identityProvider = "AAD"
}
}
participantId = "a7ebfb2d-871e-419c-87af-27290b22e8db"
}
)
clientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
Expand All @@ -25,5 +25,132 @@ $params = @{
Invoke-MgBetaInviteCommunicationCallParticipant -CallId $callId -BodyParameter $params
```
This example shows how to use the Invoke-MgBetaInviteCommunicationCallParticipant Cmdlet.
This example will invite one participant to an existing call

### Example 2: Invite multiple participants to an existing group call

```powershell
Import-Module Microsoft.Graph.Beta.CloudCommunications
$params = @{
participants = @(
@{
"@odata.type" = "#microsoft.graph.invitationParticipantInfo"
replacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db"
identity = @{
"@odata.type" = "#microsoft.graph.identitySet"
user = @{
"@odata.type" = "#microsoft.graph.identity"
id = "7e1b4346-85a6-4bdd-abe3-d11c5d420efe"
identityProvider = "AAD"
}
}
}
@{
"@odata.type" = "#microsoft.graph.invitationParticipantInfo"
replacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db"
identity = @{
"@odata.type" = "#microsoft.graph.identitySet"
user = @{
"@odata.type" = "#microsoft.graph.identity"
id = "1e126418-44a0-4a94-a6f8-0efe1ad71acb"
identityProvider = "AAD"
}
}
}
)
clientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
}
Invoke-MgBetaInviteCommunicationCallParticipant -CallId $callId -BodyParameter $params
```
This example will invite multiple participants to an existing group call

### Example 3: Invite participants to an existing group call, replacing an existing Peer-to-Peer call

```powershell
Import-Module Microsoft.Graph.Beta.CloudCommunications
$params = @{
participants = @(
@{
"@odata.type" = "#microsoft.graph.invitationParticipantInfo"
replacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db"
identity = @{
"@odata.type" = "#microsoft.graph.identitySet"
user = @{
"@odata.type" = "#microsoft.graph.identity"
id = "7e1b4346-85a6-4bdd-abe3-d11c5d420efe"
identityProvider = "AAD"
}
}
}
)
clientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
}
Invoke-MgBetaInviteCommunicationCallParticipant -CallId $callId -BodyParameter $params
```
This example will invite participants to an existing group call, replacing an existing peer-to-peer call

### Example 4: Invite one PSTN participant to an existing call

```powershell
Import-Module Microsoft.Graph.Beta.CloudCommunications
$params = @{
participants = @(
@{
"@odata.type" = "#microsoft.graph.invitationParticipantInfo"
identity = @{
"@odata.type" = "#microsoft.graph.identitySet"
phone = @{
"@odata.type" = "#microsoft.graph.identity"
id = "+12345678901"
}
}
}
)
clientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
}
Invoke-MgBetaInviteCommunicationCallParticipant -CallId $callId -BodyParameter $params
```
This example will invite one pstn participant to an existing call

### Example 5: Move one participant from one meeting to another

```powershell
Import-Module Microsoft.Graph.Beta.CloudCommunications
$params = @{
participants = @(
@{
"@odata.type" = "#microsoft.graph.invitationParticipantInfo"
replacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db"
participantId = "7d501bf1-5ee4-4605-ba92-0ae4513c611c"
identity = @{
"@odata.type" = "#microsoft.graph.identitySet"
user = @{
"@odata.type" = "#microsoft.graph.identity"
id = "682b6c37-0729-4fab-ace6-d730d5d9137e"
identityProvider = "AAD"
}
}
}
)
clientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
}
Invoke-MgBetaInviteCommunicationCallParticipant -CallId $callId -BodyParameter $params
```
This example will move one participant from one meeting to another

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

```powershell
Import-Module Microsoft.Graph.Beta.DeviceManagement.Actions
New-MgBetaDeviceManagementVirtualEndpointCloudPcSnapshot -CloudPCId $cloudPCId
```
This example shows how to use the New-MgBetaDeviceManagementVirtualEndpointCloudPcSnapshot Cmdlet.

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

```powershell
Import-Module Microsoft.Graph.Beta.DeviceManagement.Actions
$params = @{
targetServicePlanId = "30d0e128-de93-41dc-89ec-33d84bb662a0"
}
Resize-MgBetaDeviceManagementVirtualEndpointCloudPc -CloudPCId $cloudPCId -BodyParameter $params
```
This example shows how to use the Resize-MgBetaDeviceManagementVirtualEndpointCloudPc Cmdlet.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ $params = @{
windowsSetting = @{
locale = "en-US"
}
microsoftManagedDesktop = @{
managedType = "starterManaged"
profile = $null
}
autopatch = @{
autopatchGroupId = "91197a0b-3a74-408d-ba88-bce3fdc4e5eb"
}
}
Update-MgBetaDeviceManagementVirtualEndpointProvisioningPolicy -CloudPcProvisioningPolicyId $cloudPcProvisioningPolicyId -BodyParameter $params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Import-Module Microsoft.Graph.Beta.DeviceManagement.Enrollment
$params = @{
description = "An example custom role"
### Example 2
rolePermissions = @(
@{
allowedResourceActions = @(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Import-Module Microsoft.Graph.Beta.DeviceManagement.Enrollment
$params = @{
description = "Update basic properties and permission of application registrations"
### Example 2
rolePermissions = @(
@{
allowedResourceActions = @(
Expand Down
Loading

0 comments on commit a493370

Please sign in to comment.