powershell - Sharepoint error: Enable-SPFeature : The security validation for this page is invalid -
when try deploy project via powershell, ps proceed "enable-spfeature" operation, prints error message below:
enable-spfeature : security validation page invalid. click in web browser, refresh page, , try operation again. @ e:\demo\demoproject\demoproject\scripts\utility.ps1:315 char:19 + enable-spfeature <<<< -identity $id -url $url -confirm:$false + categoryinfo : invaliddata: (microsoft.share...etenablefeature:spcmdletenablefeature) [enable-spfeature], spexception + fullyqualifiederrorid : microsoft.sharepoint.powershell.spcmdletenablefeature
can provide solution?
whenever update list item, list or spweb instance may "the security validation page invalid. click in web browser, refresh page, , try operation again". because of security validation while updating modification content database, so, in order escape exception have make allowunsafeupdates property of spweb instance true.
spweb oweb = new spweb(); oweb.allowunsafeupdates = true; allowunsafeupdates property used gets or sets boolean value specifies whether allow updates database result of request or without requiring security validation. spsite class has property.
Comments
Post a Comment