Friday, August 15, 2008

All Authenticated Users Please Stand Up

The availability of collaborative tools as part of MOSS is one of the reasons why SharePoint has become Microsoft's number 1 selling server product of all time. Open the doors and let everyone in to collaborate with your team!

Well, not exactly. Do you really want the entire enterprise to keep an eye on what your team is doing? Furthermore, do you really want to contaminate global search results with your team site's matches for users who have no interest in your site in the first place? The answer is... probably not, depending of course on your enterprise's explicit objectives as they apply to collaboration and sharing.

Large enterprises prefer to keep team information on the need-to-know basis, which is why it is important to prevent team site information from being shared with the entire enterprise, even if by mistake. Which is why it may be desirable to disable "Add all authenticated users" link from the site permissions screen.


To disable this link, we will need to modify the site permissions screen page, which is inconspicuously named AclInv.aspx (located in the server's /Template/Layouts directory on the 12-hive). Prior to making changes, backup the file first!

Open the file in Notepad and find the following snippet of code:

asp:LinkButton id="LinkAddAuthUsers" Text="<%$Resources:wss,permsetup_addauthtitle%>" runat="server" CausesValidation="false" OnClick="LinkAddAuthUsers_Click"

Go ahead and remove this whole line, including the brackets, and save the file. No ISS reset needed for this one. Check that the link is gone by navigating to any site's permissions settings and trying to add a user:


NOTE: You still have the ability to add NT Authority\Authenticated Users to your site, but you actually have to type the entire string into the Users/Groups box. All we have done here was to disable the convenient link. So some smart SharePoint users who read this blog will be able to figure out how to make their sites universally public, but those are usually the exception, not the norm, in any organization.

Since you are already modifying this page... if you ever wondered how to disable the default setting on "Send E-Mail" (Send welcome e-mail to the new users). The checkbox option is checked by default, and oftentimes you end up spamming the new site users whom you've just added to the site with an unintentional system-generated email. To be sure, you can always uncheck the box yourself, but heck, who can honestly say that they remember to do so 100% of the time?

Still with AclInv.aspx file open in your Notepad, find the checkbox control wssawc:InputFormCheckBox, a few lines below you will see text Checked="True" -- change it to "False", and save the file. Refresh the add user page in the browser and notice that the checkbox is no longer checked by default! It a small thing to change, but it makes SharePoint users much happier and reduces the SharePoint spam they receive.

Happy Sharepointin'!

Thursday, August 14, 2008

Hide/Remove "Create Blog" Link on My Site

Customizing MOSS 2007 My Sites is generally a tedious task and should not be approached lightly. Having worked through a number of My Site customization issues with a client only to drop them at the end in favor of a standard My Site template, I can personally vouch that it can (and will) be a painful task.

The grand-daddy of all posts about customizing My Sites is by Steve Peschka - warning, not light reading. Another warning - Steve tells you NOT to customize any of the .aspx pages or onet.xml on the file system for fear of being in unsupported state. He's right, but remember - as long as you backup the original files, you can always revert back to them (and into supported state) at a moment's notice. As a practice, always backup server files before you make any changes to them.

With that said, I recently had to modify the My Site template for a client to remove the "Create Blog" link from the upper right corner of the My Site page. In a non-customized MOSS instance, the tabbed "Create Blog" link appears for any newly created My Site and only goes away after the user has clicked on it and created a blog. Since we did not want users creating blogs, we disabled sub-site creation permission for the entire web application containing My Sites, but that did not remove the link. Removing sub-site creation permission accomplished our goal of preventing users from creating any subsites, including blogs, but the link to create blog did not go away, and when clicked, resulted in an un-friendly error message.

The way to hide this link is to edit the default.aspx file found on the 12-hive under Template/SiteTemplates/SPSPERS directory. Again, before editing this file, make sure you made a backup copy. In default.aspx file, find the following text and remove it completely, including the brackets:

spswc:createblogbutton class="ms-toolbar" id="TBBCreateBlogButton" runat="server" showimageandtext="false"/

Save the file and run the IIS reset command. Presto - the "Create Blog" link is now gone!

Hide "Create Workspace" Checkbox in Calendar Event Item

So for the last 6 months I've been hitting the ground with MOSS 2007 installation of a medium-sized farm for an enterprise with some needs that cannot be met by the OOB SharePoint capabilities. Like it or not, customizations are just a necessary part of life.

An interesting requirement came up, though, with the client wanting to remove the workspace creation checkbox from the new calendar event form - that pesky button that if you check it, will kick off a meeting workspace site.

I found one very useful post by nikool123 here - I suggest you read it before continuing, as it really lays the groundwork and is 50% there. The method described by nikool123 in the article works well for publishing sites, but it does not extend to the team sites and other sites that are not using the MOSS publishing features.

Be aware that since you are modifying files on the server, your changes will be affecting your entire farm (unless you configured the server otherwise). There are actually 3 files that need to be modified in the omnipotent 12-hive directory. Find the following files in the /12/Templates/Features folder:

/12/Tempates/Features/ctypes/ctypeswss.xml
/12/Tempates/Features/fields/fieldswss.xml
/12/Tempates/Features/eventslist/events/schema.xml

Backup the files before making any changes.

Now, each file has 2 places that need to be modified. Add text

ShowInNewForm="FALSE" ShowInEditForm="FALSE" Hidden="TRUE"

within the xml schema corresponding to field IDs {881eac4a-55a5-48b6-a28e-8329d7486120} and {08fc65f9-48eb-4e99-bd61-5946c439e691}

This is guaranteed to remove the pesky "workspace" checkbox universally from Calendars on all your MOSS sites.

Happy Sharepointin'!