If you are in the Nashville, TN, USA area and would like to hear wonderful SharePoint presentations, FREE! food, and great discussions with like-minded people, then come join us! The meetings are always free and open to the public.
Information concerning the Nashville SharePoint Users Group can be found here: http://NashvilleSUG.com
The Nashville SUG website also has copies of the presentations given in the past. Some of the topics include:
-> Upgrading SPS 2003 Areas and Portals to MOSS 2007
-> Certification Options for SharePoint Professionals
-> Using K2 and MOSS for MOF
-> Free Tools for SharePoint 2007 and WSS 3.0
-> SharePoint Backup and Recovery along with Best practices for My Sites
-> A Practical Approach to SharePoint Content Management
-> …plus lots more!
Recently I came across multiple WSS sites (v3) that someone else created. These sites are used by everyone in the company and were not provisioned correctly; the permissions were incorrectly setup.
So, instead of visiting every site and adding the appropriate permissions, I created a batch file that went through the sites and added several SharePoint groups and individual users to the sites in different roles.
The stsadm operation I used was ‘userrole’. The syntax of the userrole operation is as follows:
stsadm –o userrole –url <full url> –userlogin <domain\user or SharePoint group> –role <role, such as Contribute or “Full Control”>
I created the script in Excel so I could put it together rather quickly. I created three (3) columns in a new Worksheet.
-> The first column [A] was for the full URL of the sites
-> Second column [B] was for the following function: =”stsadm –o userrole –url “&A2&” –userlogin “&C2&”<SharePoint group name or domain\user>”&C2&” –role “&C2&”<intended role>”&C2
-> The third column [C] holds a double quote mark – “ (this is done so I can enter the “ symbol in the outputted text, but not within the function. The quote is needed in the output text because your SharePoint group or role may have spaces in the names)
For example, one of my cells in the [B] column looked like this:
=”stsadm –o userrole –url “&A2&” –userlogin “&C2&”SharePoint Members”&C2&” –role “&C2&”Contribute”&C2
The output text looked like this: stsadm –o userrole –url http://sharepoint/site1 –userlogin “SharePoint Members” –role “Contribute”
I then logged into the Windows 2008 SharePoint front-end server as a SharePoint Farm Administrator and copied all the text in the [B] column to a text file and named it permissions.cmd. I ran the file as an administrator (making sure the current directory was the ‘12 hive’ where the stsadm.exe resided) and after a few moments, all was well with the permissions.
You can also use the userrole operation to remove permissions by adding the –delete switch. For more information on the userrole option, type stsadm –help userrole