Click or drag to resize

IVssDifferentialSoftwareSnapshotManagementSetVolumeProtectionLevel Method

Sets the shadow copy protection level for an original volume or a shadow copy storage area volume.

Namespace:  Alphaleonis.Win32.Vss
Assembly:  AlphaVSS.Common (in AlphaVSS.Common.dll) Version: (
void SetVolumeProtectionLevel(
	string volumeName,
	VssProtectionLevel protectionLevel


Type: SystemString

The name of the volume. This parameter is required and cannot be .

The name of the volume must be in one of the following formats:

  • The path of a volume mount point with a backslash (\)
  • A drive letter with backslash (\), for example, D:\
  • A unique volume name of the form \\?\Volume{GUID}\ (where GUID is the unique global identifier of the volume) with a backslash (\)

Type: Alphaleonis.Win32.VssVssProtectionLevel
A value from the VssProtectionLevel enumeration that specifies the shadow copy protection level.
UnauthorizedAccessExceptionCaller does not have sufficient backup privileges or is not an administrator.
OutOfMemoryExceptionThe caller is out of memory or other system resources.
ArgumentExceptionOne of the parameter values is not valid.
ArgumentNullExceptionOne of the arguments was
NotImplementedExceptionThe provider for the volume does not support shadow copy protection.
VssProviderVetoExceptionExpected provider error. The provider logged the error in the event log.
VssObjectNotFoundExceptionThe specified volume was not found.

The SetVolumeProtectionLevel(String, VssProtectionLevel) method checks the current shadow copy protection level of the volume. If the volume is in a faulted state and OriginalVolume is specified for the protectionLevel parameter, SetVolumeProtectionLevel(String, VssProtectionLevel) dismounts the volume before setting the protection level.

If the current protection level of the volume is the same as the value of the protectionLevel parameter, SetVolumeProtectionLevel(String, VssProtectionLevel) does nothing.

Note Note

Windows XP, Windows Server 2003 and Windows Vista: This method requires Windows Server 2008.

See Also