Skip to content

Commit 403c594

Browse files
authored
Merge pull request #3048 from microsoftgraph/WeeklyExamplesUpdate/202412060316
[v2] Examples Update
2 parents 734d7a0 + c2c3194 commit 403c594

File tree

10 files changed

+89
-37
lines changed

10 files changed

+89
-37
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: 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+

src/Identity.DirectoryManagement/v1.0/examples/New-MgDirectoryAdministrativeUnit.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Import-Module Microsoft.Graph.Identity.DirectoryManagement
77
$params = @{
88
displayName = "Seattle District Technical Schools"
99
description = "Seattle district technical schools administration"
10+
membershipType = "Dynamic"
11+
membershipRule = "(user.country -eq "United States")"
12+
membershipRuleProcessingState = "On"
1013
visibility = "HiddenMembership"
1114
}
1215

src/Identity.DirectoryManagement/v1.0/examples/Update-MgDirectoryAdministrativeUnit.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
Import-Module Microsoft.Graph.Identity.DirectoryManagement
66
77
$params = @{
8-
displayName = "Greater Seattle District Technical Schools"
8+
displayName = "Executive Division"
9+
membershipType = "Dynamic"
10+
membershipRule = "(user.country -eq "United States")"
11+
membershipRuleProcessingState = "On"
912
}
1013
1114
Update-MgDirectoryAdministrativeUnit -AdministrativeUnitId $administrativeUnitId -BodyParameter $params

src/Identity.Governance/beta/examples/New-MgBetaEntitlementManagementConnectedOrganization.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Example 1: Code snippet
1+
### Example 1: Create a connected organization
22

33
```powershell
44
@@ -20,5 +20,29 @@ $params = @{
2020
New-MgBetaEntitlementManagementConnectedOrganization -BodyParameter $params
2121
2222
```
23-
This example shows how to use the New-MgBetaEntitlementManagementConnectedOrganization Cmdlet.
23+
This example will create a connected organization
24+
25+
### Example 2: Create a connected organization with an identitySource based on a tenant ID
26+
27+
```powershell
28+
29+
Import-Module Microsoft.Graph.Beta.Identity.Governance
30+
31+
$params = @{
32+
displayName = "Connected organization name"
33+
description = "Connected organization description"
34+
identitySources = @(
35+
@{
36+
"@odata.type" = "#microsoft.graph.azureActiveDirectoryTenant"
37+
displayName = "Contoso"
38+
tenantId = "aaaabbbb-0000-cccc-1111-dddd2222eeee"
39+
}
40+
)
41+
state = "proposed"
42+
}
43+
44+
New-MgBetaEntitlementManagementConnectedOrganization -BodyParameter $params
45+
46+
```
47+
This example will create a connected organization with an identitysource based on a tenant id
2448

src/Identity.Governance/v1.0/examples/New-MgEntitlementManagementConnectedOrganization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Example 1: Code snippet
1+
### Example 1: Create a connected organization
22

33
```powershell
44
@@ -20,5 +20,5 @@ $params = @{
2020
New-MgEntitlementManagementConnectedOrganization -BodyParameter $params
2121
2222
```
23-
This example shows how to use the New-MgEntitlementManagementConnectedOrganization Cmdlet.
23+
This example will create a connected organization
2424

src/Identity.SignIns/beta/examples/New-MgBetaPolicyAppManagementPolicy.md

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,52 +12,43 @@ $params = @{
1212
passwordCredentials = @(
1313
@{
1414
restrictionType = "passwordAddition"
15+
state = "enabled"
1516
maxLifetime = $null
1617
restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2019-10-19T10:37:00Z")
1718
}
1819
@{
1920
restrictionType = "passwordLifetime"
21+
state = "enabled"
2022
maxLifetime = "P90D"
2123
restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2014-10-19T10:37:00Z")
2224
}
2325
@{
2426
restrictionType = "symmetricKeyAddition"
27+
state = "enabled"
2528
maxLifetime = $null
2629
restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2019-10-19T10:37:00Z")
2730
}
2831
@{
2932
restrictionType = "symmetricKeyLifetime"
30-
maxLifetime = "P30D"
33+
state = "enabled"
34+
maxLifetime = "P90D"
3135
restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2014-10-19T10:37:00Z")
3236
}
3337
)
3438
keyCredentials = @(
35-
@{
36-
restrictionType = "asymmetricKeyLifetime"
37-
maxLifetime = "P90D"
38-
restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2014-10-19T10:37:00Z")
39-
}
40-
@{
41-
restrictionType = "trustedCertificateAuthority"
42-
restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2019-10-19T10:37:00Z")
43-
certificateBasedApplicationConfigurationIds = @(
44-
"eec5ba11-2fc0-4113-83a2-ed986ed13743"
45-
"bb8e164b-f9ed-4b98-bc45-65eddc14f4c1"
4639
)
47-
maxLifetime = $null
48-
}
49-
)
50-
applicationRestrictions = @{
51-
identifierUris = @{
52-
nonDefaultUriAddition = @{
53-
restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2024-01-01T10:37:00Z")
54-
excludeAppsReceivingV2Tokens = $true
55-
excludeSaml = $true
40+
applicationRestrictions = @{
41+
identifierUris = @{
42+
nonDefaultUriAddition = @{
43+
state = "disabled"
44+
restrictForAppsCreatedAfterDateTime = $null
45+
excludeAppsReceivingV2Tokens = $true
46+
excludeSaml = $true
47+
}
48+
}
5649
}
5750
}
5851
}
59-
}
60-
}
6152
6253
New-MgBetaPolicyAppManagementPolicy -BodyParameter $params
6354

src/Identity.SignIns/v1.0/examples/New-MgPolicyAppManagementPolicy.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,41 @@ $params = @{
1212
passwordCredentials = @(
1313
@{
1414
restrictionType = "passwordAddition"
15+
state = "enabled"
1516
maxLifetime = $null
1617
restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2019-10-19T10:37:00Z")
1718
}
1819
@{
1920
restrictionType = "passwordLifetime"
20-
maxLifetime = "P4DT12H30M5S"
21+
state = "enabled"
22+
maxLifetime = "P90D"
2123
restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2014-10-19T10:37:00Z")
2224
}
2325
@{
2426
restrictionType = "symmetricKeyAddition"
27+
state = "enabled"
2528
maxLifetime = $null
2629
restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2019-10-19T10:37:00Z")
2730
}
2831
@{
2932
restrictionType = "symmetricKeyLifetime"
30-
maxLifetime = "P4D"
33+
state = "enabled"
34+
maxLifetime = "P90D"
3135
restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2014-10-19T10:37:00Z")
3236
}
3337
)
3438
keyCredentials = @(
35-
@{
36-
restrictionType = "asymmetricKeyLifetime"
37-
maxLifetime = "P90D"
38-
restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2014-10-19T10:37:00Z")
39-
}
4039
)
40+
applicationRestrictions = @{
41+
identifierUris = @{
42+
nonDefaultUriAddition = @{
43+
state = "disabled"
44+
restrictForAppsCreatedAfterDateTime = $null
45+
excludeAppsReceivingV2Tokens = $true
46+
excludeSaml = $true
47+
}
48+
}
49+
}
4150
}
4251
}
4352

src/Security/beta/examples/New-MgBetaSecurityAttackSimulation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ endUserNotificationSetting = @{
3030
settingType = "noTraining"
3131
positiveReinforcement = @{
3232
deliveryPreference = "deliverAfterCampaignEnd"
33-
endUserNotification = "https://graph.microsoft.com/beta/security/attacksimulation/endUserNotifications/1ewer3678-9abc-def0-123456789a"
33+
"endUserNotification@odata.bind" = "https://graph.microsoft.com/beta/security/attacksimulation/endUserNotifications/1ewer3678-9abc-def0-123456789a"
3434
defaultLanguage = "en"
3535
}
3636
simulationNotification = @{

src/Security/v1.0/examples/New-MgSecurityAttackSimulation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ endUserNotificationSetting = @{
3030
settingType = "noTraining"
3131
positiveReinforcement = @{
3232
deliveryPreference = "deliverAfterCampaignEnd"
33-
endUserNotification = "https://graph.microsoft.com/v1.0/security/attacksimulation/endUserNotifications/1ewer3678-9abc-def0-123456789a"
33+
"endUserNotification@odata.bind" = "https://graph.microsoft.com/v1.0/security/attacksimulation/endUserNotifications/1ewer3678-9abc-def0-123456789a"
3434
defaultLanguage = "en"
3535
}
3636
simulationNotification = @{

0 commit comments

Comments
 (0)