Paul Lee

Sharepoint bumps and bruises

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

News

Archives

Post Categories

Wednesday, April 29, 2009 #

For those of us who want to start programming sharepoint but get intimidated by the extensive setup needed to begin with C# and visual studio, IronPython is for you.  Frankly, I have been too lazy to take on the task of installing and configuring visual studio on a VM with MOSS.

My background(many moons ago) is java development. I'm not a python expert. Nor am I a sharepoint programming expert. I may not even be considered a java expert anymore. And I'm definitely not a C# or .NET guy. I'm writing about iron python because it has been so easy for me to bang out useful scripts without having to get into the complexities(at least for me) of Visual Studio and .NET.

For the C# or python developers, you will probably laugh at the code I will be posting. My intention here is to show how easy it is write a script to do something useful.  Hopefully my code will get better as I learn more. 

Also, just to be clear, you will not be creating huge sharepoint programs or features with iron python. To do that, you will still need visual studio and C#.

So what is IronPython good for? I have been able to create scripts that do basic administrative tasks that sharepoint doesn't provide out-of-the-box.  I know there are many other vendor tools out there that fill in these administrative gaps of sharepoint but my company is not spending any money these days. 

Here's how to get started:

- download IronPython on your MOSS (dev or uat) server- The zipped version will do.  I think if you use 2.0 and up, you will need the latest version of .NET which is not required for MOSS.  I am using 1.1.2 because of this.  Yes, I'm lazy...

- Just unzip the folder somewhere and you're done.  You can test it by double clicking ipy.exe. 

Type:

    print "Hello World"

That's it!  You've just installed and written the defacto Hello world program.  Easy right?  It gets better.  I'll begin posting all the scripts I've written using the sharepoint API and explaining how easy it was to write it.  Stay tuned...

For those of you that want to get more technical with IronPython or just Python, here are some links:

www.python.org - Official Python site. 

http://ironpython.codeplex.com/ - Official IronPython site.

http://www.diveintopython.org/ - Good free Python book. 

Be sure to have the API's handy.
WSS - http://msdn.microsoft.com/en-us/library/ms441339.aspx

MOSS - http://msdn.microsoft.com/en-us/library/ms550992.aspx

 

 

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

If you use:

     stsadm -o createsite [required fields] -sitetemplate STS#0

to create your site collections, the default groups are missing (Owners, Visitors, Members). 

If you create your site collections without the -sitetemplate option, when you first visit the site, you get a page to choose a site template followed by a page to to setup the default groups for the site.  Nice.

If you're like me, you create 50 sites with the -sitetemplate option before figuring out there are no default groups.... 

So what I figured out was that you can paste this to your groupless site collection url:

       /_layouts/permsetup.aspx

This will get you to the default group creation page.  Just click OK.  Hopes this helps someone.

My environment: MOSS with Feb CU on server 2003.

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