From c2c31945f6483bb45c43c984e26d110cf062d36a Mon Sep 17 00:00:00 2001 From: Microsoft Graph DevX Tooling Date: Fri, 6 Dec 2024 05:09:55 +0000 Subject: [PATCH] Updating examples --- ...ServicePrincipalSynchronizationTemplate.md | 11 ++++++ ...ServicePrincipalSynchronizationTemplate.md | 11 ++++++ .../New-MgDirectoryAdministrativeUnit.md | 3 ++ .../Update-MgDirectoryAdministrativeUnit.md | 5 ++- ...itlementManagementConnectedOrganization.md | 28 +++++++++++++- ...itlementManagementConnectedOrganization.md | 4 +- .../New-MgBetaPolicyAppManagementPolicy.md | 37 +++++++------------ .../New-MgPolicyAppManagementPolicy.md | 23 ++++++++---- .../New-MgBetaSecurityAttackSimulation.md | 2 +- .../New-MgSecurityAttackSimulation.md | 2 +- 10 files changed, 89 insertions(+), 37 deletions(-) diff --git a/src/Applications/beta/examples/Get-MgBetaServicePrincipalSynchronizationTemplate.md b/src/Applications/beta/examples/Get-MgBetaServicePrincipalSynchronizationTemplate.md index e69de29bb2d..3f1ed3342cb 100644 --- a/src/Applications/beta/examples/Get-MgBetaServicePrincipalSynchronizationTemplate.md +++ b/src/Applications/beta/examples/Get-MgBetaServicePrincipalSynchronizationTemplate.md @@ -0,0 +1,11 @@ +### Example + +```powershell + +Import-Module Microsoft.Graph.Beta.Applications + +Get-MgBetaServicePrincipalSynchronizationTemplate -ServicePrincipalId $servicePrincipalId + +``` +This example will### example + diff --git a/src/Applications/v1.0/examples/Get-MgServicePrincipalSynchronizationTemplate.md b/src/Applications/v1.0/examples/Get-MgServicePrincipalSynchronizationTemplate.md index e69de29bb2d..5a774ca1e66 100644 --- a/src/Applications/v1.0/examples/Get-MgServicePrincipalSynchronizationTemplate.md +++ b/src/Applications/v1.0/examples/Get-MgServicePrincipalSynchronizationTemplate.md @@ -0,0 +1,11 @@ +### Example + +```powershell + +Import-Module Microsoft.Graph.Applications + +Get-MgServicePrincipalSynchronizationTemplate -ServicePrincipalId $servicePrincipalId + +``` +This example will### example + diff --git a/src/Identity.DirectoryManagement/v1.0/examples/New-MgDirectoryAdministrativeUnit.md b/src/Identity.DirectoryManagement/v1.0/examples/New-MgDirectoryAdministrativeUnit.md index d89e24971c5..bbe965373ad 100644 --- a/src/Identity.DirectoryManagement/v1.0/examples/New-MgDirectoryAdministrativeUnit.md +++ b/src/Identity.DirectoryManagement/v1.0/examples/New-MgDirectoryAdministrativeUnit.md @@ -7,6 +7,9 @@ Import-Module Microsoft.Graph.Identity.DirectoryManagement $params = @{ displayName = "Seattle District Technical Schools" description = "Seattle district technical schools administration" + membershipType = "Dynamic" + membershipRule = "(user.country -eq "United States")" + membershipRuleProcessingState = "On" visibility = "HiddenMembership" } diff --git a/src/Identity.DirectoryManagement/v1.0/examples/Update-MgDirectoryAdministrativeUnit.md b/src/Identity.DirectoryManagement/v1.0/examples/Update-MgDirectoryAdministrativeUnit.md index e6b2c1a1638..6d56e3bfa8d 100644 --- a/src/Identity.DirectoryManagement/v1.0/examples/Update-MgDirectoryAdministrativeUnit.md +++ b/src/Identity.DirectoryManagement/v1.0/examples/Update-MgDirectoryAdministrativeUnit.md @@ -5,7 +5,10 @@ Import-Module Microsoft.Graph.Identity.DirectoryManagement $params = @{ - displayName = "Greater Seattle District Technical Schools" + displayName = "Executive Division" + membershipType = "Dynamic" + membershipRule = "(user.country -eq "United States")" + membershipRuleProcessingState = "On" } Update-MgDirectoryAdministrativeUnit -AdministrativeUnitId $administrativeUnitId -BodyParameter $params diff --git a/src/Identity.Governance/beta/examples/New-MgBetaEntitlementManagementConnectedOrganization.md b/src/Identity.Governance/beta/examples/New-MgBetaEntitlementManagementConnectedOrganization.md index 39a7518bbb3..8980dd2cad2 100644 --- a/src/Identity.Governance/beta/examples/New-MgBetaEntitlementManagementConnectedOrganization.md +++ b/src/Identity.Governance/beta/examples/New-MgBetaEntitlementManagementConnectedOrganization.md @@ -1,4 +1,4 @@ -### Example 1: Code snippet +### Example 1: Create a connected organization ```powershell @@ -20,5 +20,29 @@ $params = @{ New-MgBetaEntitlementManagementConnectedOrganization -BodyParameter $params ``` -This example shows how to use the New-MgBetaEntitlementManagementConnectedOrganization Cmdlet. +This example will create a connected organization + +### Example 2: Create a connected organization with an identitySource based on a tenant ID + +```powershell + +Import-Module Microsoft.Graph.Beta.Identity.Governance + +$params = @{ + displayName = "Connected organization name" + description = "Connected organization description" + identitySources = @( + @{ + "@odata.type" = "#microsoft.graph.azureActiveDirectoryTenant" + displayName = "Contoso" + tenantId = "aaaabbbb-0000-cccc-1111-dddd2222eeee" + } + ) + state = "proposed" +} + +New-MgBetaEntitlementManagementConnectedOrganization -BodyParameter $params + +``` +This example will create a connected organization with an identitysource based on a tenant id diff --git a/src/Identity.Governance/v1.0/examples/New-MgEntitlementManagementConnectedOrganization.md b/src/Identity.Governance/v1.0/examples/New-MgEntitlementManagementConnectedOrganization.md index a5c9f8c2f6e..060a1409ed6 100644 --- a/src/Identity.Governance/v1.0/examples/New-MgEntitlementManagementConnectedOrganization.md +++ b/src/Identity.Governance/v1.0/examples/New-MgEntitlementManagementConnectedOrganization.md @@ -1,4 +1,4 @@ -### Example 1: Code snippet +### Example 1: Create a connected organization ```powershell @@ -20,5 +20,5 @@ $params = @{ New-MgEntitlementManagementConnectedOrganization -BodyParameter $params ``` -This example shows how to use the New-MgEntitlementManagementConnectedOrganization Cmdlet. +This example will create a connected organization diff --git a/src/Identity.SignIns/beta/examples/New-MgBetaPolicyAppManagementPolicy.md b/src/Identity.SignIns/beta/examples/New-MgBetaPolicyAppManagementPolicy.md index 806bbb0fdda..fe5f262a2fd 100644 --- a/src/Identity.SignIns/beta/examples/New-MgBetaPolicyAppManagementPolicy.md +++ b/src/Identity.SignIns/beta/examples/New-MgBetaPolicyAppManagementPolicy.md @@ -12,52 +12,43 @@ $params = @{ passwordCredentials = @( @{ restrictionType = "passwordAddition" + state = "enabled" maxLifetime = $null restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2019-10-19T10:37:00Z") } @{ restrictionType = "passwordLifetime" + state = "enabled" maxLifetime = "P90D" restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2014-10-19T10:37:00Z") } @{ restrictionType = "symmetricKeyAddition" + state = "enabled" maxLifetime = $null restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2019-10-19T10:37:00Z") } @{ restrictionType = "symmetricKeyLifetime" - maxLifetime = "P30D" + state = "enabled" + maxLifetime = "P90D" restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2014-10-19T10:37:00Z") } ) keyCredentials = @( - @{ - restrictionType = "asymmetricKeyLifetime" - maxLifetime = "P90D" - restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2014-10-19T10:37:00Z") - } - @{ - restrictionType = "trustedCertificateAuthority" - restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2019-10-19T10:37:00Z") - certificateBasedApplicationConfigurationIds = @( - "eec5ba11-2fc0-4113-83a2-ed986ed13743" - "bb8e164b-f9ed-4b98-bc45-65eddc14f4c1" ) - maxLifetime = $null - } -) -applicationRestrictions = @{ - identifierUris = @{ - nonDefaultUriAddition = @{ - restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2024-01-01T10:37:00Z") - excludeAppsReceivingV2Tokens = $true - excludeSaml = $true + applicationRestrictions = @{ + identifierUris = @{ + nonDefaultUriAddition = @{ + state = "disabled" + restrictForAppsCreatedAfterDateTime = $null + excludeAppsReceivingV2Tokens = $true + excludeSaml = $true + } + } } } } -} -} New-MgBetaPolicyAppManagementPolicy -BodyParameter $params diff --git a/src/Identity.SignIns/v1.0/examples/New-MgPolicyAppManagementPolicy.md b/src/Identity.SignIns/v1.0/examples/New-MgPolicyAppManagementPolicy.md index a64dcc35dd8..629622ce4e3 100644 --- a/src/Identity.SignIns/v1.0/examples/New-MgPolicyAppManagementPolicy.md +++ b/src/Identity.SignIns/v1.0/examples/New-MgPolicyAppManagementPolicy.md @@ -12,32 +12,41 @@ $params = @{ passwordCredentials = @( @{ restrictionType = "passwordAddition" + state = "enabled" maxLifetime = $null restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2019-10-19T10:37:00Z") } @{ restrictionType = "passwordLifetime" - maxLifetime = "P4DT12H30M5S" + state = "enabled" + maxLifetime = "P90D" restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2014-10-19T10:37:00Z") } @{ restrictionType = "symmetricKeyAddition" + state = "enabled" maxLifetime = $null restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2019-10-19T10:37:00Z") } @{ restrictionType = "symmetricKeyLifetime" - maxLifetime = "P4D" + state = "enabled" + maxLifetime = "P90D" restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2014-10-19T10:37:00Z") } ) keyCredentials = @( - @{ - restrictionType = "asymmetricKeyLifetime" - maxLifetime = "P90D" - restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2014-10-19T10:37:00Z") - } ) + applicationRestrictions = @{ + identifierUris = @{ + nonDefaultUriAddition = @{ + state = "disabled" + restrictForAppsCreatedAfterDateTime = $null + excludeAppsReceivingV2Tokens = $true + excludeSaml = $true + } + } + } } } diff --git a/src/Security/beta/examples/New-MgBetaSecurityAttackSimulation.md b/src/Security/beta/examples/New-MgBetaSecurityAttackSimulation.md index 4f0e0ec5042..df3dffc8ad4 100644 --- a/src/Security/beta/examples/New-MgBetaSecurityAttackSimulation.md +++ b/src/Security/beta/examples/New-MgBetaSecurityAttackSimulation.md @@ -30,7 +30,7 @@ endUserNotificationSetting = @{ settingType = "noTraining" positiveReinforcement = @{ deliveryPreference = "deliverAfterCampaignEnd" - endUserNotification = "https://graph.microsoft.com/beta/security/attacksimulation/endUserNotifications/1ewer3678-9abc-def0-123456789a" + "endUserNotification@odata.bind" = "https://graph.microsoft.com/beta/security/attacksimulation/endUserNotifications/1ewer3678-9abc-def0-123456789a" defaultLanguage = "en" } simulationNotification = @{ diff --git a/src/Security/v1.0/examples/New-MgSecurityAttackSimulation.md b/src/Security/v1.0/examples/New-MgSecurityAttackSimulation.md index 0deb4b15d09..00bfab26077 100644 --- a/src/Security/v1.0/examples/New-MgSecurityAttackSimulation.md +++ b/src/Security/v1.0/examples/New-MgSecurityAttackSimulation.md @@ -30,7 +30,7 @@ endUserNotificationSetting = @{ settingType = "noTraining" positiveReinforcement = @{ deliveryPreference = "deliverAfterCampaignEnd" - endUserNotification = "https://graph.microsoft.com/v1.0/security/attacksimulation/endUserNotifications/1ewer3678-9abc-def0-123456789a" + "endUserNotification@odata.bind" = "https://graph.microsoft.com/v1.0/security/attacksimulation/endUserNotifications/1ewer3678-9abc-def0-123456789a" defaultLanguage = "en" } simulationNotification = @{