Click or drag to resize
IVssBackupComponentsQuerySnapshots Method
The QuerySnapshots method queries the completed shadow copies in the system that reside in the current context. The method can be called only during backup operations.

Namespace: Alphaleonis.Win32.Vss
Assembly: AlphaVSS.Common (in AlphaVSS.Common.dll) Version: (
IEnumerable<VssSnapshotProperties> QuerySnapshots()

Return Value

Type: IEnumerableVssSnapshotProperties
A list of VssSnapshotProperties objects representing the requested information.
ArgumentExceptionOne of the parameter values is not valid.
UnauthorizedAccessExceptionThe caller is not an administrator or a backup operator.
OutOfMemoryExceptionOut of memory or other system resources.
SystemExceptionUnexpected VSS system error. The error code is logged in the event log.
VssBadStateExceptionThe backup components object is not initialized, this method has been called during a restore operation, or this method has not been called within the correct sequence.
VssObjectNotFoundExceptionThe queried object is not found.
VssProviderVetoExceptionExpected provider error. The provider logged the error in the event log.
VssUnexpectedProviderErrorExceptionUnexpected provider error. The error code is logged in the error log.

Because QuerySnapshots returns only information on completed shadow copies, the only shadow copy state it can disclose is Created.

The method may be called only during backup operations and must be preceded by calls to InitializeForBackup(String) and SetContext Overload.

The method will return only information about shadow copies with the current context (set by SetContext Overload). For instance, if the VssSnapshotContext context is set to Backup, QuerySnapshots will not return information on a shadow copy created with a context of FileShareBackup.

See Also