Set-CPCCrossRegionDisasterRecovery
SYNOPSIS
Configures cross-region disaster recovery settings on a Cloud PC User Settings Policy
SYNTAX
Set-CPCCrossRegionDisasterRecovery [-Name] <String> [-DisasterRecoveryType] <String>
[[-MaintainCrossRegionRestorePointEnabled] <Boolean>] [[-UserInitiatedDisasterRecoveryAllowed] <Boolean>]
[[-RegionName] <String>] [[-RegionGroup] <String>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
[<CommonParameters>]
DESCRIPTION
The function configures cross-region disaster recovery settings on an existing Cloud PC User Settings Policy. Disaster recovery ensures Cloud PCs can be provisioned in an alternate Azure region when the primary region is unavailable.
Supported disaster recovery types:
- notConfigured : Disaster recovery is disabled (default)
- crossRegion : Cross-region DR - Windows 365 provisions a standby Cloud PC in the specified backup region automatically
- premium : Premium DR - adds user-initiated failover capability on top of cross-region standby
Only the crossRegionDisasterRecoverySetting of the policy is changed, and within it only what you pass: -MaintainCrossRegionRestorePointEnabled and -UserInitiatedDisasterRecoveryAllowed keep their current value when they are not passed. Graph replaces the whole policy on an update, so the cmdlet reads the current policy and sends all other settings (local admin, reset, restore point settings and so on) back unchanged. Changes someone else makes to the policy between that read and the update are overwritten. The deprecated restorePointSetting frequencyInHours and the retired selfServiceEnabled and notificationSetting are never sent.
crossRegionDisasterRecoveryEnabled is deprecated in the Graph docs, but Graph still rejects a crossRegion setting without it, so it is sent as $true for crossRegion and premium and as $false for notConfigured.
This function requires the Graph API beta endpoint and the CloudPC.ReadWrite.All permission.
EXAMPLES
EXAMPLE 1
Set-CPCCrossRegionDisasterRecovery -Name "UserSettings01" -DisasterRecoveryType crossRegion -RegionName "westus" -RegionGroup "usWest" -MaintainCrossRegionRestorePointEnabled $true
EXAMPLE 2
Set-CPCCrossRegionDisasterRecovery -Name "UserSettings01" -DisasterRecoveryType premium -RegionName "northeurope" -RegionGroup "europeUnion" -MaintainCrossRegionRestorePointEnabled $true -UserInitiatedDisasterRecoveryAllowed $true
EXAMPLE 3
Set-CPCCrossRegionDisasterRecovery -Name "UserSettings01" -DisasterRecoveryType notConfigured
PARAMETERS
-Name
The exact display name of the Cloud PC User Settings Policy to update. The name must match exactly one policy.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-DisasterRecoveryType
The disaster recovery mode to configure. Valid values: notConfigured, crossRegion, premium.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-MaintainCrossRegionRestorePointEnabled
When $true, Windows 365 continuously maintains cross-region restore points that can be used during failover. When $false, only the initial provisioning image is available after a disaster, which may result in data loss. When not passed, the current value of the policy is kept (Graph's default for a new setting is $false).
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-UserInitiatedDisasterRecoveryAllowed
When $true, end users can activate disaster recovery themselves from the Windows 365 portal. Only applicable when DisasterRecoveryType is 'premium'; for the other types it is always sent as $false. When not passed with premium, the current value of the policy is kept (Graph's default for a new setting is $false).
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-RegionName
The Azure region name to use as the disaster recovery target (e.g. 'westus', 'northeurope', 'eastasia'). Required when DisasterRecoveryType is 'crossRegion' or 'premium'.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-RegionGroup
The cloudPcRegionGroup that the disaster recovery region belongs to (e.g. 'usEast', 'usWest', 'europeUnion', 'unitedKingdom', 'asia'). Required when DisasterRecoveryType is 'crossRegion' or 'premium'. The value is passed to Graph as is, so region groups that Microsoft adds later work without a module update; Graph rejects an unknown value. See https://learn.microsoft.com/graph/api/resources/cloudpcregiongroup?view=graph-rest-beta
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by Write-Progress.
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
NOTES
Required permission: CloudPC.ReadWrite.All https://learn.microsoft.com/graph/api/cloudpcusersetting-update?view=graph-rest-beta https://learn.microsoft.com/graph/api/cloudpcusersetting-get?view=graph-rest-beta https://learn.microsoft.com/graph/api/resources/cloudpccrossregiondisasterrecoverysetting?view=graph-rest-beta https://learn.microsoft.com/graph/api/resources/cloudpcregiongroup?view=graph-rest-beta https://learn.microsoft.com/graph/api/resources/cloudpcrestorepointsetting?view=graph-rest-beta