Paul Lee

Sharepoint bumps and bruises

  Home  |   Contact  |   Syndication    |   Login
  11 Posts | 0 Stories | 7 Comments | 0 Trackbacks

News

Archives

Post Categories

Friday, May 01, 2009 #

I have been involved in a huge public folder migration project for my company. One particular folder I migrated had a hierarchy of 1500 subfolders. The migration tool was nice enough to migrate the permissions for me for each folder into sharepoint. Cool, right? Yes until my manager told me he just wanted to manage the parent folder in sharepoint and have the subfolders inherit everything.  There is nothing in sharepoint out-of-the-box that lets you do this in one shot.  Now there are probably many 3rd party sharepoint admin tools that will do this.  But here is the poor man's way.  Simple IronPython script.

import clr

clr.AddReference("Microsoft.SharePoint")
from Microsoft.SharePoint import SPSite

siteurl = '<url to site>'
url= '<url to doclib>'

site = SPSite(siteurl)
web = site.OpenWeb()

docLib = web.GetList(url)

myfolders = docLib.Folders

for furl in myfolders:
    furl.ResetRoleInheritance()

That's it!  Took me only 10 minutes to write...without knowing much about the sharepoint API.  The first 3 lines is the key here that lets you hook into the .NET framework and the sharepoint API. 

Please read my original post for a guide on installing (if you can call it that) IronPython. 

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Here's the error from one of my users:

The list is displayed in Standard view. It cannot be displayed in Datasheet view for one or more of the following reasons: A datasheet component compatible with Windows SharePoint Services is not installed, your browser does not support ActiveX controls, or support for ActiveX controls is disabled.

This just started happening this week.  Only for one user.  No recent patches on the sharepoint server.

If you search this on the internet, you get tons of results but nothing simple.  I went through this good article, http://www.sharepointblogs.com/wsspectacular/archive/2008/04/14/when-datasheets-go-bad.aspx but nothing worked.  Frustrating....

Then a local IT guy asked me if I tried clearing the Internet Explorer cache.  Tried it and it worked!!!

Lesson: Try clearing the IE cache first before trying all the other stuff.  May save you alot of time.

Server environment:  WSS 2.0, server 2003

Client environment: XP, Office 2003

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati