Share via


ProtectionPolicyManager.IsFileProtectionRequiredAsync Method

Definition

Note

Starting in July 2022, Microsoft is deprecating Windows Information Protection (WIP) and the APIs that support WIP. Microsoft will continue to support WIP on supported versions of Windows. New versions of Windows won't include new capabilities for WIP, and it won't be supported in future versions of Windows. For more information, see Announcing sunset of Windows Information Protection.

For your data protection needs, Microsoft recommends that you use Microsoft Purview Information Protection and Microsoft Purview Data Loss Prevention. Purview simplifies the configuration set-up and provides an advanced set of capabilities.

Indicates whether a file needs to be protected by the enterprise identity.

public:
 static IAsyncOperation<bool> ^ IsFileProtectionRequiredAsync(IStorageItem ^ target, Platform::String ^ identity);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<bool> IsFileProtectionRequiredAsync(IStorageItem const& target, winrt::hstring const& identity);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<bool> IsFileProtectionRequiredAsync(IStorageItem target, string identity);
function isFileProtectionRequiredAsync(target, identity)
Public Shared Function IsFileProtectionRequiredAsync (target As IStorageItem, identity As String) As IAsyncOperation(Of Boolean)

Parameters

target
IStorageItem

The file that you want to know whether to protect.

identity
String

Platform::String

winrt::hstring

The enterprise identity.

Returns

true if the file should be protected, otherwise false.

Attributes

Windows requirements

Device family
Windows Desktop Extension SDK (introduced in 10.0.15063.0)
Windows Mobile Extension SDK (introduced in 10.0.15063.0)
API contract
Windows.Security.EnterpriseData.EnterpriseDataContract (introduced in v4.0)

Remarks

Your code can call this method to avoid encrypting files that don’t need to be encrypted such as exe, dll, and other build artifacts. This lowers the risk of those files being inaccessible to other users of a computer and lowers performance cost for unnecessarily encrypting files.

Applies to