Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
313b952
Updating examples
Aug 1, 2025
a37c29d
Merge pull request #3372 from microsoftgraph/WeeklyExamplesUpdate/202…
ramsessanchez Aug 1, 2025
b93b489
adding template context
adrian05-ms Aug 13, 2025
b70669d
removing checkout
adrian05-ms Aug 13, 2025
de8230e
Merge pull request #3377 from microsoftgraph/feat/security-pipeline-fix
adrian05-ms Aug 13, 2025
c02426c
manually update openApi docs (#3373)
ramsessanchez Aug 15, 2025
8a4bcd6
Updating examples (#3378)
MIchaelMainer Aug 15, 2025
8eff8b8
Compress MgCommandMetadata.json to reduce whitespace/package size for…
sean-r-williams Aug 15, 2025
cbe3b2c
[v2] Weekly OpenApiDocs Refresh (#3379)
MIchaelMainer Aug 18, 2025
e6298e3
fix: include the groups on prem sync behavior in the OpenAPI spec (#3…
gavinbarron Sep 22, 2025
7fec312
update azure.identity tooling (#3403)
ramsessanchez Sep 23, 2025
6ea3d09
Updating examples (#3398)
MIchaelMainer Sep 23, 2025
79dc52f
Update New-MgDomainFederationConfiguration.md (#3385)
juntakata Sep 23, 2025
351e577
Fix missing extensionAttributes structure in PowerShell Example 2 for…
KonstantinMSFT Sep 23, 2025
db443b4
merge main into dev
ramsessanchez Sep 23, 2025
b14cdc1
bump to 2.31.0 for release
ramsessanchez Sep 23, 2025
030a900
Fix: Include the users onPremSyncBehavior API in the OpenAPI spec (#3…
darshanmaiya Sep 23, 2025
ff8de4f
match version in auth csproj
ramsessanchez Sep 23, 2025
1b1a196
merge dev into branch
ramsessanchez Sep 23, 2025
74b15a6
[v2] Weekly OpenApiDocs Refresh (#3410)
MIchaelMainer Sep 26, 2025
33cb40d
merge dev into branch
ramsessanchez Sep 26, 2025
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
6 changes: 3 additions & 3 deletions config/ModuleMetadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
"versions": {
"authentication": {
"prerelease": "",
"version": "2.30.0"
"version": "2.31.0"
},
"beta": {
"prerelease": "",
"version": "2.30.0"
"version": "2.31.0"
},
"v1.0": {
"prerelease": "",
"version": "2.30.0"
"version": "2.31.0"
}
}
}
4 changes: 2 additions & 2 deletions config/ModulesMapping.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"Education": "^education\\.",
"Files": "^drives\\.|^shares\\.|^users.drive$|^groups.drive$",
"Financials": "^financials\\.",
"Groups": "^groups.group$|^groups.directoryObject$|^groups.conversation$|^groups.endpoint$|^groups.extension$|^groups.groupLifecyclePolicy$|^groups.resourceSpecificPermissionGrant$|^groups.profilePhoto$|^groups.conversationThread$|^groupLifecyclePolicies\\.|^users.group$|^groups.directorySetting$|^groups.*.Actions$|^groups.*.Functions$|^groupSettings\\.|^groups.groupSetting$|^groupSettingTemplates\\.",
"Groups": "^groups.group$|^groups.directoryObject$|^groups.conversation$|^groups.endpoint$|^groups.extension$|^groups.groupLifecyclePolicy$|^groups.resourceSpecificPermissionGrant$|^groups.profilePhoto$|^groups.conversationThread$|^groupLifecyclePolicies\\.|^users.group$|^groups.directorySetting$|^groups.onPremisesSyncBehavior$|^groups.*.Actions$|^groups.*.Functions$|^groupSettings\\.|^groups.groupSetting$|^groupSettingTemplates\\.",
"Identity.DirectoryManagement": "^administrativeUnits\\.|^contacts\\.|^devices\\.|^domains\\.|^directoryRoles\\.|^directoryRoleTemplates\\.|^directorySettingTemplates\\.|^settings\\.|^subscribedSkus\\.|^contracts\\.|^directory\\.|^users.scopedRoleMembership$|^organization.organization$|^organization.organizationalBranding$|^organization.organizationSettings$|^organization.*.Actions$|^organization.extension$|^tenantRelationships.*.Actions$|^tenantRelationships.*.Functions$|admin.peopleAdminSettings$|^organization\\.partnerInformation$",
"Identity.Governance": "^accessReviews\\.|^businessFlowTemplates\\.|^programs\\.|^programControls\\.|^programControlTypes\\.|^privilegedRoles\\.|^privilegedRoleAssignments\\.|^privilegedRoleAssignmentRequests\\.|^privilegedApproval\\.|^privilegedOperationEvents\\.|^privilegedAccess\\.|^agreements\\.|^users.agreementAcceptance$|^identityGovernance\\.|^roleManagement.rbacApplication$|^roleManagement.*.Functions$|roleManagement.*.Actions$",
"Identity.SignIns": "^organization.certificateBasedAuthConfiguration$|^invitations\\.|^identityProviders\\.|^oauth2PermissionGrants\\.|^identityProtection\\.|^dataPolicyOperations\\.|^identity\\.|^trustFramework\\.|^informationProtection\\.|^policies\\.|^users.authentication$|^users.informationProtection$|^tenantRelationships.multiTenantOrganization$|^policies.deviceRegistrationPolicy$|^policies.deviceRegistrationPolicy$",
Expand All @@ -37,7 +37,7 @@
"Security": "^security\\.|^users.security$",
"Sites": "^sites.baseSitePage$|^sites.site$|^sites.itemAnalytics$|^sites.columnDefinition$|^sites.contentType$|^sites.drive$|^sites.list$|^sites.sitePage$|^sites.permission$|^sites.store$|^users.site$|^groups.site$|^sites.*.Functions$|^sites.*.Actions$|^sites.richLongRunningOperation$|^termStore.sets.ListChildren$|^admin.sharepoint$",
"Teams": "^teams\\.|^chats\\.|^users.chat$|^appCatalogs.teamsApp$|^users.userTeamwork$|^teamwork\\.|^users.team$|^groups.team$",
"Users": "^users.user$|^users.directoryObject$|^users.licenseDetails$|^users.mailboxSettings|^users.notification$|^users.outlookUser$|^users.profilePhoto$|^users.userSettings$|^users.extension$|^users.oAuth2PermissionGrant$|^users.todo$|^users.itemInsights$|^users.servicePrincipal$",
"Users": "^users.user$|^users.directoryObject$|^users.licenseDetails$|^users.mailboxSettings|^users.notification$|^users.outlookUser$|^users.profilePhoto$|^users.userSettings$|^users.extension$|^users.oAuth2PermissionGrant$|^users.onPremisesSyncBehavior$|^users.todo$|^users.itemInsights$|^users.servicePrincipal$",
"Users.Actions": "^users.*.Actions$",
"Users.Functions": "^users.*.Functions$",
"WindowsUpdates": "^admin.adminWindows$"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
### Example

```powershell

Import-Module Microsoft.Graph.Beta.Applications

Get-MgBetaServicePrincipalSynchronizationTemplate -ServicePrincipalId $servicePrincipalId

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

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<LangVersion>9.0</LangVersion>
<TargetFrameworks>netstandard2.0;net6.0;net472</TargetFrameworks>
<RootNamespace>Microsoft.Graph.PowerShell.Authentication.Core</RootNamespace>
<Version>2.26.1</Version>
<Version>2.31.0</Version>
<!-- Suppress .NET Target Framework Moniker (TFM) Support Build Warnings -->
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
</PropertyGroup>
Expand All @@ -13,9 +13,9 @@
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.13.2" />
<PackageReference Include="Azure.Identity.Broker" Version="1.2.0" />
<PackageReference Include="Microsoft.Graph.Core" Version="3.2.2" />
<PackageReference Include="Azure.Identity" Version="1.14.2" />
<PackageReference Include="Azure.Identity.Broker" Version="1.2.1" />
<PackageReference Include="Microsoft.Graph.Core" Version="3.2.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
### Example 1: Code snippet
### Example 1: Get a list of reading assignment submissions from the last 24 hours

```powershell

Import-Module Microsoft.Graph.Beta.Education

Get-MgBetaEducationReportReadingAssignmentSubmission -Filter "submitDateTime gt 2023-10-10T00:00:00.000Z"
Get-MgBetaEducationReportReadingAssignmentSubmission

```
This example shows how to use the Get-MgBetaEducationReportReadingAssignmentSubmission Cmdlet.
This example will get a list of reading assignment submissions from the last 24 hours

### Example 2: Get a list of the reading assignment submissions for a specific date using $filter

```powershell

Import-Module Microsoft.Graph.Beta.Education

Get-MgBetaEducationReportReadingAssignmentSubmission -Filter "submissionDateTime gt 2023-10-10T00:00:00.000Z and submissionDateTime lt 2023-10-11T00:00:00Z"

```
This example will get a list of the reading assignment submissions for a specific date using $filter

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
### Example 1: Get a list of the Reading Coach passages from the last 24 hours

```powershell

Import-Module Microsoft.Graph.Beta.Education

Get-MgBetaEducationReportReadingCoachPassage

```
This example will get a list of the reading coach passages from the last 24 hours

### Example 2: Get a list of the Reading Coach passages for a specific date using $filter

```powershell

Import-Module Microsoft.Graph.Beta.Education

Get-MgBetaEducationReportReadingCoachPassage -Filter "practicedAtDateTime gt 2025-06-22T00:00:00Z and practicedAtDateTime lt 2025-06-23T00:00:00Z"

```
This example will get a list of the reading coach passages for a specific date using $filter

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

```powershell

Import-Module Microsoft.Graph.Beta.Identity.DirectoryManagement

Get-MgBetaAdminPeoplePhotoUpdateSetting

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

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Example 1: Configure federation settings for a federated domain

```powershell
New-MgDomainFederationConfiguration -DomainId "contoso.com" -ActiveSignInUri "https://sts.contoso.com/adfs/services/trust/2005/usernamemixed" -DisplayName "Contoso" -IssuerUri "http://contoso.com/adfs/services/trust/" -MetadataExchangeUri "https://sts.contoso.com/adfs/services/trust/mex" -NextSigningCertificate "MIIC3jCCAcagAwIBAgIQEt0T0G5GPZ9" -PassiveSignInUri "https://sts.contoso.com/adfs/ls/" -SignOutUri "https://sts.contoso.com/adfs/ls/" -SigningCertificate "MIIC3jCCAcagAwIBAgIQFsO0R8deG4h" -FederatedIdpMfaBehavior "rejectMfaByFederatedIdp" | Format-List
New-MgDomainFederationConfiguration -DomainId "contoso.com" -ActiveSignInUri "https://sts.contoso.com/adfs/services/trust/2005/usernamemixed" -DisplayName "Contoso" -IssuerUri "http://contoso.com/adfs/services/trust/" -MetadataExchangeUri "https://sts.contoso.com/adfs/services/trust/mex" -NextSigningCertificate "MIIC3jCCAcagAwIBAgIQEt0T0G5GPZ9" -PassiveSignInUri "https://sts.contoso.com/adfs/ls/" -SignOutUri "https://sts.contoso.com/adfs/ls/" -SigningCertificate "MIIC3jCCAcagAwIBAgIQFsO0R8deG4h" -FederatedIdpMfaBehavior "acceptIfMfaDoneByFederatedIdp" -PreferredAuthenticationProtocol "wsFed" | Format-List

ActiveSignInUri : https://sts.deverett.info/adfs/services/trust/2005/usernamemixed
DisplayName : Contoso
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ This example will update the accountenabled property of a device
Import-Module Microsoft.Graph.Identity.DirectoryManagement

$params = @{
"extensionAttribute1" = "Value1"
"extensionAttribute2" = "Value2"
}

Update-MgDevice -DeviceId $deviceId -BodyParameter $params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Import-Module Microsoft.Graph.Beta.Identity.SignIns

Get-MgBetaPolicyMobileAppManagementPolicyIncludedGroup -MobilityManagementPolicyId $mobilityManagementPolicyId
Get-MgBetaPolicyMobileAppManagementPolicyIncludedGroup -MobileAppManagementPolicyId $mobileAppManagementPolicyId

```
This example shows how to use the Get-MgBetaPolicyMobileAppManagementPolicyIncludedGroup Cmdlet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Import-Module Microsoft.Graph.Beta.Identity.SignIns

Get-MgBetaPolicyMobileDeviceManagementPolicyIncludedGroup -MobilityManagementPolicyId $mobilityManagementPolicyId
Get-MgBetaPolicyMobileDeviceManagementPolicyIncludedGroup -MobileDeviceManagementPolicyId $mobileDeviceManagementPolicyId

```
This example shows how to use the Get-MgBetaPolicyMobileDeviceManagementPolicyIncludedGroup Cmdlet.
Expand Down
11 changes: 11 additions & 0 deletions src/NetworkAccess/beta/examples/Get-MgBetaNetworkAccessAlert.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.NetworkAccess

Get-MgBetaNetworkAccessAlert

```
This example shows how to use the Get-MgBetaNetworkAccessAlert 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.NetworkAccess

Get-MgBetaNetworkAccessFilteringProfilePolicy -FilteringProfileId $filteringProfileId -Filter "isof('microsoft.graph.networkaccess.securityProviderPolicyLink')"

```
This example shows how to use the Get-MgBetaNetworkAccessFilteringProfilePolicy 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.NetworkAccess

Get-MgBetaNetworkAccessThreatIntelligencePolicy

```
This example shows how to use the Get-MgBetaNetworkAccessThreatIntelligencePolicy 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.NetworkAccess

Get-MgBetaNetworkAccessTlExternalCertificateAuthorityCertificate

```
This example shows how to use the Get-MgBetaNetworkAccessTlExternalCertificateAuthorityCertificate 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.NetworkAccess

Get-MgBetaNetworkAccessTlInspectionPolicy

```
This example shows how to use the Get-MgBetaNetworkAccessTlInspectionPolicy 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.NetworkAccess

Get-MgBetaNetworkAccessTlInspectionPolicyRule -TlsInspectionPolicyId $tlsInspectionPolicyId

```
This example shows how to use the Get-MgBetaNetworkAccessTlInspectionPolicyRule 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.Reports

Get-MgBetaReportAuthenticationMethodUserEventSummary

```
This example shows how to use the Get-MgBetaReportAuthenticationMethodUserEventSummary 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.Reports

Get-MgBetaReportAuthenticationMethodUserMfaSignInSummary

```
This example shows how to use the Get-MgBetaReportAuthenticationMethodUserMfaSignInSummary 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.Reports

Get-MgBetaReportAuthenticationMethodUserPasswordResetAndChangeSummary

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

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

```powershell

Import-Module Microsoft.Graph.Reports

$params = @{
attributeSet = "full"
billingPeriod = "current"
currencyCode = "USD"
}

Export-MgReportPartnerBillingReconciliationUnbilled -BodyParameter $params

```
This example shows how to use the Export-MgReportPartnerBillingReconciliationUnbilled Cmdlet.

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

```powershell

Import-Module Microsoft.Graph.Search

$params = @{
activities = @(
@{
"@odata.type" = "#microsoft.graph.externalConnectors.externalActivity"
type = "created"
startDateTime = [System.DateTime]::Parse("2021-04-06T18:04:31.033Z")
performedBy = @{
type = "user"
id = "1f0c997e-99f7-43f1-8cca-086f8d42be8d"
}
}
)
}

Add-MgExternalConnectionItemActivity -ExternalConnectionId $externalConnectionId -ExternalItemId $externalItemId -BodyParameter $params

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

11 changes: 11 additions & 0 deletions src/Security/beta/examples/Get-MgBetaSecurityIncidentTask.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.Security

Get-MgBetaSecurityIncidentTask

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

11 changes: 6 additions & 5 deletions tools/Custom/Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using NamespacePrefixPlaceholder.PowerShell.Runtime;
using Microsoft.Graph.PowerShell.Authentication;
using Microsoft.Graph.PowerShell.Authentication.Helpers;
using static NamespacePrefixPlaceholder.PowerShell.Runtime.Extensions;

namespace NamespacePrefixPlaceholder.PowerShell
{
Expand Down Expand Up @@ -70,7 +71,7 @@ public async Task EventHandler(string id, CancellationToken cancellationToken, F

private async Task OnCmdletBeginProcessing(string id, CancellationToken cancellationToken, Func<EventArgs> getEventData, Func<string, CancellationToken, Func<EventArgs>, Task> signal, InvocationInfo invocationInfo)
{
using (Extensions.NoSynchronizationContext)
using (NoSynchronizationContext)
{
string[] commandNameSegment = invocationInfo.MyCommand.Name.Split('_');
if (commandNameSegment.Length > 1)
Expand All @@ -93,7 +94,7 @@ private async Task OnCmdletBeginProcessing(string id, CancellationToken cancella

private async Task OnBeforeCall(string id, CancellationToken cancellationToken, Func<EventArgs> getEventData, Func<string, CancellationToken, Func<EventArgs>, Task> signal)
{
using (Extensions.NoSynchronizationContext)
using (NoSynchronizationContext)
{
var eventData = EventDataConverter.ConvertFrom(getEventData());
var request = eventData?.RequestMessage as HttpRequestMessage;
Expand All @@ -107,7 +108,7 @@ await signal(Events.Debug, cancellationToken,

private async Task OnResponseCreated(string id, CancellationToken cancellationToken, Func<EventArgs> getEventData, Func<string, CancellationToken, Func<EventArgs>, Task> signal)
{
using (Extensions.NoSynchronizationContext)
using (NoSynchronizationContext)
{
var eventData = EventDataConverter.ConvertFrom(getEventData());
var response = eventData?.ResponseMessage as HttpResponseMessage;
Expand Down Expand Up @@ -138,7 +139,7 @@ await signal(Events.Debug, cancellationToken,

private async Task OnCmdletException(string id, CancellationToken cancellationToken, Func<EventArgs> getEventData, Func<string, CancellationToken, Func<EventArgs>, Task> signal, Exception exception)
{
using (Extensions.NoSynchronizationContext)
using (NoSynchronizationContext)
{
var eventData = EventDataConverter.ConvertFrom(getEventData());
await signal(Events.Debug, cancellationToken, () => EventFactory.CreateLogEvent($"[{id}]: Received exception with message '{eventData?.Message}'"));
Expand All @@ -147,7 +148,7 @@ private async Task OnCmdletException(string id, CancellationToken cancellationTo

private async Task OnCmdletEndProcessing(string id, CancellationToken cancellationToken, Func<EventArgs> getEventData, Func<string, CancellationToken, Func<EventArgs>, Task> signal, InvocationInfo invocationInfo)
{
using (Extensions.NoSynchronizationContext)
using (NoSynchronizationContext)
{
string[] commandNameSegment = invocationInfo.MyCommand.Name.Split('_');
if (commandNameSegment.Length > 1)
Expand Down
Loading
Loading