Yes, you have been asked this question before haven't you?
"Dear Admin, can you send me a complete list of all the users in the Visitors group of my site collection, because there are so many in them and I am not able to export to Excel......"
Well, I finally got sick of either copy/pasting the info from the People and Groups page or exporting all users using a powershell script, that I took the time to create my own aspx page that will display that directly.
the code for this page looks like this:
<%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>
<%@ Page Language="C#" MasterPageFile="~/_layouts/application.master" Inherits="Microsoft.SharePoint.WebControls.LayoutsPageBase" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<script runat="server">
protected override void OnLoad(EventArgs e) {
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPWeb thisWeb = this.Web)
{
string output = "";
output +="<table style=\"width=100%\">";
foreach (SPGroup group in thisWeb.Groups)
{
output += "<tr><td colspan=\"3\"><strong>" + group.Name + "</strong><td></tr>";
int i = 0;
if (group.Users.Count > 0)
{
foreach (SPUser user in group.Users)
{
i++;
output += "<tr>";
output += "<td>" + user.Name + "</td>";
output += "<td>" + user.Email + "</td>";
output += "<td>" + user.LoginName + "</td>";
output += "</tr>";
}
}
else
output += "<tr><td colspan=\"3\">Group is empty<td></tr>";
output += "<tr><td colspan=\"3\"> <td></tr>";
}
output += "</table>";
lblUsers.Text = output;
}
}
);
}
</script>
<asp:Content ID="Main" runat="server" contentplaceholderid="PlaceHolderMain" >
<p>Site Groups and Users</p>
<asp:Label ID="lblUsers" runat="server" />
</asp:Content>
<asp:Content ID="PageTitle" runat="server" contentplaceholderid="PlaceHolderPageTitle" >
Site Groups and Users
</asp:Content>
<asp:Content ID="PageTitleInTitleArea" runat="server" contentplaceholderid="PlaceHolderPageTitleInTitleArea" >
Site Groups and Users
</asp:Content>
Now save this code into an aspx page and then copy that page to the 12-hive\TEMPLATE\Layouts folder. In my case I named the file Allusers.aspx, so now I f I am in a specific site collection, I can simply call upon the page using _layouts/allusers.aspx and have my listing of all the groups with all the users in a single page.
It is so simple, but never really had the time or desire to create such a page....
Stay tuned on my blog, as I am almost ready with my tool for generating a complete report of a SharePoint farm in a nice html document....
If you ever need to prevent indexing your lists in your MOSS farm by your SSP indexer, then you can achieve this by defining a crawl rule in the SSP > Search Settings > Crawl rules.
Use the following URL for your crawl rule to exclude lists: *://*/lists/*
Evidently you can change it to have a specific list excluded too 
On my post about the SP2 bug, I had a comment by Bert Johnson about a post of his explaining how to recover the SharePoint 2007 Product ID from your system. This is indeed very handy if you do not happen to have it or find it anymore and do not want to bother your customer for it loosing face (again
)
Bert wrote a vbs script that decodes the Product ID from the registry key blob data where it resides.
Thanks Bert for sharing this information, which will probably help a lot of us out there.
Subscribe to Bert's blog with this Feed: http://blogs.pointbridge.com/Blogs/johnson_bert/_layouts/listfeed.aspx?List={071A5AE9-9B1F-44E7-8AF7-C0BC07CF531D}
The original post can be found at http://blogs.pointbridge.com/Blogs/johnson_bert/Pages/Post.aspx?_ID=10 .
Here is the script :
' Extract MOSS 2007 Product ID
' Written by Bert Johnson (PointBridge)
' http://blogs.pointbridge.com/Blogs/johnson_bert/Pages/Post.aspx?_ID=10
Const HKEY_LOCAL_MACHINE = &H80000002
Set reg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
wscript.echo GetKey("SOFTWARE\Microsoft\Office\12.0\Registration\{90120000-110D-0000-0000-0000000FF1CE}", "DigitalProductId")
Public Function GetKey(path, key)
Dim chars(24), prodid
Dim productkey(14)
reg.GetBinaryValue HKEY_LOCAL_MACHINE, path, key, prodid
For ib = 52 To 66
productkey(ib - 52) = prodid(ib)
Next
'Possible characters in the Product ID:
chars(0) = Asc("B")
chars(1) = Asc("C")
chars(2) = Asc("D")
chars(3) = Asc("F")
chars(4) = Asc("G")
chars(5) = Asc("H")
chars(6) = Asc("J")
chars(7) = Asc("K")
chars(8) = Asc("M")
chars(9) = Asc("P")
chars(10) = Asc("Q")
chars(11) = Asc("R")
chars(12) = Asc("T")
chars(13) = Asc("V")
chars(14) = Asc("W")
chars(15) = Asc("X")
chars(16) = Asc("Y")
chars(17) = Asc("2")
chars(18) = Asc("3")
chars(19) = Asc("4")
chars(20) = Asc("6")
chars(21) = Asc("7")
chars(22) = Asc("8")
chars(23) = Asc("9")
For ib = 24 To 0 Step -1
n = 0
For ikb = 14 To 0 Step -1
n = n * 256 Xor productkey(ikb)
productkey(ikb) = Int(n / 24)
n = n Mod 24
Next
sCDKey = Chr(chars(n)) & sCDKey
If ib Mod 5 = 0 And ib <> 0 Then sCDKey = "-" & sCDKey
Next
GetKey = sCDKey
End Function
Simply save that to a file named "ExtractMOSS2007ProductID.vbs" and run it to recover your key. Once recovered, re-apply your Product ID through Central Admin,
as outlined in KB971620.
I was reading trhough my blogroll today and noticed a very complete blog post for deploying SP2 in a large MOSS environment. It describes optimized steps for installing SP2 with lesser downtime as you would have by just installing it. Chris Givens is a SharePoint trainer. His Advanced SharePoint 2007 Operations course looks very interesting. Just a pitty that you have to go all the way to Seattle for it.... For us European trash guys, it is hard to defend that to our manager, right?
So please, read through this post as it may help you with your upgrade of your farm if you have large databases.
This is the original content of Chris's Post that can be found at
http://blogs.architectingconnectedsystems.com/blogs/cjg/archive/2009/05/10/How-to-upgrade-to-SharePoint-2007-SP2-_2D00_-Step-by-Step.aspx
built this lab for the latest update to my Advanced SharePoint Operations course. But I felt like it would benefit the entire community...so here you go! Good luck!
Module #25: Updating The Farm Lab #01
|
Course: SharePoint 2007 Operations
Estimated Time to Complete: 45 minutes
Objectives:
· Upgrade to SP2
Operating Notes:
· You will need sharepoint2007 and svr-sp2 images
· Assumes that you are using SQL Server 2000/2005/2008 for your database server (Not Internal DB engine)
Deliverables:
· None
|
Overview: Learn the steps of preparing your farm for upgrade and then performing the upgrade.
Exercise 1 – Prep the Farm
Purpose: There are a series of recommend steps that will speed up the upgrade of your SharePoint Farm. Following these somewhat simple suggestions will get you through the process much faster! Rebuilding indexes will ensure that the upgrade process will modify the database schemas and records as quick as possible. Truncating the log files will ensure that your backup and restores will run quickly. Detaching
Result: A farm ready for upgrade
Task 1 – Clean up the databases (rebuild indexes)
- Open SQL Server Management Studio
- Connect to your sharepoint database server
- Click “New Query”
- Run (press Atl-X) the following command on each SharePoint database (set the dropdown for each):
- WSS_Content*
- SharePoint_Config*
|
SELECT object_id, index_id, avg_fragmentation_in_percent, page_count FROM sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL , NULL) order by avg_fragmentation_in_percent desc
SET NOCOUNT ON DECLARE @objectid int DECLARE @indexid int DECLARE @command varchar(8000) DECLARE @baseCommand varchar(8000) DECLARE @schemaname sysname DECLARE @objectname sysname DECLARE @indexname sysname DECLARE @currentDdbId int
SELECT @currentDdbId = DB_ID()
PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Starting'
DECLARE indexesToDefrag CURSOR FOR
SELECT i.object_id, i.index_id, i.name FROM sys.indexes AS i INNER JOIN sys.objects AS o ON i.object_id = o.object_id WHERE i.index_id > 0 AND o.type = 'U'
OPEN indexesToDefrag -- Loop through the partitions.
FETCH NEXT FROM indexesToDefrag INTO @objectid, @indexid, @indexname WHILE @@FETCH_STATUS = 0 BEGIN -- Lookup the name of the index SELECT @schemaname = s.name FROM sys.objects AS o JOIN sys.schemas AS s ON s.schema_id = o.schema_id WHERE o.object_id = @objectid
PRINT CONVERT(nvarchar, GETDATE(), 126) + ': ' + @schemaname + '.' + @indexname + ' is now being rebuilt.'
-- Fragmentation is bad enough that it will be more efficient to rebuild the index
SELECT @baseCommand = ' ALTER INDEX ' + @indexname + ' ON ' + @schemaname + '.' + object_name(@objectid) + ' REBUILD WITH (FILLFACTOR = 80, ONLINE = '
-- Use dynamic sql so this compiles in SQL 2000 SELECT @command = ' BEGIN TRY ' + @baseCommand + 'ON) ' + ' END TRY ' + ' BEGIN CATCH ' + -- Indices with image-like columns can't be rebuild online, so go offline
@baseCommand + 'OFF) ' + ' END CATCH '
PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding' EXEC (@command) PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done'
FETCH NEXT FROM indexesToDefrag INTO @objectid, @indexid, @indexname END
CLOSE indexesToDefrag DEALLOCATE indexesToDefrag
SELECT object_id, index_id, avg_fragmentation_in_percent, page_count FROM sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL , NULL) order by avg_fragmentation_in_percent desc
GO
|
Task 2 – Check disk space on web and database servers
- On each web front end, open Explorer to “My Computer”, record your disk space. Make sure you have at least 300MB free for install of files
- On each database server, open Explorer to “My Computer”, record your disk space. Make sure that you have enough space to make a copy of your largest content database.
- Example: if you have three databases of size 10GB, 20GB and 30 GB. Make sure you have at least 30GB of free space on your DB server.
Task 3 – Backup the databases (truncate and backup)
- Create a folder called “D:\Backups”, ensure that you have enough disk space to save all your backups to this location (add the size of each database to determine how much you will need)
- Run the following commands TWICE for each database (this will shrink, backup and truncate your database and log files):
- WSS_Content*
- WSS_Search*
- SharePoint_Config
- SharedServices*
|
use WSS_Content
dbcc shrinkfile ('WSS_Content') dbcc shrinkfile ('WSS_Content_log') go
backup database WSS_Content to disk = 'D:\backups\wss_content.bak' go backup log WSS_Content to disk = 'D:\backups\wss_content.bak' go
dbcc shrinkfile ('WSS_Content') dbcc shrinkfile ('WSS_Content_log') go
|
Task 3 – Evaluate Database Size
- If you designed your farm wrong, it is possible that you have a single web application with a single content database that contains all your content. This type of setup normally means you have a database that is going to get large very quickly and backup and restore operations, as well as future upgrades could take a considerable amount of time. It is suggested that you create more content databases and partition your site collections across multiple databases.
- You have two options to do this:
- Create another content database in the web application
- Create another web application with a new content database
- Create a new site collection in your port 100 site
- Open “Central Administration”
- Click “Application management”
- Click “Create Site collection”, ensure that you are on port 100 web application
- For Title, type “SC2”
- For URL, select “/sites/”, and type “SC2”
- For owner, type “administrator”
- Click “Ok”
- You will now have two site collections in your content database, you can use the following commands to backup a site collection, delete it and restore to a different web application (and hence a new content database):
|
stsadm -o backup -url http://sharepoint2007:100/sites/Sc2 -filename c:\backup.dat –overwrite
stsadm –o deletesite -url http://sharepoint2007:100/sites/Sc2
stsadm -o restore -url http://sharepoint2007:777/sites/sc2 -filename c:\backup.dat
|
- You can continue this process to load balance your site collections across multiple content databases and in essence distribute your database sizes so that upgrading will not be so painful.
- NOTE: you can only use a url once in a web application
Task 4 – Detach the content databases
- Open the “Central Administration” site
- Click “Application Management”
- For each web application in your web application list (EXCEPT central administration), do the following steps. NOTE: Click “Web Application List” to see them all:
-
- Click “Content Databases”
-
- You will see a list of content databases for the web application
- Click the database name
-
- Click the “Remove content database” check box
- Click “Ok”
- Click “Ok”
-
- Click “Ok”
- You should now see that the web application has no content databases:
- Again, do this for every web application EXCEPT the Central administration web application!
- NOTE: you may have several content databases…this may be a tedious task so you should likely follow step 5
- You can also create a command line utility to do this:
- Open Visual Studio
- Click “File->New Project”
- Select “Console Application”
- For name, type “ContentDetachAttachScript”
- Copy the following into the program.cs file:
|
using System; using System.IO; using System.Collections.Generic; using System.Text;
using Microsoft.SharePoint; using Microsoft.SharePoint.Administration;
namespace ConsoleApplication1 { class Program { static void Main(string[] args) { TextWriter tw = File.CreateText("C:/detachall.bat"); TextWriter tw2 = File.CreateText("C:/attachall.bat");
SPFarm farm = SPFarm.Local; SPAlternateUrlCollectionManager mgr = farm.AlternateUrlCollections;
foreach (SPAlternateUrlCollection altColl in mgr ) { foreach (SPAlternateUrl url in altColl) { if (url.UrlZone == SPUrlZone.Default) { try { SPSite site = new SPSite(url.IncomingUrl);
SPWeb root = site.RootWeb; if (root.WebTemplate != "CENTRALADMIN") { //get the web application for the site collection SPWebApplication webApp = site.WebApplication;
foreach (SPContentDatabase cd in webApp.ContentDatabases) { tw.WriteLine("stsadm -o deletecontentdb -url " + url.IncomingUrl + " -databasename " + cd.Name + " -databaseserver " + cd.Server);
tw2.WriteLine("stsadm -o addcontentdb -url " + url.IncomingUrl + " -databasename " + cd.Name + " -databaseserver " + cd.Server);
//Console.WriteLine("Content Database [" + cd.Name + "] was detached");
//cd.Delete();
} } } catch (Exception ex) { Console.WriteLine(ex.Message); } } } }
tw.Close(); tw2.Close();
Console.WriteLine("Press enter to close"); Console.ReadLine();
} } }
|
-
- Compile the program, press F6
- Copy the executable to your SharePoint Farm
- Run the executable
- Open the C:\detachall.bat file , this file will contain all the stsadm commands that will detach all your content databases
- Open the C:\attachall.bat file, this contains all the stsadm commands to reattach your databases (NOTE: you should attach one at a time in the later steps).
Task 5 – Backup important files
- If running in a virtual environment, backup your front end webservers main image file. After doing this, you may skip the rest of these steps and head straight for upgrade!!!
- Web.config files for all web applications (located in WSS directory of wwwroot)
- Core Site definitions that were modified ( located in 12 hive template/sitetemplates directory)
- Any customizations including:
- Changes made to core.css
- Changes made to javascript files
- Pretty much anything you changed in the 12 hive…
Task 6 – Upgrade the servers (WSS)
- Stop IIS
- Open a command prompt, run “iisreset /stop”
- Run “d:\lab files\25_Lab01\ wssv3sp2-kb953338-x86-fullfile-en-us.exe”
- Click “Click here to accept…” check box
- Click “Continue”
- The service pack should start…:
- When the WSS update finishes, the Configuration Wizard will start:
- Click “Next”
- Click “Yes”
- Click “Next”
- Click “Ok” at the information popup, the farm will start to configure itself. This includes:
- Updating DLLs (gac)
- Creating/Updating registry keys
- Creating/Updating 12 hive information
- Updating web.config files
- Installing new features
- The install should finish:
- Repeat the above steps for the svr-sp2 image
Task 7 – Upgrade the servers (MOSS)
- Stop IIS
- Open a command prompt, run “iisreset /stop”
- Run “d:\lab files\25_Lab01\ officeserver2007sp2-kb953334-x86-fullfile-en-us.exe”
- Click “Click here to accept…” check box
- Click “Continue”
- The service pack should start…:
- When the MOSS update finishes, the Configuration Wizard will start:
- Click “Next”
- Click “Yes”
- Click “Next”
- Click “Ok” at the information popup, the farm will start to configure itself. This includes:
- Updating DLLs (gac)
- Creating/Updating registry keys
- Creating/Updating 12 hive information
- Updating web.config files
- Installing new features
- The install should finish:
- Repeat the above steps for the svr-sp2 image
Task 8 – Reattach the content databases
- Open the C:\attachall.bat file, run the attach command for each content database that you detached
- SharePoint will upgrade the database as it attaches it.
Task 9 – Verify Install
1. Open the upgrade.log file (in 12 hive LOGS directory)
o Look for “Finished upgrading SPFarm Name=<Name of Configuration Database>”
o Look for “In-place upgrade session finishes. Root object = SPFarm=<Name of Configuration Database>, recursive = True. 0 errors and 0 warnings encountered.”
2. If the above entries DO NOT exist, look for all instances of
o “fail”
o “error”
3. Check version number on:
o Owssvr.dll (in 12 hive isapi directory) should be “12.0.6421.1000”
o Registry “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0”
o Central administration
4. Check version of the sharepoint databases:
o Run the following sql command on each database:
|
select * from versions order by timestamp desc
|
o You should get “12.0.0.6421”
5. On Central Administration, click “Operations”
o Click “Servers In Farm”
o The version for the farm and servers should be “12.0.0.6421”
Task 10 – Check for SharePoint 2010 readiness
1. Run the following command:
|
stsadm –o preupgradecheck
|
2. Review the PreUpgradeCheck-*.htm file in the 12 hive logs directory (it should open in a browser window
3. You should watch out for the following items:
o The above command should be run on all Web Front end servers to ensure they are identical
o You should review the Site Definition information for any non “Internal” site definitions, these will need to have an upgrade definition file. Your developers will need to build this file for SP 2010
o If you have language packs installed, you will need to install the latest version when SP 2010 comes out
o Look for any referenced and missing features. Either install them or delete the references to them
o Depending on the type of upgrade to SP 2010 you do, you many need to plan for URL changes in your sites
o Review the Lists that have more than the recommends number of items. These could slow the migration process to SP 2010. Consider removing the list or deleting items to shrink the list size
o Review any Custom Field types that have been added to your Farm. CAML is not used in SP2010 and each of them will need to be re-developed with XSLT in mind.
o If you are running on 32 bit OS and Server 2003, you will need to start planning for migration to a 64bit server 2008 environment to run SP 2010
I saw this note on a linkedin post this morning and I immediately checked my calendar to see if it was April 1st today. Guess what, it isn't....This bug will make SharePoint expire as though it was a trial installation 180 days after SP2 is deployed. Please check the original post on the msdn blogs here
To work around this issue you will need to re-enter their Product ID numbers (PID) on the Convert License Type page in Central Administration. Please see this KB article for detailed steps.
I have been doing a fun project for a customer, which asked to have his SharePoint Portal Server 2003 farms upgraded to MOSS 2007 using the gradual upgrade approach. I wanted to share some tips and things to consider when you are facing such a project.
1. remove unused and/or previous versions of webparts fom the SharePoint configuration.
There can still be web parts registered in SharePoint that have been physically or manually removed from the virtual server. Check stsam -o enumwppacks for any webpart packages installed that are no longer registered in the web.config files and so on. Know that when you start the upgrade of the web application, MOSS will try to upgrade all registered webpart packages and that if it cannot find it anymore, the process will fail and you zill not be able to upgrade the web application until you have fixed this.
2. check if your IIS sites have not been renamed
Another one of those things to keep in mind is the fact that when the farm is created in SPS, it writes down the name of the IIS web site in the configuration database. The MOSS upgrade will use this information to find out which IIS site corresponds to the SPS sites. If these sites have been renamed in the meantime and you want to upgrade a SPS web application, then you can get a message indicating that there is nothing to upgrade or you will also not be able to find your SPS virtual servers in the MOSS upgrade pages in Central Administration v3. If for some reason you are in a farm scenario and your IIS site name has been changed on another front end server and not on the one you are performing the upgrade, then you will not get this warning, but the MOSS upgrade will not update the IIS site with the alternat url or port that you configure and you will therefore need to make the changes manually.
3. consider adding an additional frontend server to be used as the server that performs the upgrades
When you are ready to start upgrading sites, you need to do this on a server running the Central Administration role and the Web Application role. Do not think you can get away by using your index server to do your upgrades. The moss upgrade pages go through your IIS configuration to find the web applications that can be upgraded. If you are going through the upgrade pages on a central admin site hosted on your index server and net having the web application role, you will not find any web applications and/or site collections for which you can start the upgrade. Of course having installed MOSS on top of your existing front end servers, already bring an additional load to those systems and your users will probably start complaining with performance issues. That is why I would advise havin an additional frontend server installed in your SPS farm and use this one for performing the upgrades.
4. beware of the side effects of prescan
Another thing that surprised me in the project is prescan. This required tool suppoedly does not change anything to your sites. However it does. You know when you are viewing a list of all yous Document libraries and lists in your site, that it mentions next to each list when the last modification was done in that library or list (e.g. 6 days ago). Well running prescan will reset that information. So while it does not actually change any documents or lists, it does change the last modified date of the list or library itself. Knowing this may help you when you get your users on the phone complaining that all the document libraries have been changed all of a sudden (after you have run prescan)
5. there is no stsadm command to lock/unlock a site in SPS
damn, this is a bugger. Planning to script the upgrade of each site I found out that you cannot lock a site in SPS using the commandline stsadm tool. Apparently this was only introduced in MOSS. I found the solution in SPSiteManager (see my post about it)
6. Plan your content databases in MOSS
part of my project I was asked to have tha large databases in SPS, split up in multiple databases in MOSS. I did this by using the stsadm -o mergecontentdbs operation right after the site has been upgraded. Unfortunately you cannot choose wher the upgrade porcess needs to put the upgraded site collection. Part of the preparations to your upgrade is the fact that you need to configure a 1 to 1 relation of your existing SPS content databases to your MOSS databases, meaning that if a site is located in a specific content database, that its upgraded version will end up in the configured MOSS database and nowhere else (even if there is a parameter in the stsadm -o upgrade command that allows you to specify the targetdatabasename)
A piece of good advise: If you are planning to have more content databases in a specific web application in MOSS than you have in the corresponding virtual server in SPS, create additional empty databases in SPS to match the number of content databases in MOSS. It will save you a lot of trouble if you need to revert an upgraded site and reupgrade it again.
7. Check your upgrade.log file
Every action that MOSS does which regards upgrades of web applications, upgrades of site collections and even reverts of sites is logged in the upgrade.log file. If you have chnaged the default logging location in Central Administration v3 - Operations - Diagnostics Logging, then do not expect the upgrade.log file to be there as well. This log file does not leave the nest. You need to find it in the 12-hive Logs folder. A good practice would be to clear this file before starting the upgrade of any site.
8. Know how to rollback a failed upgrade of your SPS virtual server.
I had this issue that I was finally ready to start the upgrade of the web application and that during this upgrade process the well-known "unknown error occured" appeared. When I went back to the upgrade page, I was not able to rollback this operation or redo the upgrade. So what do you do next? the answer is very simple: delete the newly created web application in MOSS and every change made to the IIS sites (URL redirection) will automatically be undone as well.
I am sure that I can add some otherpoints to this list, but nothing comes to my mind on this sunny sunday afternoon. If something does come up I will gladly add it to this post and share it with you guys.
What a shock when I found out about Steve Riley being kicked out of Microsoft as part of a restructuring. If you ever attended Tech Ed conferences, then you must have seen Steve in action. His sessions were and still are legendary. The session I enjoyed most was: Defending Layer 8
I am sorry to hear you go, Steve, but I am sure you will be around soon.
Read all about Steve on his blog soon to disappear I gues: http://blogs.technet.com/steriley/archive/2009/05/06/good-bye-and-good-luck.aspx
Good news: His new blog can be found at http://msinfluentials.com/blogs/steveriley/default.aspx
Pfff, it's been a while again since my last post. I promise you guys that I will have some time soon to write more. Anyway...
This post to write about a cool tool that my colleague Pascal Rocheteau found today: SPIEFolder from codeplex.
Project Description
Allows you to either Import a file system folder (And all files and subfolders) into a SharePoint Document Library, and also export a SharePoint Document Library to the file system for
WSS 2.0/SPS2003 or WSS 3.0/MOSS 2007. This tool completely replicates the document libraries folder hierarchy to the file system when exporting, and replicates the folder hierarchy from the file system to the document library when importing.
Sounds really cool and usefull. Thanks Pascal for this
In followup of my previous post, today my favourite Microsoft Premier Support Engineer was asked to provide a way to unghost customized page layouts.
He came up with a little piece of code that does the trick in a C# Console application.
It must be getting clear to some of you that for administering SharePoint a knowledge of .Net development skills is becoming more and more a requirement....
The most important function of this piece of code depends on the method SPFile.RevertContentStream() which is described as: "Returns the file to its original uncustomized state so that its logic becomes cached in memory (also known as "ghosted") rather than stored in the database."
So, here it is. The folowing code will uncustomize the customized page layouts.
using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Publishing;
namespace GhostLayoutPages
{
class Program
{
static void Main(string[] args)
{
using (SPSite site = new SPSite(args[0].ToString()))
{
using(SPWeb web = site.OpenWeb())
{
PublishingSite pubSite = new PublishingSite(site);
PageLayoutCollection pageColl = pubSite.PageLayouts;
foreach (PageLayout layout in pageColl)
{
SPFile currFile = web.GetFile(layout.ServerRelativeUrl);
Console.WriteLine("__________________________________");
Console.WriteLine("Layout page name: " + layout.Name);
Console.WriteLine("Status before: " + currFile.CustomizedPageStatus);
currFile.RevertContentStream();
Console.WriteLine("Status after: " + currFile.CustomizedPageStatus);
}
}
}
}
}
}
I got this question today from one of my collegues and needed to find the answer to it. Why did I get this question? Well one of our developper teqms provided a new solution to deploy that replaces the default master pages and the update did not show any difference after deployment. therefore we suspected that the master pages had somehow be customized which causes this behaviour.
My first hunch for finding the answer was SharePoint Designer and my favourite Microsoft Premier Support Engineer confirmed with the following article: Track Customized Master Pages
Basically you need to open the site collection using SharePoint Designer and run the Customized Pages report and apply a filter to show only the customized master pages
Below is the information that describes how to do this as grabbed from the Microsoft article
Run the Customized Pages report
For both Office SharePoint Server 2007 and Windows SharePoint Services 3.0, data for the reports generated by Microsoft Office SharePoint Designer 2007 is saved on the server on which the site is hosted. Server administrators can grant or deny access to these reports. If the reports generated come back empty, contact your server administrator for assistance. You must have at least Web Designer permissions on the server to open the site and run reports.
When you are working with an Office SharePoint Server 2007 or Windows SharePoint Services 3.0 site, you can easily use Office SharePoint Designer 2007 to run site reports that collect a variety of information about your site's health, usage, and potential problems. To run a Customized Pages report:
- Open the Web site for which you want to run the report in Office SharePoint Designer 2007.
- On the Site menu, point to Reports, point to Shared Content, and then click Customized Pages.
The report opens with all of the pages in the site listed, and the Customized column indicates whether content has been customized for that page.
Note A page is considered customized only if it is included in the original site definition. New pages created from a master page, new blank ASPX pages, and custom list forms that you create are not considered customized pages.

Filter the report to show only master pages
After you run the Customized Pages report, you may want to narrow it down to include only those pages in the site that are master pages, as shown in the following illustration.

Filter the report to show only customized master pages
You can narrow the results even further to list only customized master pages, as shown in the following illustration.

- Click the arrow next to the Type column heading, and then click master.
- Click the arrow next to the Customized column heading, and then click Yes.
The report now lists only master pages that have been customized.
Note To remove any filter, click the arrow next to the column heading, and then click (All).
This is another one of those tools you should have on your SharePoint farm(s). Although the tool is aimed to designers of SharePoint solutions, I like to use it for deploying solutions to different or additional web applications without having to retract it first.
The official description, grabbed from the iDevFactory.com website states the following:
SharePoint Work Acceleration Toolkit (SWAT) is a windows based utility aimed at simplifying and accelerating the creation and testing of SharePoint Solutions. With a whole host of time saving capabilities and planned integration with Universal SharePoint Manager 2007, you'll never want to take on SharePoint without it again.
SWAT Features and Capabilities:
Here is a short list of just some of the things SWAT can do. For a complete overview checkout the SWAT User Guide.
- Site Diagramming
- Show a Site Structure as a Diagram
- Save a Site Structure Diagram as a Image
- Save a Site Structure Diagram as a SVG file (for importing into Visio)
- Print a Site Diagram
- Drag and Drop the design of a Site Structure
- Generate Test Data and Sites
- Generate Random Sites for Testing
- Auto Populate Lists/Libraries with Test Data (including Documents)
- Work with SharePoint Logs
- View SharePoint Log Files in a preview window
- Group and Filter Log file entries
- Work with Sites
- Show a Site Structure in a Tree View (including security inheritence)
- Create a Site Collection
- Export and Import Site Structures
- Backup and Restore Site Collections
- View and Interact with site objects (Lists, Users, Roles, Features, Events, etc..)
- Delete Sites and entire Site Structures
- Work with SharePoint Features
- View Feature Status in Farm and on a Site
- Install and Uninstall Features
- Activate and Deactivate Features
- Work with SharePoint Solution Packages
- Install and Deploy Solution Packages
- View Solution Deployment Locations (Servers and Web Apps)
- Deploy, Retract and Delete Solutions
- Work with SharePoint Jobs
- View Job Status
- Add and Schedule Jobs
- Enable and Disable Jobs
- Force Execution of Jobs
- Work with Event Receviers
- Install Event Receivers for Sites and Lists
- View and Manage Event Receivers
- Delete Event Receivers
- Work with Web Parts
- Add (Deploy) Web Parts to multiple sites/pages
- Replicate Web Parts
- Delete Web Parts from multiple sites/pages
...and much much more! These are just some of the features available in the SharePoint Work Acceleration Toolkit.
And now for the good part of this tool: ..... IT'S FREE
Read all about it here
yeah yeah, if you are used to working with MOSS, then you will probably tell me to use the command stsadm -o setsitelock -url <url> -lock readonly or something like that.
Unfortunately back in the SharePoint Portal Server 2003 and WSS 2.0 days, this operation was no yet available with stsadm.....along with a lot of other usefull commands
I needed to lock the sps 2003 sites in a gradual upgrade project to MOSS. Of course I want to script the complete migration, which also includes locking the SPS site before starting the upgrade.
Searching the web, I found my way to the SPSiteManager project on Codeplex
In addition to the opeartions I was looking for, you also get the following operations:
|
Operation
|
Description
|
|
analyze
|
Enumerate all Content Database information and generate a Site Distribution Document
|
|
repartition
|
Re-partition sites to different content databases
|
|
enumsites
|
Enumerate Site Collections
|
|
Enumsitecrawl
|
Enumerate URL references from the list of sites to crawl
|
|
Enumsitedirectory
|
Enumerate URL references from a portals site directory
|
|
enumdatabases
|
Enumerate Content Databases
|
|
backup
|
Backup site(s)
|
|
restore
|
Restore site(s)
|
|
deletesite
|
Delete site(s)
|
|
adddatabase
|
Add content databases to a virtual server
|
|
addfromcrawl
|
Add site(s) to list of sites to crawl for SharePoint Portal Server 2003
|
|
removefromcrawl
|
Remove site(s) to list of sites to crawl for SharePoint Portal Server 2003
|
|
addfromdirectory
|
Add site(s) to Portal Server 2003 Site Directories
|
|
removefromdirectory
|
Remove site(s) to Portal Server 2003 Site Directories
|
|
locksite
|
Lock site(s)
|
|
unlocksite
|
Unlock site(s)
|
|
resetquota
|
Reset quotas on site(s)
|
|
purgeversions
|
Purge document versions from document libraries
|
Although these operations look a lot like the ones we get with MOSS, nowadays, they actually are much better. For example the operation to backup a site will actually also lock the site for read/write for you and unlock it when done. So before using this tool with all the operations, be sure to check out the well written manual that is included explaining each operation.
Thomas Vochten, a former colleague of mine, wrote about an interesting way to create and configure your SharePoint farm to take into account any possible changes in your backend SQL infrastructure by using SQL aliases on your MOSS servers and therefore adding the possibility to change your backend SQL server transparently to your SharePoint configuration.
On his blog, he wrote:
"I recently found out about SQL Aliases and how to use them in combination with SharePoint installations. It enables you to define local alias name to connect to with a SQL Client, so you can change the actual connection later on. This may come in handy when switching over to your mirror database server, when moving servers, when virtualizing you database server etc. "
Furthermore he describes the actual steps to configure this. I am not adding those steps to this blog post, to have you go look at the original post instead 
I also checked with my favorite Premier support Engineer form Microsoft to check if this is supported and he confirms it is. He aslo confirmed seeing this more and more for use with Excel Services and failover scenarios as suggested by Thomas.
**** Update ****
Also worth mentionning is Thomas's comment on my question:
I wrote: "Just to be clear: this needs to be configured on the MOSS servers locally, right, and not on the SQL box? And if so, then it would need to be configured on all MOSS servers part of the farm, too, right? "
Thomas replied: "Indeed, it needs to be configured on every MOSS server. You could also do this after MOSS is already installed: configure the alias exactly as your existing connection, and change it when needed."
Thanks Thomas for sharing.
Why might this be relevant to a MOSS admin. Well, you might be busy upgarding a SharePoint Portal Server 2003 environment to MOSS using the gradual approach, like I am. Off course you would test thjis on a test farm and reproduce your production environment in a somewhat representative way. In my case a imported only a couple of production sites in my test environment, which could be considered as logical.
Now, the thing is that I tried crawling the SPS content with my new MOSS farm and the crawl uses the Site Directory on the SPS Portal to anmalyze which sub sites it needs to crawl. Clearly the Site Directory was not reflecting teh istes I had on my test environment. So I cleaned out the Site Directory and wanted to add Links to the actual sites on the SPS application.Guess what, I was unable to. Apparently this is due to SP2 for SharePoint Portal Server 2003.
Thanks to this blog post I found the solution:
1. Open this file in a text editor:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\[LCID]\SPSSITES\LISTS\SITESLST\NewForm.aspx
(Replace [LCID] with your locale identifier, 1033 for English)
2. Find this code fragment:
<SPSWC:InputFormButtonSection runat="server">
<SPSWC:InputFormButtonAtBottom ID="ButtonOk" runat="server"
TextLocId="Page_OkButton_Text"/>
<SPSWC:InputFormButtonAtBottom ID="ButtonCancel" runat="server"
TextLocId="Page_CancelButton_Text" visible="false" />
</SPSWC:InputFormButtonSection>
3. Replace it with this code fragment:
<SPSWC:InputFormButtonSection runat="server">
<!-- Workaround for WIN2003SP2 issue: http://support.microsoft.com/kb/934229
-->
<input type="button" value=" OK "
onclick="document.forms[0].submit()" />
<!-- <SPSWC:InputFormButtonAtBottom ID="ButtonOk" runat="server"
TextLocId="Page_OkButton_Text"/> -->
<!-- End workaround -->
<SPSWC:InputFormButtonAtBottom ID="ButtonCancel" runat="server"
TextLocId="Page_CancelButton_Text" visible="false" />
</SPSWC:InputFormButtonSection>
4. Thats it;-)
While searching through the Technet SharePoint forum, I stumbled upon a post/question regarding how to find out how much data your subsites are using. I remember from the SPS 2003 days that there was a aspx page that would show this ( _layouts/storman.aspx), which actually still exists in MOSS, but is accessible ony if you have a storage quota defined on the site collection (maybe it was also the case already in SPS, but I am not sure). It is accessible though the Site Settings page listed as a link called storage space allocation
Well, Tom Dobrinski developped a tool that allows you to get this information regardless of the fact if storage quotas are enabled or not. Even more he has made it available free of charge, but you are kindly suggested to make a small donation (5$) to get a everlasting key for the tool. Otherwise you will have to drop Tim a mail requesting a key every 4 months or so...
Go check his blog for the tool called the SharePoint Space Monitor if you think it might be usefull to you.
More Posts
Next page »