Windows Vista and Windows Server 2008 come with a very handy utility for capturing the screen shots and saving them. It’s called the Snipping Tool and can capture almost any region you want. You’re not just limited to the whole screen and the current window like you are with the Print Screen button, you also have the options of rectangular select (the one I use most) and free-form snip.
It’s also got a couple of basic editing tools such as pens and highlighter.
I use it all the time when I need screen shots. Just type snip into the start menu and it will appear in the list at the top.
Enjoy.
Sometimes you want to restrict who can add a specific web part to a page. Maybe it can access sensitive information, or it can be connected up in a dangerous way, or even it places too much load on your server and you only want it in one place. Well the good news is that you can limit exactly who has access to add particular web parts to pages in SharePoint 2007 using the standard method of setting permissions. The web parts are kept in a list in SharePoint so you can use the normal list setting permissions to limit access.
You need to remove permissions to the web part itself. The process is
1. From any site settings go to the top level site setting.

2. Open up the web part gallery.

3. Click the edit button for the web part you want to limit permissions to.

4. Click Manage Permissions from the edit page.

5. You will then see a standard Manage Permissions page. As with any permissions on a list, you will first need to break inheritance. Then set up the permissions so that the users you don’t want to be able to add the web part, don’t have any permissions on it at all, either directly or via a group membership.
Note: These permissions only affect being able to add the web part to a page and modifying the actual web part entry in the list. Once the web part has been placed on a page, these permissions are not used, the site permissions then control who can edit properties and delete the web part from the page. So you still need to consider the page level permissions carefully.
Every now and then an automatic update fails and leaves a directory in the c: drive with a Guid for a name, along the lines of C:\3baf1f42abd933d331f0d49f. The most annoying thing about these is that you can’t delete them, even when running as administrator. This is because the SYSTEM account owns them and no-one else has any permissions on them.
To manually delete them, you need to take ownership and then give yourself permission on every folder and file individually. This obviously would take forever, so a scripting solution is required. I finally came up with this solution:
1. Run PowerShell as administrator.
2. Navigate into the root of the folder to process.
3. Take ownership of all the files and folders by running
gci -r | %{takeown /f $_.FullName}
This gets all files and folders below the current directory, then for each one runs takeown filename. Takeown is a utility which comes with Vista.
4. Once you have ownership you need to run icacls on all the files to get permissions on them. icacls is the Vista and Server 2008 replacement for xcacls. The command to run is:
gci -r | %{icacls $_.FullName /grant:r username:F}
username is either you log on name on a stand-alone machine or domain\accountname in a domain.
5. Once you have permissions you can then run del -r
I found most of this information from Christopher Atkins blog.
SalamanderSoft has been mentioned in another TechNet article, this time about Blatchington Mill School which is titled Example Solution Architecture: Blatchington Mill School. Congratulations to Mark & Sue for all their hard work developing their portal being recognized by Microsoft.
Interestingly it the My Documents web part which is explicitly mentioned, while Salamander SharePoint which is used to generate the class sites is referenced as a third-party provisioning tool. Salamander SharePoint is much more powerful than My Documents so it’s strange we’re mentioned in relationship to one and not the other.
This is one I forgot to blog about at the time. About a month ago I wrote a Recent Surveys Web Part which was suggested by one of my existing customers. It’s a pretty simple concept, it just displays all the recent surveys on a specified site, limited by age and maximum number. This particular school wanted to keep all their surveys in one location, but then display them on other sites within their portal. You can get more details at http://www.salamandersoft.co.uk/recentsurveys.html.
After some feedback from a school, I’ve added support for Document Libraries and Calendars to the List View Web Part and fixed a couple of minor issues.
For document libraries you can now navigate through into their folders while staying on the original page.
For calendars it will now display the calendar format automatically if the view is in calendar format.
This is something that you would think would be really easy, after all you should always separate the styles out from your code. However, I had great difficulty finding anything on the web about it. I finally managed to crack it and am posting it here for others to find.
Basically you can add an HtmlLink control to the Headers collection of the page.
///<summary>Adds the stylesheet to the page.</summary>
void AddStyleSheet()
{
string url = “~/_layouts/misWebParts/misWebParts.css“;
foreach (Control control in Page.Header.Controls)
{
HtmlLink link = control as HtmlLink;
if (link != null)
{
if (link.Href == url)
{
//Already added
return;
}
}
}
HtmlLink cssLink = new HtmlLink();
cssLink.Href = url;
cssLink.Attributes.Add(“type“, “text/css“);
cssLink.Attributes.Add(“rel“, “stylesheet“);
Page.Header.Controls.Add(cssLink);
}
The code is for the School MIS web parts I’m working on. The stylesheet is deployed to the layouts directory so we can reference it via the url above. You need to check to see if the link has already been added as usually there’s going to be more than one MIS web part on the page.
I’ve just finished a beta release of a list view web part for SharePoint. It allows you to display a list from another site even if it is in another site collection. It designed to be as simple as possible to set up.
To use it there’s 3 properties which you need to set:
- Site Url: The url of the site the list in on.
- List Name: The name of the list.
- View Name: The name of the view to use to display the list.
The connection to the list is made as the user viewing the web part, so will use their permissions. So if they don’t have permission on the list, they won’t see it.
If you want to display a list from another site collection, then it needs to be on the same server.
It’s only a Beta release so not all Errors have graceful error messages. You can download it from http://www.salamandersoft.co.uk/webparts/listview.zip. The beta will expire on 19 Jan 2009.
Have a go and let me know what you think either in the comments or email to listview@salamandersoft.co.uk.
I’m sure there’s other features I could add, but that depends on how popular it is and whether there’s any demand for them.
Sometimes you need to quickly add a dll to the Global Assembly Cache (GAC) – usually when you need it to run with full trust rather than limited trust in an ASP.net or SharePoint setting. The quickest way to do this from any computer is just to drag and drop the assembly onto c:\windows\assembly which will automatically install it in there. You’ll need to do this from two instances of Windows Explorer for some reason. Open one at c:\windows\assembly, then find the dll in another one and drag and drop it. You’ll need to restart IIS (iisreset at the command line) if it’s for ASP.net or SharePoint.
If the assembly is already in there you’ll need to delete it first – right-click and Uninstall or highlight and press delete, as it won’t automatically overwrite an existing one.
I’ve just come across a nice little free SharePoint solution called SPLimitedAccessDiscovery. It’s a little solution which will give a report on everybody who has their permissions limited as “Limited Access” on the Site Permissions page of a site. Very helpful for tracking down why somebody has limited access as the report will list all objects as the people have access to. The report generated shows the account given the limited access, the type of object that was found to have unique permissions, the title of the list and item, as well as a url to the object and its ID.
It’s integrated nicely into SharePoint, the link to the report appearing on the standard settings page for a site after a site collection level feature is activated.
My only gripe is that installation could be a bit slicker. It’s supplied as a standard wsp, so you’ll need to install it with STSADM. A little batch file to do this would be good. The command I used to install is
“C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm.exe” -o addsolution -filename limitedaccessreport.wsp
I also had the following error when trying to view the report
Request for the permission of type ‘Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ failed.
This was because the web part needed higher permissions than my SharePoint was running at. It was easily solved by installing it in the GAC, but ideally the solution should either have installed itself in there, or even better added a custom code access permission.
There’s more information at the author’s site http://philwicklund.com/freeware/splimitedaccessdiscovery/default.aspx or can be downloaded from Codeplex.
Make sure that you get the 1.0.0.1 release as there is a bug in the 1.0.0.0 release.