Wednesday, September 1, 2010

Where is disco.exe?

Just been searching for this web service tool, so to save the effort of the hunt next time, here's the location of the folder holding the file:

C:\Program Files\Microsoft SDKs\Windows\V6.0A\Bin\disco.exe

Monday, August 30, 2010

PowerShell PS1 File Not Recognised as the Name of ....

Annoying wee behaviour - if calling a PowerShell file from a batch file, it seems that even if the BAT and PS1 files are in the same folder, and the BAT file has changed the current path to be that folder, it is still necessary to include the whole path to the PS1 file in the -command call.

The statements
cd [the folder path]
powershell -command "&{.\test.ps1}"
didn't work, whereas the following does work:
cd [the folder path]
powershell - command "&{[the folder path]\test.ps1}"

Tuesday, July 27, 2010

SP2010 - Get the Item ID from the OpenPopUpPage Link

Just wanted to record here a simple little jQuery script useful for retrieving the item ID from the OpenPopUpPage hyperlink that is rendered for lookup column values in a Data View Web Part in SharePoint 2010. The useful thing about this is that you can then manipulate the action of the hyperlink to pass this item id to a different page - without having to look at changing the field type in any way.

The lookup field is rendered in a DVWP with the following onclick action:

OpenPopUpPage( 'http://blah/_layouts/listform.aspx?PageType=4&ListId={FFFC7FEA-62B2-459F-9D1B-80B6CA3608FF}&ID=23&RootFolder=*', RefreshPage);


The XSL (in the DVWP) that is rendering this lookup value is as follows:


Trust Partner:





[An aside: "table-based HTML?" you may ask. Well, sometimes expedience wins over web standards, though I am usually a standards-based advocate!]


The jQuery script to extract and use the item ID is:

$(function() {
$('.linktoentitydetails').each(function() {
var $link = $(this).find('a');
var href = $link.attr('href');
if (href != '') {
var itemIdMatches = href.match(/.*&id=(\d+)&.+/i)
if (itemIdMatches.length == 2) {
var itemId = itemIdMatches[1];
$link.removeAttr('onclick');
$link.attr('href', 'persondetails.aspx?eid=' + itemId);
}
}
});
});

So, in this case, I am replacing the OpenPopUpPage hyperlink action with a simple link to a custom page (persondetails.aspx) on which I can present other information about this linked item.

Saturday, May 29, 2010

SharePoint Connection Error in Visual Studio 2010

When running Visual Studio 2010 on a Windows Server 2008 R2 / SQL Server 2008 / SharePoint 2010 development box, even though the logged-in account has local admin rights on the server, I still experienced a SharePoint Connection Error in Visual Studio 2010 on that same Virtual Machine. The text in the error dialog states that "the local SharePoint Server is not available".

Seems the error is caused be the logged-in account having insufficient rights against the SharePoint databases. Log into the SQL Server using the administrator account, and grant rights to the developer account; db_owner rights on the SharePoint configuration and admin database is reported to be sufficient -but as in this instance I was dealing with a development virtual machine, I opted for the easy route of granting sysadmin role to the dev user account :-)

Thursday, May 6, 2010

SPServices Error With GetListItems Call

If you get an error similar to "Guid should contain 32 digits with 4 dashes" when making an SPServices Web Service call to the GetListItems operation, check the premissions on the list you are querying - I got this error returned from the call, and found that the list permissions were set so that the current user did not have read permissions.

Granting read access to the user instantly removed the issue :)

Wednesday, March 17, 2010

SharePoint Error for One User - The File Exists

Today had an interesting support issue to investigate. Of all the users on a SharePoint intranet, one person was unable to upload documents - each attempt to upload a document to a document library resulted in the "Access Denied" page. And the ULS log revealed little of value even in verbose mode.

The other strange thing was that this user is configured as the site collection owner, and was able to create document libraries fine. But then could not add a document to the document library he had just created!

Finally got some clues when I removed that account from the site owner SharePoint group (just in case that group was causing the behaviour). When I tried to add the account back to that group, an error page displayed with the useful(?) message "The file exists (Exception from HRESULT: 0x80070050)". At least that helped to confirm that the issue was in the user account.

A bit of research revealed this post on the subject - seems likely that the SID for the account has changed at some point. The described fix is to modify the SID in one of the SharePoint database tables. That's a bit of a worry, given that fiddling with the database content is like confusing a Kiwi accent for an Australian - to be avoided. But it may be the only approach available. Let me know if you try it out and it works for ya.

Tuesday, March 2, 2010

Roadblocks in the Install of Server 2008 R2 and SharePoint 2010 Beta

First up in my path to getting SharePoint 2010 running in a Hyper-V VM was the case of the missing roles in Windows Server 2008 R2, caused by a Windows update that failed to install.

For some unpleasant reason, KB971468 had failed to install correctly, following the cancellation of the install of KB890830 (the windows update panel had stopped mid-install, and the progress bar just stayed where it was). The outcome of this was that no roles displayed in the Server Manager - instead just an error message.

With the help of some worried searching, I came across this article by Glafkos Charalambous explaining the fix - use the System Update Readiness Tool from Microsoft to discover the faulty update files, then manually extract those files from the relevant update packages and copy them to the updates folder.

Once I had replaced the bad MUM files (wonder if there are DAD files anywhere in the system, too??), then I couls rerun the other updates that were marked as failed in the Windows Update History.

Hey, honey, I got my roles back!