Please upgrade your web browser now. Internet Explorer 6 is no longer supported.
Zac Smith
SharePoint, WSS and MOSS development.
When developing apps in SharePoint that use the GAC for assemblies, you constantly need to be resetting/recycling IIS.
 
If like me you prefer to recycle your application pools rather than reset all of IIS you probably do this in a script all the time:
 
cscript c:\windows\system32\iisapp.vbs /a "MOSSAppPool" /r
 
Now that I have moved my dev environments to Server 2008 I am using IIS 7.0 and there is a new recycle script:
 
c:\windows\system32\inetsrv\appcmd.exe recycle APPPOOL "MOSSAppPool"
Categories:

Just posting a quick script for updating all 'Pages' libraries to have approval turned on. To create the script use a console app and add references to Microsoft.SharePoint.dll and Microsoft.SharePoint.Publishing.dll. Enjoy!

// get site collection url
if (args.Length != 1)

    Console.WriteLine("Please supply a site collection URL"); 
    return;
}

string siteName = args[0];  

// iterate through each sub site
SPSite site = new SPSite(siteName);
foreach (SPWeb web in site.AllWebs)

    // look for a pages lib 
    PublishingWeb pubWeb = PublishingWeb.GetPublishingWeb(web);
    try 
   
        // turn on approval 
        SPList pages = pubWeb.PagesList; 
        pages.EnableModeration = true
        pages.Update(); 
        Console.WriteLine("Updated site: {0}" , web.Title); 
   
    // ignore errors that occur if not a publshing site 
    catch { continue; }
}
Console.WriteLine("Finished ...");

Categories: