Skip to content

[v2] Examples Update #3282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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 shows how to use the Get-MgBetaServicePrincipalSynchronizationTemplate Cmdlet.

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

```powershell

Import-Module Microsoft.Graph.Applications

Get-MgServicePrincipalSynchronizationTemplate -ServicePrincipalId $servicePrincipalId

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

Original file line number Diff line number Diff line change
Expand Up @@ -5,111 +5,53 @@
Import-Module Microsoft.Graph.Beta.BusinessScenario

$params = @{
"@odata.type" = "#microsoft.graph.plannerTaskConfiguration"
editPolicy = @{
rules = @(
@{
defaultRule = "block"
role = @{
userType = @{
"@odata.type" = "#microsoft.graph.plannerRelationshipBasedUserType"
roleKind = "relationship"
selectionKind = "relationship"
role = "defaultRules"
}
defaultRule = "block"
propertyRule = @{
percentComplete = @(
"allow"
)
ruleKind = "taskRule"
assignments = @{
ruleKind = "taskRule"
references = @{
defaultRules = @(
"allow"
)
overrides = @(
)
}
checkLists = @{
defaultRules = @(
"addSelf"
"allow"
)
overrides = @(
)
}
assignments = @{
defaultRules = @(
"allow"
)
overrides = @(
@{
name = "userCreated"
rules = @(
"allow"
)
}
@{
name = "applicationCreated"
rules = @(
"allow"
)
}
}
@{
defaultRule = "block"
role = @{
"@odata.type" = "#microsoft.graph.plannerRelationshipBasedUserType"
roleKind = "relationship"
role = "taskAssignees"
}
propertyRule = @{
startDate = @(
"allow"
)
dueDate = @(
"allow"
)
percentComplete = @(
"allow"
)
order = @(
"allow"
)
ruleKind = "taskRule"
references = @{
defaultRules = @(
"allow"
)
overrides = @(
@{
name = "userCreated"
rules = @(
"allow"
)
}
@{
name = "applicationCreated"
rules = @(
"block"
)
}
)
}
checkLists = @{
defaultRules = @(
"allow"
)
overrides = @(
@{
name = "userCreated"
rules = @(
"allow"
)
}
@{
name = "applicationCreated"
rules = @(
"check"
)
}
)
}
assignments = @{
defaultRules = @(
"block"
)
overrides = @(
@{
name = "userCreated"
rules = @(
"removeSelf"
)
}
@{
name = "applicationCreated"
rules = @(
"check"
)
}
)
}
appliedCategories = @{
defaultRules = @(
"allow"
defaultRules = @(
"allow"
)
overrides = @(
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Import-Module Microsoft.Graph.DeviceManagement.Administration

$params = @{
"@odata.type" = "#microsoft.graph.roleDefinition"
"@odata.type" = "#microsoft.graph.deviceAndAppManagementRoleDefinition"
displayName = "Display Name value"
description = "Description value"
rolePermissions = @(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ $params = @{
"@odata.type" = "#microsoft.graph.cloudPcProvisioningPolicy"
displayName = "HR provisioning policy"
description = "Provisioning policy for India HR employees"
microsoftManagedDesktop = @{
managedType = "starterManaged"
profile = $null
}
autopatch = @{
autopatchGroupId = "91197a0b-3a74-408d-ba88-bce3fdc4e5eb"
}
}

Update-MgDeviceManagementVirtualEndpointProvisioningPolicy -CloudPcProvisioningPolicyId $cloudPcProvisioningPolicyId -BodyParameter $params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,31 @@
Import-Module Microsoft.Graph.DeviceManagement

$params = @{
"@odata.type" = "#microsoft.graph.windowsPhone81CompliancePolicy"
"@odata.type" = "#microsoft.graph.androidCompliancePolicy"
description = "Description value"
displayName = "Display Name value"
version = 7
passwordBlockSimple = $true
passwordExpirationDays =
passwordRequired = $true
passwordMinimumLength =
passwordRequiredType = "alphabetic"
passwordMinutesOfInactivityBeforeLock =
passwordMinimumCharacterSetCount =
passwordRequiredType = "alphanumeric"
passwordExpirationDays =
passwordPreviousPasswordBlockCount =
passwordRequired = $true
securityPreventInstallAppsFromUnknownSources = $true
securityDisableUsbDebugging = $true
securityRequireVerifyApps = $true
deviceThreatProtectionEnabled = $true
deviceThreatProtectionRequiredSecurityLevel = "secured"
securityBlockJailbrokenDevices = $true
osMinimumVersion = "Os Minimum Version value"
osMaximumVersion = "Os Maximum Version value"
minAndroidSecurityPatchLevel = "Min Android Security Patch Level value"
storageRequireEncryption = $true
securityRequireSafetyNetAttestationBasicIntegrity = $true
securityRequireSafetyNetAttestationCertifiedDevice = $true
securityRequireGooglePlayServices = $true
securityRequireUpToDateSecurityProviders = $true
securityRequireCompanyPortalAppIntegrity = $true
}

New-MgDeviceManagementDeviceCompliancePolicy -BodyParameter $params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,99 +5,12 @@
Import-Module Microsoft.Graph.DeviceManagement

$params = @{
"@odata.type" = "#microsoft.graph.windows10EndpointProtectionConfiguration"
"@odata.type" = "#microsoft.graph.windowsDefenderAdvancedThreatProtectionConfiguration"
description = "Description value"
displayName = "Display Name value"
version = 7
firewallBlockStatefulFTP = $true
firewallIdleTimeoutForSecurityAssociationInSeconds =
firewallPreSharedKeyEncodingMethod = "none"
firewallIPSecExemptionsAllowNeighborDiscovery = $true
firewallIPSecExemptionsAllowICMP = $true
firewallIPSecExemptionsAllowRouterDiscovery = $true
firewallIPSecExemptionsAllowDHCP = $true
firewallCertificateRevocationListCheckMethod = "none"
firewallMergeKeyingModuleSettings = $true
firewallPacketQueueingMethod = "disabled"
firewallProfileDomain = @{
"@odata.type" = "microsoft.graph.windowsFirewallNetworkProfile"
firewallEnabled = "blocked"
stealthModeBlocked = $true
incomingTrafficBlocked = $true
unicastResponsesToMulticastBroadcastsBlocked = $true
inboundNotificationsBlocked = $true
authorizedApplicationRulesFromGroupPolicyMerged = $true
globalPortRulesFromGroupPolicyMerged = $true
connectionSecurityRulesFromGroupPolicyMerged = $true
outboundConnectionsBlocked = $true
inboundConnectionsBlocked = $true
securedPacketExemptionAllowed = $true
policyRulesFromGroupPolicyMerged = $true
}
firewallProfilePublic = @{
"@odata.type" = "microsoft.graph.windowsFirewallNetworkProfile"
firewallEnabled = "blocked"
stealthModeBlocked = $true
incomingTrafficBlocked = $true
unicastResponsesToMulticastBroadcastsBlocked = $true
inboundNotificationsBlocked = $true
authorizedApplicationRulesFromGroupPolicyMerged = $true
globalPortRulesFromGroupPolicyMerged = $true
connectionSecurityRulesFromGroupPolicyMerged = $true
outboundConnectionsBlocked = $true
inboundConnectionsBlocked = $true
securedPacketExemptionAllowed = $true
policyRulesFromGroupPolicyMerged = $true
}
firewallProfilePrivate = @{
"@odata.type" = "microsoft.graph.windowsFirewallNetworkProfile"
firewallEnabled = "blocked"
stealthModeBlocked = $true
incomingTrafficBlocked = $true
unicastResponsesToMulticastBroadcastsBlocked = $true
inboundNotificationsBlocked = $true
authorizedApplicationRulesFromGroupPolicyMerged = $true
globalPortRulesFromGroupPolicyMerged = $true
connectionSecurityRulesFromGroupPolicyMerged = $true
outboundConnectionsBlocked = $true
inboundConnectionsBlocked = $true
securedPacketExemptionAllowed = $true
policyRulesFromGroupPolicyMerged = $true
}
defenderAttackSurfaceReductionExcludedPaths = @(
"Defender Attack Surface Reduction Excluded Paths value"
)
defenderGuardedFoldersAllowedAppPaths = @(
"Defender Guarded Folders Allowed App Paths value"
)
defenderAdditionalGuardedFolders = @(
"Defender Additional Guarded Folders value"
)
defenderExploitProtectionXml = "ZGVmZW5kZXJFeHBsb2l0UHJvdGVjdGlvblhtbA=="
defenderExploitProtectionXmlFileName = "Defender Exploit Protection Xml File Name value"
defenderSecurityCenterBlockExploitProtectionOverride = $true
appLockerApplicationControl = "enforceComponentsAndStoreApps"
smartScreenEnableInShell = $true
smartScreenBlockOverrideForFiles = $true
applicationGuardEnabled = $true
applicationGuardBlockFileTransfer = "blockImageAndTextFile"
applicationGuardBlockNonEnterpriseContent = $true
applicationGuardAllowPersistence = $true
applicationGuardForceAuditing = $true
applicationGuardBlockClipboardSharing = "blockBoth"
applicationGuardAllowPrintToPDF = $true
applicationGuardAllowPrintToXPS = $true
applicationGuardAllowPrintToLocalPrinters = $true
applicationGuardAllowPrintToNetworkPrinters = $true
bitLockerDisableWarningForOtherDiskEncryption = $true
bitLockerEnableStorageCardEncryptionOnMobile = $true
bitLockerEncryptDevice = $true
bitLockerRemovableDrivePolicy = @{
"@odata.type" = "microsoft.graph.bitLockerRemovableDrivePolicy"
encryptionMethod = "aesCbc256"
requireEncryptionForWriteAccess = $true
blockCrossOrganizationWriteAccess = $true
}
allowSampleSharing = $true
enableExpeditedTelemetryReporting = $true
}

New-MgDeviceManagementDeviceConfiguration -BodyParameter $params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,25 @@
Import-Module Microsoft.Graph.DeviceManagement
$params = @{
"@odata.type" = "#microsoft.graph.windowsPhone81CompliancePolicy"
"@odata.type" = "#microsoft.graph.windows10MobileCompliancePolicy"
description = "Description value"
displayName = "Display Name value"
version = 7
passwordRequired = $true
passwordBlockSimple = $true
passwordExpirationDays =
passwordMinimumLength =
passwordMinutesOfInactivityBeforeLock =
passwordMinimumCharacterSetCount =
passwordRequiredType = "alphanumeric"
passwordPreviousPasswordBlockCount =
passwordRequired = $true
passwordExpirationDays =
passwordMinutesOfInactivityBeforeLock =
passwordRequireToUnlockFromIdle = $true
osMinimumVersion = "Os Minimum Version value"
osMaximumVersion = "Os Maximum Version value"
earlyLaunchAntiMalwareDriverEnabled = $true
bitLockerEnabled = $true
secureBootEnabled = $true
codeIntegrityEnabled = $true
storageRequireEncryption = $true
}
Expand Down
Loading
Loading