Get ‘em while they’re hot! Visual Studio 2010 SharePoint Power Tools plus a sandboxed compilation to ensure you’re not accidentally calling outside of the allowed set of types and members.
Follow me on Twitter
My TweetsCatgegories
Get ‘em while they’re hot! Visual Studio 2010 SharePoint Power Tools plus a sandboxed compilation to ensure you’re not accidentally calling outside of the allowed set of types and members.
If you’re using the excellent SPServices library to wrap up access to the SharePoint web services from JavaScript, good stuff!
If, like me, you want to query a View on a given list you’ll need to pass the Guid of the view as the viewName parameter. Using the display name will give you the error: Parameter viewName is missing or invalid. 0x82000001
To resolve this you’ll need to call the GetViewCollection method for a given list and then parse the result to find your Guid. I’m a total newbie to jQuery and client side scripting so I found this a little tricky to get right, but I got there. So, here’s a helper for you use:
function ResolveListGuidFromName(webUrl, listName, viewName){
var guid;
var filter = "View[DisplayName='"+ viewName +"']";
$().SPServices({
operation: "GetViewCollection",
async: false,
webURL: webUrl,
listName: "Votes",
completefunc:function (xData, Status) {
guid = $(xData.responseXML).find(filter).attr("Name");
}
});
return guid;
}
Not too bad for my first hack at this stuff.
If you’re a SharePoint developer like me, chances are that the dev server you’re working on is joined to a different domain from your corporate identity. Now this makes it tricky to add users to your TFS Security Groups from inside of Visual Studio as you can’t browse the AD users on your corporate domain
Thankfully there is a handy command line tool that you can use called TFSSecurity.exe, by default you can find it in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
What you need to run is:
TFSSecurity.exe /collection:http://<serverUri>:<port>/<virtualDirectory>/<collectionName>/g+ “[<projectName>]\<group>” n:”<DOMAIN>\<user>”
Replace everything in angle brackets with the values that match your environment. As a rule of thumb for default install the virtual directory is tfs, the port is 8080 and the collection is default. So to add INTERGEN\Gavinb to project Awesome as a contributor the command looks like this:
TFSSecurity.exe /collection:http://tfsserver:8080/tfs/default /g+ “[Awesome]\Contributors” n:”INTERGEN\gavinb”
Today I learned that the new password policy for Office 365 specifies an upper limit on password length.
Yes, that’s right folks, some special person decided that passwords for Office 365, and therefore Exchange Online, should be 8-16 characters in length. As for why I have no idea.
Personally I think an upper limit on password length is retarded. I currently use a password scheme based on a short meaningful phrase which often results in passwords of over 16 characters.
According to my friend in our IT services team this limitation is not in place for those people who are using ADFS, so I guess the takeout here is ADFS is good, and as far as Office 365 goes, you can be “too secure”
A workmate of mine just recently used the SharePoint Easy Setup Script to setup a Windows 7 machine for SharePoint development. Upon trying to browse newly created Web Applications with host headers he was prompted to authenticate but these authentication attempts always resulted in a 401.1 error.
It turns out that the easy setup scripts don’t disable the loopback check. Luckily that has a well documented and easy fix which can also be done via PowerShell.
So you want to serve up some video content and use the <video> tag? Cool!
You want to do it using video files you have in SharePoint? Cool, that shouldn’t be too hard.
Unfortunately out of the box SharePoint 2010 is going to serve that video file out of the document library with a MIME Type of application/octet-stream, which IE and Firefox are not going to recognise as playable video. Chrome seems to be inspecting the file and determining the file type itself so video plays in that browser without needing a correct MIME Type sent from the web server.
I’m not going to get deeply into the ins and outs of the codec nightmare (ugh). Expect to say, there are some good free tools for encoding your video as H.264. I like x264 for a command line tool or H.264 Encoderif you want a GUI. I’m not discussing WebM as I didn’t need to create videos using that encoding for the piece of work that generated this blog post.
If you’re after a hand on the front of generating your HTML, check out Video for Everybody. One of my big complaints is that there is nothing laid down in the spec to require a “full window” mode control, the individual browsers may provide this control, but at this stage IE, Firefox and Chrome don’t . If you’re looking to provide something on this front, then I’d suggest using VideoJS
So assuming that you have that all sorted there are a couple of steps to make SharePoint serve the content in a manner that a browser can use, so don’t just stand there, let’s get to it.
Yes, I’m only covering the .mp4/H.264 case, just repeat Step 1 tweaking for WebM/Ogv
1. From the Start menu, enter inetmgr in the search box and press Enter. An instance of the IIS Management Console will start.
2. Select the server node, in the Features View locate the MIME Types feature in the IIS Group and double click on it.

3. In the Actions pane click Add…
4. Fill in the form providing .mp4 as the File name extension and video/mp4as the MIME Type and click OK

5. Close the IIS Management Console.
1. From the Start Menu, select All Programs | Microsoft SharePoint 2010 Products | SharePoint 2010 Central Administration. Under Application Management select Manage web applications.
2. Select the desired web application in the list.
3. Click on General Settingsin the ribbon.
4. Scroll down and find the Browser File Handling section, change the selection to Permissive, scroll to the bottom of the dialog and click OK.

5. Close the browser window.
6. You now need to reset IIS. Open and command prompt and enter run the iisresetcommand.
BOOM!
You’re now serving video files in a manner that all the major browsers should be able to play them when used as a <source> element in the <video> tag!
So, I’m running Windows Server 2008 R2 aka Win7 Server. I installed IE 9 but none of the videos on the Video Format Support Page are playing?
WTF? That page is from Microsoft to show off the HTML5 support in IE9.
Turns out that I’m missing the codecs for H.264 and AAC which are bundled in the Desktop Experience feature, which, on Server 2008 R2 is missing these codecs.
Easy fix though, Microsoft have an update for the Desktop Experience on Server 2008 R2, download, install and you’re laughing at silly HTML5 videos ![]()
So SharePoint 2010 Service Pack 1 is available for Download.
The SharePoint team are also shipping a June 2011 CU with a bunch of fixes that didn’t get into SP1 and it’s “ strongly recommended to install the June 2011 Cumulative Update immediately after the installation of Service Pack 1.”
More detail over on the SharePoint blog: http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?pID=984
Also included are a few FAQs.
So, what’s in SP1?: Check out Andrew Connell’s post about What’s New In Service Pack 1, this of course is additional to all the hot fixes and previous CUs that are bundled into the service pack.
From time to time you need to execute a given SharePoint timer job now. Sure you could go into Central Admin, find it and run it manually, but where’s the fun in that? Plus sometimes you need to automate this, say in an install scenario.
Luckily it’s dead easy using the SharePoint cmdlets
Heck you can do it in a couple of lines with some pipelining.
$WebApp = Get-SPWebApplication http://mywebappurl
$job = Get-SPTimerJob | ?{$_.Name -match $JobName} | ?{$_.Parent -eq $WebApp}
Or if you’d like to be a bit more robust and re-usable:
function StartJobOnWebApp
{
param([Parameter(Mandatory=$true, ValueFromPipeline=$true, Position=0)]
[Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind]
$WebApplication,
[Parameter(Mandatory=$true, ValueFromPipeline=$true, Position=1)]
[string] $JobName)
process
{
$WebApp = $WebApplication.Read()
$job = Get-SPTimerJob | ?{$_.Name -match $JobName} | ?{$_.Parent -eq $WebApp}
if($null -ne $job)
{
Write-Host -ForegroundColor Yellow "Starting "$job.DisplayName
Start-SPTimerJob $job
}
}
}
So, people are using the Windows Phone 7 browser now, I’m one of them; I love my WP7. Anyway OOTB SharePoint doesn’t recognise the this as a mobile browser. So I had to edit the compat.browser file ( %WebAppRootDir%\ App_Browsers\compat.browser ) to make SharePoint recognise this browser as a mobile one.
After I had a few trial and error attempts I thought that you all might like to see what a valid setting for this looks like:
<!-- Case: Windows Phone 7 phone using MSIE--> <!-- User Agent: IE Mobile --> <browser id="WP7" parentID="IE6to9"> <identification> <userAgent match="Windows" /> <userAgent match="Phone" /> <userAgent match="OS" /> <userAgent match="7.0" /> </identification> <capabilities> <capability name="isMobileDevice" value="true" /> </capabilities> </browser>