Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 7025

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 2162

Deprecated: Hook imagify_allow_picture_tags_for_webp is deprecated since version 2.2! Use imagify_allow_picture_tags_for_nextgen instead. in /www/collab365_296/public/wp-includes/functions.php on line 5758
How to emulate the ViewFormsPagesLockdown feature in SharePoint Foundation 2013 with Powershell - Collab365
Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Warning: Undefined array key "url" in /www/collab365_296/public/wp-content/plugins/thrive-visual-editor/thrive-dashboard/inc/smart-site/classes/class-tvd-smart-shortcodes.php on line 85

2013-12-02

We are just doing the final tweaks before pushing the button on live for SP24conf.com and as part of that I wanted to make sure that anonymous users can’t see form pages. However, one snag is that the If you are running SharePoint Foundation 2013 or don’t want to install the ViewFormsPagesLockdown Feature then you are stuck. However, if you want to do this in Powershell, here we go :

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint");
$siteurl = 'http://www.sp24conf.com';
$site=new-object Microsoft.SharePoint.SPSite[System.String]$siteurl);
$rootWeb = $site.RootWeb;
$guestRole = $rootWeb.RoleDefinitions.GetByType("Guest");
# BEFORE : $guestRole.BasePermissions = "ViewFormPages, Open, BrowseUserInfo, UseClientIntegration, UseRemoteAPIs";
$guestRole.BasePermissions = "Open, BrowseUserInfo, UseClientIntegration";
$guestRole.Update();

# BEFORE : $rootWeb.AnonymousPermMask64 = "ViewListItems, ViewVersions, ViewFormPages, Open, ViewPages, UseClientIntegration"
$rootWeb.AnonymousPermMask64 = "Open, ViewPages, UseClientIntegration, ViewListItems"
$rootWeb.Update();

 

That’s it!

(Visited 58 times, 1 visits today)

About the author 

Mark Jones

Collab365 Founder helping people learn Microsoft 365 via these:

👉 Collab365 Summits - Massive virtual conferences for Microsoft products
👉 Collab365 Today - Aggregation site for the best community blogs
👉 Collab365 Community - Huge blog site including plenty of Microsoft content

I want to provide a friendly online community, where we can learn and grow together:

👉 365ers - coming very soon!

Summit Bundle

Get 200+ hours of Microsoft 365 Training for 27$!

Master Office 365, Power Platform & SharePoint & Teams With 200+ Hours Of Training Videos and 108 Ebooks in the Collab365 Academy. This offer is insane and is only available for a limited period.