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!