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!

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!