Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies the policy to the site.
Namespace: Microsoft.SharePoint.Client.InformationPolicy
Assembly: Microsoft.Office.Client.Policy (in Microsoft.Office.Client.Policy.dll)
Syntax
'Declaration
Public Shared Sub ApplyProjectPolicy ( _
context As ClientRuntimeContext, _
web As Web, _
projectPolicy As ProjectPolicy _
)
'Usage
Dim context As ClientRuntimeContext
Dim web As Web
Dim projectPolicy As ProjectPolicyProjectPolicy.ApplyProjectPolicy(context, _
web, projectPolicy)
public static void ApplyProjectPolicy(
ClientRuntimeContext context,
Web web,
ProjectPolicy projectPolicy
)
Parameters
- context
Type: Microsoft.SharePoint.Client.ClientRuntimeContext
web
Type: Microsoft.SharePoint.Client.WebThe site that will have the policy to be applied.
projectPolicy
Type: Microsoft.SharePoint.Client.InformationPolicy.ProjectPolicyThe policy that will be applied to the site.
Exceptions
| Exception | Condition |
|---|---|
| ArgumentNullException | The web parameter or projectPolicy parameter is a null reference (Nothing in Visual Basic). |
Remarks
The policy must exist in the current site collection. If the site already has a policy applied, the new policy will replace the existing one.