Skip to main content

New-CloudPCSnapshot

Creates restore point snapshots for one or more Windows 365 Cloud PCs.

Description

Calls the Microsoft Graph beta /deviceManagement/virtualEndpoint/cloudPCs/{id}/createSnapshot action. Graph returns 204 No Content when the asynchronous snapshot request is accepted.

Targets can be a single Cloud PC object, a Cloud PC ID, a friendly Cloud PC name, all Cloud PCs in the tenant, all Cloud PCs assigned to a user, or all Cloud PCs associated with a provisioning policy.

The cmdlet emits one WindowsCloudPC.SnapshotRequestResult row per target so batch runs show exactly which Cloud PCs were invoked.

Syntax


New-CloudPCSnapshot -CloudPC <Object> [-StorageAccountId <string>] [-AccessTier <string>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

New-CloudPCSnapshot -Id <string> [-StorageAccountId <string>] [-AccessTier <string>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

New-CloudPCSnapshot -All [-ExcludeCloudPC <string[]>] [-StorageAccountId <string>] [-AccessTier <string>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

New-CloudPCSnapshot -User <string> [-ExcludeCloudPC <string[]>] [-StorageAccountId <string>] [-AccessTier <string>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

New-CloudPCSnapshot -ProvisioningPolicyId <string> [-ExcludeCloudPC <string[]>] [-StorageAccountId <string>] [-AccessTier <string>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters

NameTypeRequiredAliasesDescription
AccessTierStringNoOptional blob access tier: hot, cool, cold, archive, or unknownFutureValue.
AllSwitchParameterYesCreates snapshots for every Cloud PC returned by Get-CloudPC.
CloudPCObjectYesA WindowsCloudPC.CloudPC object returned by Get-CloudPC, or a Cloud PC friendly name.
Accepts pipeline input.
ExcludeCloudPCString[]NoExclude, ExcludeId, ExcludeNameCloud PCs to skip. Match values against Cloud PC Id, Name, ManagedDeviceId,
AadDeviceId, or AssignedUserUpn.
ForceSwitchParameterNoSuppress confirmation prompts. Equivalent to -Confirm:$false.
IdStringYesCloudPcIdThe Cloud PC ID when you do not have a CloudPC object available.
ProvisioningPolicyIdStringYesPolicyIdCreates snapshots for Cloud PCs associated with a provisioning policy.
StorageAccountIdStringNoOptional storage account ID that receives the restore point.
UserStringYesUserPrincipalName, UPNCreates snapshots for Cloud PCs returned by Get-CloudPC -UserPrincipalName.

Graph endpoints

/beta/deviceManagement/virtualEndpoint/cloudPCs/{id}/createSnapshot

Example 1

New-CloudPCSnapshot -CloudPC 'CFD-Vance-XS4KT' -Force

Creates a snapshot for one Cloud PC by friendly name.

Example 2

New-CloudPCSnapshot -User 'user@contoso.com' -Force

Creates snapshots for every Cloud PC assigned to the user.

Example 3

New-CloudPCSnapshot -ProvisioningPolicyId '<policy-id>' -ExcludeCloudPC 'CPC-KEEP-01','user2@contoso.com' -Force

Creates snapshots for every Cloud PC in the provisioning policy except the excluded targets.

Example 4

New-CloudPCSnapshot -All -WhatIf

Shows every Cloud PC that would receive a snapshot without sending requests.

Source

View New-CloudPCSnapshot.ps1 on GitHub