Geoff 的个人资料Geoff Varosky's Blog日志列表 工具 帮助

日志


11月16日

stsadm -o warmupcollection And Other Good Things…

While I am in the process of creating a new virtual machine to host the new public beta of Office SharePoint Server 2010, I thought I would share a quick tip, regarding a toolset I use frequently. If you do any development work at all, or any sort of demonstration environment, you need to be aware of Scot Hillier’s SharePoint Development Environment Modifications project on CodePlex (http://www.codeplex.com/SPDevMod).

This is a collection of extremely useful tools for Visual Studio 2005 and 2008, some great STSADM extensions, and more. One of my favorite is mentioned in the subject of the post, and does exactly what it looks like. Taking the URL of a site collection, and warming it up. Useful after app pool recycles, IIS resets, etc., when everything is slow and sluggish as the JIT compiler loads up pages and gets them ready to go.

 

8月17日

SharePoint Nation! - Virtual User Group Meeting Featuring a Developer Panel!

[re-posted from Amanda Murphy’s blog at: http://blog.funknstyle.com/?p=604]

Join us on Tuesday, August 18th at 8pm EST as we welcome a developer panel featuring Ed Musters, Geoff Varosky, Paul Schaeflein, Paul Stork and Rebecca Isserman. These guys will be there to answer your questions as well as provide some of their own guidance on topics such as getting started with web part development and the proper implementation of user controls. This event will be hosted by Laura Rogers.

As with all previous meetings, come join us no matter where you are in the world as this meeting will be delivered virtually via Live Meeting. In order to hear audio for the event, you will need to download the Live Meeting client.

Live Meeting Address:
https://www311.livemeeting.com/cc/mvp/webJoin?id=SPN05&role=attend

 

7月28日

SharePoint Administration Freeware Tool - Axceler PinPoint

Axceler just released a new tool which will fit nicely into the SharePoint administrator’s toolbox, that can help answer some commonly asked questions in a SharePoint environment:

  • What are my most active sites?
  • What documents/pages see the most activity?
  • What are the largest sites and items within my farm?

Axceler PinPoint provides you with answers to these common question – and best of all, it’s free. The only downside is that it needs to be run from one of the SharePoint servers within your farm, and cannot be run remotely, as it makes use of the object model to work it’s magic. A small price to pay IMHO for this information.

Freeware SharePoint Tool Download

Click here for more information and to download

 

7月8日

Quest DropThis for SharePoint 1.0 Freeware

The folks over at Quest Software have recently released a free utility to allow you to easily integrate your Outlook 2003 or 2007 client into SharePoint via their community site - SharePoint For All.

This tool works by allowing you to upload attachments into SharePoint, and provide a link in your email to that document, helping eliminate the sending of attachments through your own, as well as your recipients’ mail servers. All directly from within Outlook.

I find this utility extremely handy for sending files to clients, and pushing the files up to their project site, as well as working with internal teams, pushing files up to my MySite.

Go here to download the software, a mini-guide, and there is also a link to their support forum to share your questions and feedback: http://sharepointforall.com/media/p/401.aspx

Usage is simple, once the add-in is configured, send an email with an attachment, and you will be prompted with the box above so you can specify the location (other than the default you have configured), click OK, and you’re off to the races.

Your recipient will see an email like this, with a link to the attachment (if the first or second options are chosen)

image 

A word of note for Outlook 2007, which is not mentioned in the guide here: http://sharepointforall.com/blogs/team/archive/2009/06/23/the-official-quest-drop-this-for-sharepoint-mini-guide.aspx 

When I had installed (your mileage may vary), the utility was automatically set as disabled. You will know the utility is disabled if there is not a new Quest DropThis for SharePoint tab under Tools > Options. To change this, go into Tools > Trust Center, and click on Add-Ins. You should then see Quest DropThis for SharePoint underneath the Disabled Application Add-ins section. On the bottom of that screen, select Disabled Items from the Manage drop-down, and click Go. Find Quest DropThis for SharePoint in the list, and click Enable. Once enabled, it will then go under Inactive Application Add-ins, to now enable this add-in, select COM Add-ins from the Manage drop-down and click Go. Then, check the Quest DropThis for SharePoint option in the list, and click OK. You should now be ready to go!

 

7月7日

AvePoint Releases FREE Tool for SharePoint Item Level Restoration from SQL and DPM Backups

AvePoint announced this at the SharePoint Technology Conference in Boston two weeks ago, and has issued a formal press release as of July 1st, 2009. They are now offering a FREE tool (DocAve SQL Restore Controller), that will allow you to perform full-fidelity item-level restore capabilities in SharePoint from SQL and DPM backups!

As with all of AvePoint’s products, this tool is available in their DocAve software suite (trial can be downloaded here: http://avepoint.com/resources/free-trial-downloads/). The trial gives you 30 days to try out the entire product suite, and after the 30 days period is up, you still have access to the DocAve SQL Restore Controller.

 

Executing SPQuery Queries and the U2U CAML Query Builder

If you are querying against any list using the SPQuery method, then most likely you are using the U2U CAML Query Builder. And if you are not, why? (This is old news! It’s been around since SharePoint 2003) This utility is always one of the first installations to any of my development environments.

This utility makes your life much easier by allowing you to build and test your queries directly against SharePoint, before debugging them, through code. And you can also do it remotely via web services, so you do not have to install and run this directly from the server itself.

A newer version was released last year as well that will install directly into your farm via a feature, to allow you to build, test, and save queries all from the SharePoint UI!

However, a common issue takes place when you copy the query directly from the U2U CAML Query Builder (which works just fine in the utility itself), in that no matter what conditions you have specified for your query, you always retrieve all list items. If this is the first time you have run into this – you have no doubt done a little of the timeless developer troubleshooting method

  1. Bang head against desk
  2. Repeat

You need not worry however, this is a quick fix. The U2U CAML Query Builder inserts <Query> </Query> tags around the query itself. In your code, just drop these start and end tags from your query, and you should now be returning your expected results.

image

 

6月18日

Current Item Properties for Comparison within the ItemUpdating Event Receiver Event

Within an event receiver, you have two hash tables available to you within SPItemEventProperties, BeforeProperties, and AfterProperties.

When working with the ItemUpdating event receiver, the AfterProperties do indeed hold the updated values of that list item. However, the BeforeProperties hash table does not hold the current item values, which can lead you to some head scratching trying to figure out how to access these for comparison purposes.

Never fear – you can still get to it through the SPItemEventProperties through:

properties.ListItem.Fields[“Field Display Name”].InternalName

So you can compare that with your AfterProperties value:

properties.AfterProperties[properties.ListItem.Fields["Field Display Name"].InternalName]

And you’re good to go.

6月15日

SharePoint Quick Tip - execadmsvcjobs

A quick tip (as the title of this post states) for SharePoint, useful for both administrators and developers. Often in these roles, you are working wither within Central Administration, deploying, retracting, and removing solutions from your environment.

In doing so, you can either specify a time for these jobs to be run, then you definitely have to wait, or, you just need to wait for the SharePoint Timer Service to run these jobs for you. Or, you do have the option of firing up the command prompt, and running

stsadm -o execadmsvcjobs


That is all well and good, but, wouldn't it be easier just to click a button? That is what this quick tip is all about. The solution? Just create a batch file to do this for you, and drop it on the quick-launch for easy access.

If you are unfamiliar with creating batch files, here is how to accomplish this.

  1. Open up notepad
  2. Paste in the following (be sure to change the path to your stsadm executable on the first line it it is not located in the same place, for example, on drive D rather than C)
  3. @SET STSADM="c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm.exe"
    @ECHO.
    @ECHO Executing Jobs...
    %STSADM% -o execadmsvcjobs
  4. Save the file as execadmsvcjobs.bat (be sure to select All Types (*.*) from the Save as type drop-down dialog, so .txt is not appended to the filename, resulting in execadmsvcjobs.bat.txt)
  5. Once saved, browse to the location where you have just saved this file, right click on it, and choose Send To > Desktop (create shortcut) from the context menu.
  6. Drag the shortcut icon into your Quick Launch bar
  7. Click on it to run!

Makes the process quick and simple. If you have other batch scripts which you run frequently, it may even be useful to have a toolbar itself setup to group these all together for easy access.

 

6月3日

Interactive Silverlight STSADM Technical References for MOSS 2007 and WSS 3.0

Published just today on Microsoft TechNet, are two great interactive technical references for MOSS 2007 and WSS 3.0 STSADM command options. If you use the STSADM utility at all, and ever need a reference, this is an excellent option.

There are two separate versions, one limited to WSS 3.0 commands, and a second for MOSS 2007 only commands available via STSADM.

WSS 3.0: http://technet.microsoft.com/en-us/windowsserver/sharepoint/dd418924.aspx

MOSS 2007: http://technet.microsoft.com/en-us/office/sharepointserver/cc948709.aspx

 

5月22日

GraceHunt.SharePoint.Features.CompleteTask

This code was originally included within my presentation materials from SharePoint Saturday Boston, and during my presentation, I had mentioned that I would eventually get this into our CodePlex project site… at long last, here it is - GraceHunt.SharePoint.Features.CompleteTask.

This feature is a Custom Action, scoped to Site Collections, which adds a Complete Task menu option to the Edit Control Block in both Task and Gantt Tasks (Project Tasks) lists in SharePoint.

image

Selecting this menu option, calls an ASPX page from the _layouts folder, which sets the Status of the task to Completed, and the Percentage Complete field to 100%. This is very useful for quickly completing a task, without having to go into the Edit page, change the status, then change the percentage complete to 100, then clicking OK, saving you quite a few steps and page reloads. You can now complete a task from either list type with 1 click, and one page reload.

Installation Instructions

Unzip the GraceHunt.SharePoint.Features.CompleteTask.zip into a directory on your SharePoint server. This feature is configured to be installed using the SharePoint Installer package, so you never need to see the command line, or Central Administration.

Run the Setup.exe file extracted from the archive, and follow the prompts as shown below.

image

Click Next

image

This section will verify that your configuration meets the installation requirements. Once this has completed, click Next

image

Select the Site Collections which this feature should be deployed and activated. Once selected, click Next

image

The installer will then add the WSP file to the solution store, deploy it to the previously selected site collections, and activate the feature within those sites. Once this is done, click Next

image

When the installation has completed, you will see the output from the installer. Click Close.

You should now have the Complete Task functionality available to you on both your Task and Project Tasks lists!

image

Please submit any feedback here in the comments, or on the project page on CodePlex. Also, please feel free to leave suggestions for new features! I have a few more lined up, to hopefully be coming your way within the next month or so. Stay tuned!

 

5月21日

SharePoint SPBasePermissions Enumeration

When I presented my session on Developing Custom Actions within SharePoint at the Boston SharePoint Saturday conference, I had mentioned a link for a listing of SPBasePermissions that is on MSDN, within the WSS 3.0 SDK, for use with the Rights attribute within the CustomAction element. This attribute defines what permissions are required for the Custom Action to be visible to users.

That link can be found here: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spbasepermissions.aspx

For others reference, and my own personal reference, I have a copy of this listing of SPBasePermissions here.

Member Name

Description

AddAndCustomizePages

Add, change, or delete HTML pages or Web Part Pages, and edit the Web site using a Windows SharePoint Services–compatible editor.

AddDelPrivateWebParts

Add or remove personal Web Parts on a Web Part Page.

AddListItems

Add items to lists, add documents to document libraries, and add Web discussion comments.

ApplyStyleSheets

Apply a style sheet (.css file) to the Web site.

ApplyThemeAndBorder

Apply a theme or borders to the entire Web site.

ApproveItems

Approve a minor version of a list item or document.

BrowseDirectories

Enumerate files and folders in a Web site using Microsoft Office SharePoint Designer 2007 and WebDAV interfaces.

BrowseUserInfo

View information about users of the Web site.

CancelCheckout

Discard or check in a document which is checked out to another user.

CreateAlerts

Create e-mail alerts.

CreateGroups

Create a group of users that can be used anywhere within the site collection.

CreateSSCSite

Create a Web site using Self-Service Site Creation.

DeleteListItems

Delete items from a list, documents from a document library, and Web discussion comments in documents.

DeleteVersions

Delete past versions of a list item or document.

EditListItems

Edit items in lists, edit documents in document libraries, edit Web discussion comments in documents, and customize Web Part Pages in document libraries.

EditMyUserInfo

Allows a user to change his or her user information, such as adding a picture.

EmptyMask

Has no permissions on the Web site. Not available through the user interface.

EnumeratePermissions

Enumerate permissions on the Web site, list, folder, document, or list item.

FullMask

Has all permissions on the Web site. Not available through the user interface.

ManageAlerts

Manage alerts for all users of the Web site.

ManageLists

Create and delete lists, add or remove columns in a list, and add or remove public views of a list.

ManagePermissions

Create and change permission levels on the Web site and assign permissions to users and groups.

ManagePersonalViews

Create, change, and delete personal views of lists.

ManageSubwebs

Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites. 

ManageWeb

Grant the ability to perform all administration tasks for the Web site as well as manage content. Activate, deactivate, or edit properties of Web site scoped Features through the object model or through the user interface (UI). When granted on the root Web site of a site collection, activate, deactivate, or edit properties of site collection scoped Features through the object model. To browse to the Site Collection Features page and activate or deactivate site collection scoped Features through the UI, you must be a site collection administrator.

Open

Allow users to open a Web site, list, or folder to access items inside that container.

OpenItems

View the source of documents with server-side file handlers.

UpdatePersonalWebParts

Update Web Parts to display personalized information.

UseClientIntegration

Use features that launch client applications; otherwise, users must work on documents locally and upload changes. 

UseRemoteAPIs

Use SOAP, WebDAV, or Microsoft Office SharePoint Designer 2007 interfaces to access the Web site.

ViewFormPages

View forms, views, and application pages, and enumerate lists.

ViewListItems

View items in lists, documents in document libraries, and view Web discussion comments.

ViewPages

View pages in a Web site.

ViewUsageData

View reports on Web site usage.

ViewVersions

View past versions of a list item or document.

 

5月20日

Getting the <Data> out of a SharePoint List

I was working recently on a project for a client, to build a feature that will create several list templates, content types, and instances of those lists. To do so, I used a great new utility that can be found on CodePlex, written by Jeremy Thake and Rich Finn, that will handle this for you. Better than the SharePoint Solution Generator that ships with VSeWSS (Visual Studio extensions for Windows SharePoint Services).

I used SPSource (the above mentioned program) to extract the content types, list templates, and list instances with ease, just needing a few minor tweaks, but I also had a different issue. I needed to populate those list instances with the data that currently existed within those lists. Jeremy Thake had pointed out that this could be done easily with PowerShell, but there is also another method that works easily enough, without requiring code.

To do so, go to your list which contains the data, and then go into the settings for that list, and save the list as a template, including the content.

Once you have created the list template, go to the list template library, and download the STP file that was created. Now, here is the trick, rename that file from Listname.stp to Listname.stp.cab. STP files are nothing more than cabinet files.

From: image

To: image

Once it has been renamed, open the cabinet file in your favorite compression utility, and open the Manifest.XML file that is inside it in your favorite XML editor. SharePoint Designer works great for this, as there is a quick utility to clean up the XML off of your right-click context menu to Reformat XML.

image

Once you have a nice clean view, do a search for <Data>, and you will then see the <Data> which you can then paste into your ListInstance element within your solution, and you have your data rows from your list, which will be added into the list when the list instance is created.

Copy everything within the <Data> element, including the <Data> tags, starting here (see below), and you should be good to go.

image

I generally trim off all of the fields that are not needed, and just keep my fields which I am using, for example, in the above, just trimming out everything but my fields. Which should generally all appear at the top of the <Row> element, as shown below.

image

All of the system fields will be generated automatically, and you do not run the risk of trying to push data into a list that is not supported, such as Created By field authors not being in the sites or farms where these are deployed to, or specifying the Attachment when the resulting list does not support them, you may receive an error on feature activation.

I am eventually planning to write a PowerShell script, or an executable to take care of this, and when I do, I will post about it here, and publish it to our CodePlex site.

 

3月20日

Extending SharePoint Designer Workflows

Building out workflows using SharePoint Designer is a great way to create basic, and even complex workflows for SharePoint without having to know C# or VB, or ever having to open Visual Studio. Sure, there are some drawbacks, such as ease of reusability, but, this extends the power of SharePoint down to non-developers to be able to drive business processes in SharePoint.

Like SharePoint itself, SharePoint Designer built Workflows can be extended as well, to create custom actions to do more with SharePoint Designer workflows than what comes out of the box.

The main point of this post is to direct you to two great projects on CodePlex that have done just that:

Both of these projects fill some of the voids with SharePoint Designer workflow actions, such as the ability to send emails with file attachments or list item attachments, start another workflow.

 

Programmatically Disabling or Enabling Site Search Visibility

The following code snippets are from a web part I built for a client, to assist them with generating new sites. There were new sites being created a few times a day, that all needed to follow similar configurations, but, were all based on the blank site template. Security and other things needed to be modified easily from a single, central interface, which only Site Collection Administrators could access. Each site had to follow several different business rules, and almost every one needed to apply a different set of these, so thus, the web part was created to handle this, as creating site definitions for every possible outcome of the business rules, would have required a new site definition for almost every one of the hundreds of sites that were being created.

One of the thing they needed to be able to manage from their initial configuration, is to be able to allow or not allow search visibility into that site.

The following code snippet will allow you to do just that. (web below is a reference to the specific SPWeb object). Some definition, as well as links to the WSS 3.0 SDK are below the code snippet.

   1: web.AllowAutomaticASPXPageIndexing = true;
   2: web.ASPXPageIndexMode =WebASPXPageIndexMode.Always;
   3: web.NoCrawl = false;
   4: web.Update(); 

By setting AllowAutomaticASPXPageIndexing to true, this will allow indexing of the ASPX pages within the site by the search crawler.

ASPXPageIndexMode specifies the type of page indexing that will occur. Check this reference in the WSS 3.0 SDK which specifies all values possible for WebASPXPageIndexMode. By setting this to Always, ASPX page indexing is always enabled.

Setting SPWeb.NoCrawl, if set to false, will allow crawling of the site.

Now, using the combination of the three above, this will allow indexing of everything, including the ASPX pages within the site to be crawled. If you wanted to crawl everything else within the site, however, did not want to crawl the ASPX pages themselves, you would use the following:

   1: web.AllowAutomaticASPXPageIndexing = false;
   2: web.ASPXPageIndexMode =WebASPXPageIndexMode.Never;
   3: web.NoCrawl = false;
   4: web.Update(); 

 

Web Part Gallery Permissions – Something to think about…

A common configuration for my clients is to have an external facing site collection, which aggregates project sites for their vendors and customers that they interact with to collaborate on projects, for example: https://partners.company.com. Where each of the sub-sites below the top level site have specific permissions configured to only allow the external users related to a particular project only into those sites, so those users have no idea what other clients, vendors, etc., you are managing sites for.

There are some sites which are extremely customized from a basic project style template, and/or site definition, and for those sites, there may be quite a few sub-sites. In those cases, it usually makes sense to put reusable web parts into the web part gallery for that site collection, to make them easy to access.

For instance, a Content Query Web Part which displays data out from a source list with data that is relevant to all of those sites, or filtered to display some of the content out to different sites. Instead of rebuilding, or exporting/importing the web part each time, dropping it into the web part gallery makes access to it easy.

If you then give control to the external users of that site to add web parts to that site, they can then see those web parts, and even add them to their pages when attempting to add web parts to their sites. If you have these web parts grouped or named based on the client/partner/vendor/project, they will be able to see those names. Unless they have access however, they will not be able to view the content from those sites if the web part is pulling any data from them, thanks to security trimming.

So, if you are using those sorts of naming and grouping conventions with the web part gallery under this type of scenario, you may want to modify the permissions of those web parts in the gallery to only users who should be seeing them.

This can be done by going to the Web Part Gallery at the Site Collection Level, selecting the edit link of the web part, and clicking on the Manage Permissions link within the toolbar at the top of the edit page:

image

From there, select Edit Permissions from the Actions menu

image

And you can then add/remove permissions as needed, thus allowing you to limit exposure of clients/partners/vendors to those sites that should be seeing them.

 

3月10日

SharePoint List Type IDs

On twitter today, someone was looking for list type IDs, and this also comes in line with my session I am presenting at SharePoint Saturday in Boston this weekend (Introduction to Developing Custom Actions within SharePoint), so, I thought I would make a quick post about it, and also for my own reference as well. So, without further ado – here is the list of all of the internal SharePoint list identifiers for WSS 3.0. And, feel free to follow me on twitter - @gvaro

 

  List Id List Description
100 Generic list
101 Document library
102 Survey
103 Links list
104 Announcements list
105 Contacts list
106 Events list
107 Tasks list
108 Discussion board
109 Picture library
110 Data sources
111 Site template gallery
112 User Information list
113 Web Part gallery
114 List template gallery
115 XML Form library
116 Master pages gallery
117 No-Code Workflows
118 Custom Workflow Process
119 Wiki Page library
120 Custom grid for a list
130 Data Connection library
140 Workflow History
150 Gantt Tasks list
200 Meeting Series list
201 Meeting Agenda list
202 Meeting Attendees list
204 Meeting Decisions list
207 Meeting Objectives list
210 Meeting text box
211 Meeting Things To Bring list
212 Meeting Workspace Pages list
301 Blog Posts list
302 Blog Comments list
303 Blog Categories list
1100 Issue tracking

 

3月9日

Restoring SharePoint 2003 Document Library Items from a SQL Backup

I get asked this question almost weekly - “Is there any way to restore files from a SharePoint 2003 document library from a SQL backup?”

So – I thought I would make a post about it. Indeed there is – released by James Edelen several years ago – available from here: http://www.mindsharpblogs.com/james/archive/2005/01/20/189.aspx (I also have copies in my Live Drive – links below, in case these ever go away, as they have in the past).

There are two utilities here, SharePoint Database Explorer and SPExport. SharePoint Database Explorer will allow you explore a SharePoint farm hierarchy directly from the SQL database, and SPExport will allow you to export documents from a document library from a SQL database directly, to a locally accessible resource (computer, network fileshare, etc.)

Local copies of the utilities:
SPExport Binaries
SPExport Source
SharePoint Database Explorer Binaries
SharePoint Database Explorer Source

 

February “Uber” Cumulative Updates Packages Released for WSS 3.0 and MOSS 2007

Following my earlier post regarding the February Cumulative updates for WSS 3.0 and MOSS 2007, the referenced “Uber” packages have finally been released. These are the ones that should be installed, rather than the 2/25 release packages.

http://blogs.msdn.com/joerg_sinemus/archive/2009/03/09/february-cumulative-update-uber-package-for-wss-and-moss.aspx

 

2月25日

February Cumulative Update Packages Released for WSS v3 and MOSS 2007

Yesterday, Microsoft released the February Cumulative Updates for WSSv3 and MOSS 2007. More information, as well as links to obtaining the hotfix packages can be found here: http://blogs.msdn.com/joerg_sinemus/archive/2009/02/25/february-cumulative-update-for-wss-v3-and-moss-2007.aspx

WAIT WAIT WAIT!!! BEFORE YOU GO INSTALLING.... [UPDATE 2.27.09]

The Microsoft SharePoint Team posted a note regarding these updates, there is apparently an "uber" (as they put it) February Cumulative Update coming out within the next few weeks. You can read the note they posted for yourself here - http://blogs.msdn.com/sharepoint/archive/2009/02/26/is-it-time-to-apply-feburary-cumulative-update.aspx - basically stating to wait...

 

2月24日

Taking SharePoint Offline – What are the Options?

The UK SharePoint Consulting Services team posted some great information to their blog last week regarding options for taking SharePoint offline with Microsoft Office products – it’s a good read with good details on options for working with content when you are not connected to your SharePoint environment.

http://blogs.msdn.com/uksharepoint/archive/2009/02/19/taking-sharepoint-files-offline-what-product-s-should-you-use.aspx