Citrix Virtual Apps and Desktops SDK

Find-ProvVmBackup

Introduced in: Citrix Virtual Apps and Desktop 7 2603

Retrieves the Backup Closest to the Search Time provided

Syntax

Find-ProvVmBackup
    [-MaxRecordCount <Int32>]
    [-Skip <Int32>]
    -SearchTimeInUTC <DateTime>
    [-ProvisioningSchemeName <String>]
    [-ProvisioningSchemeUid <Guid>]
    [-VMNames <String[]>]
    [-AllVMs]
    -SearchTimeCriteria <TimeCriteria>
    [-LoggingId <Guid>]
    [-SkipCertificateValidation]
    [<CitrixCommonParameters>]
    [<CommonParameters>]
<!--NeedCopy-->

Description

Specific commandlet to retrieve the backup closest to the search time provided for a Provisioned VM.

Examples

EXAMPLE 1

Returns the first closest backup for machine1 to the searchtime

Find-ProvVmBackup -SearchTimeInUTC $dt -SearchTimeCriteria Closest -ProvisioningSchemeName provScheme -MachineNames machine1


CreationDateTime           : 12/22/2025 8:38:41 AM
ADAccountSid               : SID1
BackupDescription          : Nightly backup after patching
BackupName                 : My Second Backup1
BackupStatus               : 0
BackupUid                  : 6fc07d9a-2a73-440c-a084-6ffcac268b45
BackupVersion              : 2
CreationUTCDateTime        : 12/22/2025 8:38:41 PM
HypervisorId               : 1
ParentBackupUid            :
ProvVMConfigurationVersion :
ProvisioningSchemeName     :
ProvisioningSchemeUid      : 5f7738a0-bc0c-4ac1-b599-76e8df9b910d
ProvisioningSchemeVersion  : 1
ScheduleId                 :
UserVisible                : True
VMId                       : HypSim:5
VMName                     : machine1
<!--NeedCopy-->

EXAMPLE 2

Returns the first closest backup for all machines after the searchtime

Find-ProvVmBackup -SearchTimeInUTC $dt -SearchTimeCriteria ClosestAfter -ProvisioningSchemeName provScheme -AllVMs


CreationDateTime           : 12/22/2025 4:39:28 AM
ADAccountSid               : SID12
BackupDescription          : Nightly backup after patching
BackupName                 : My Second Backup12
BackupStatus               : 0
BackupUid                  : a3a4231c-1888-4a16-80a4-0eaae4aff6ee
BackupVersion              : 2
CreationUTCDateTime        : 12/22/2025 4:39:28 PM
HypervisorId               : 1
ParentBackupUid            :
ProvVMConfigurationVersion :
ProvisioningSchemeName     :
ProvisioningSchemeUid      : 5f7738a0-bc0c-4ac1-b599-76e8df9b910d
ProvisioningSchemeVersion  : 1
ScheduleId                 :
UserVisible                : True
VMId                       : HypSim:16
VMName                     : machine12

CreationDateTime           : 12/22/2025 5:18:17 AM
ADAccountSid               : SID13
BackupDescription          : Nightly backup before patching
BackupName                 : My First Backup13
BackupStatus               : 0
BackupUid                  : 08493a62-28fc-4ee7-aace-28d56ac74d5d
BackupVersion              : 1
CreationUTCDateTime        : 12/22/2025 5:18:17 PM
HypervisorId               : 1
ParentBackupUid            :
ProvVMConfigurationVersion :
ProvisioningSchemeName     :
ProvisioningSchemeUid      : 5f7738a0-bc0c-4ac1-b599-76e8df9b910d
ProvisioningSchemeVersion  : 1
ScheduleId                 :
UserVisible                : True
VMId                       : HypSim:17
VMName                     : machine13
<!--NeedCopy-->

Parameters

-SearchTimeInUTC

Specifies the time for the backup search

Type: DateTime
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-SearchTimeCriteria

Specifies the Search time criteria

Type: TimeCriteria
Accepted values: ClosestBefore, ClosestAfter, Closest
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-MaxRecordCount

The maximum number of items to return for the given call of the cmdlet. The default is to return 250 items.

Type: Int32
Position: Named
Default value: 1
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-Skip

This parameter allows to retrieve backups in batches larger than 250 items by specifying how many items to skip (offset) before returning results.

Type: Int32
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-ProvisioningSchemeName

Indicates the Name of the ProvisioningScheme

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-ProvisioningSchemeUid

Indicates the Uid of the ProvisioningScheme

Type: Guid
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-VMNames

An array of virtual machine names to which the backup has to be retrieved

Type: String[]
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-AllVMs

Indicate that all virtual machines in the prov scheme has to be considered for backup search

Type: SwitchParameter
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-LoggingId

Specifies the identifier of the high-level operation this cmdlet call forms a part of. Citrix Studio and Director typically create high-level operations. PowerShell scripts can also wrap a series of cmdlet calls in a high-level operation by way of the Start-LogHighLevelOperation and Stop-LogHighLevelOperation cmdlets.

Type: Guid
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-SkipCertificateValidation

Forces the cmdlet to skip checking SSL certificates. By default, the cmdlet will check the certificate from the server. If the certificate is not valid, the cmdlet will not connect to the server.

Type: SwitchParameter
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

CitrixCommonParameters

This cmdlet supports the common Citrix parameters: -AdminAddress, -AdminClientIP, -BearerToken, -TraceParent, -TraceState and -VirtualSiteId. For more information, see about_CitrixCommonParameters.

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

None

You can’t pipe objects to this cmdlet.

Outputs

None

By default, this cmdlet returns no output.

Find-ProvVmBackup