Tuesday, December 15, 2009

Configuring User Profiles in Sharepoint 2010 beta 2 in the enterprise

This gives an interesting walkthrough for configuring user profiles. (Despite 5 installs of a Sharepoint 2010 its still not quite right).

Ive found this is a very tricky and time consuming process fraught with problems and Kathy's notes are very helpful.

in reference to: Kathy Hughes, MVP (view on Google Sidewiki)

Wednesday, October 14, 2009

Running SSIS packages from a web page

I need to run a simple aspx page on a SQL server to run an SSIS package so that users could kick off the process without having access to the SQL admin tools.

The following C# class in an asp.net page runs brilliantly on the SQL 2008 server

static void CallSSIS()
{
string pkgLocation = @"E:\VS Projects\\Sandbox.dtsx";
Application ssisApp = new Application();
Package ssisPackage = ssisApp.LoadPackage(pkgLocation, null);
DTSExecResult ssisPackageResults = ssisPackage.Execute();
}


The only major problem I had was publishing the web to a virgin Windows 2008 with IIS7 machine. When I browsed to the page it gave the following error "This configuration section cannot be used at this path".

After hours of head scratching and missleading web articles, it turned out that the ASP.NET is not installed as a ROLE in by default.

Server Manager -> Roles -> (scroll to Web Server (IIS)) -> Add Role Services -> ASP.NET

Volia!

Monday, October 12, 2009

Symantec System Center - Cant unlock server group

I was asked to look at unlocking a Windows 2003 Server Symantec System centre whos documented name and password didnt work.

If you a) update the "user-admin-p" registry entry -
HKEY_LOCAL_MACHINE\SOFTWARE\Intel\LANDesk\VirusProtect6\CurrentVersion\Accounts (more details here)


and then b) run the iforgot.exe program in the Program Files\Symantec\Symantec System Center\Tools folder

then you can reset the user account's password.

Sunday, August 16, 2009

Setting wss 3.0 site anonymous access

A couple of years ago I setup a secure WSS 3 web application which I now wanted to publish so that everyone (anonymous) could see it, however I couldnt find out how to do it.

Following the Microsoft guidance article it suggests Site Actions -> Users and Permissions -> Advanced Permisions -> Settings and then click on Anonymous access, however the option just wasnt there !

Further investigation reminded me I needed to make sure that my "authentication providers" needs to be set to support anonymous as otherwise its not an option to choose in menu above. To set this up go to Web Application Management -> Application Security -> Authentication Provider, choose the Zone you wish to edit and then make sure "enable anonymous access" is checked and save this setting.

Now go back to the first stage on the Advanced Permissions -> Settings drop down and voila, you can set anonymous for site, list level or none as you require.

Monday, August 10, 2009

Updating Windows 2008 Domain Account Policies

Whilst passwords meeting complexity requirements is all well and good in a production environment it is a pain in a development one. I have a Windows 2008 standard AD Domain Controller and and I needed a number of system accounts which I really didnt want to have to bother of recording complex passwords.

To change these settings is not intuative, however this is what I found:

To turn password complexity off in Windows 2008 Server or change other grayed out security options, follow these steps:
(1) Run gpmc.msc (Group Policy Management)
(2) Expand your Domain
(3) Go to Group and select Default
(4) Right click on Default Domain Policy or Default Domain Controllers Policy and choose Edit
(5) In the new window which opens expand computer Configuration->policies->windows settings->security settings->account policies->password policies
(6) Make your edits to the keys below:

There must be an easier way, which I am problaby missing !

Tuesday, July 28, 2009

C#3 anonymous types, parameters and LINQ for XML

Crash learning to work with LINQ XML (see sample code below to get a distinct list from an XML file written by a reporting services report) re-introduced me to a really usefull feature of C#3 called anonymous types where you can create an object on the fly. You can then use that object in the same method, however if you wish to pass it to another method then things start getting complicated. This blog note Anthony Steele's Blog : C#3 anonymous types as parameters points you in the right direction to whats possible.

(He also mentions a very good book on C#3 (by Bill Wagner) to hone your skills)


Note: as a learning LINQ is a lot of trial and error you can test your LINQ code in a very helpful utility called:http://www.linqpad.net/

Sample LINQ code
XDocument xDoc = XDocument.Load(@"c:\temp\RSD.xml");
var q = (from e1 in xDoc.Descendants("{SchemaName}Detail").Distinct()
let div = e1.Attribute("Division").Value
let cc = e1.Attribute("CostCode").Value
select new { div, cc }).Distinct();

q.Dump(); //this shows you the contents of q

Monday, July 13, 2009

Integrating External Document Repositories with SharePoint Server 2007

Whilist loading documents into Sharepoint from existing file shares is a good option it is often time consuming and here is an interesting article showing how you can link existing exteral document libraries with sharepoint Integrating External Document Repositories with SharePoint Server 2007:

Saving Reports to SharePoint using WebDav from Windows 2008

I was having difficulty getting Enterprise Reporting Services to run a data subscription (running on Windows 2008) to save reports into a Sharepoint Document library using a URL.

I found that Windows 2008 does not install the required WebDav Client (Not to be confused with the additional IIS7 WebDav Server addon) .

You can install this client by Adding the "Desktop Experience Feature" on Windows 2008, however this also installs lots of other things that you probably dont want and Ive not found a way to only install WebDav Client support.

After a server re-boot it works well and talks to Sharepoint Document Libraries, My thanks to the following article for assistance. Browsing SharePoint using WebDav from Windows 2008 « In The Mix

Friday, April 10, 2009

Chaks' Corner | WCF and Sharepoint - System.IO.FileNotFound Exception

Writing a WCF Sharepoint handler I had a great deal of trouble wondering why SPSite host = new SPSite(http://localhost..../) was giving a Web application could not be found error. The URL opened fine in a browser.

The answer appears to be security related where the WCF service doesnt seem to have enough permission to get to the local sharepoint server. One workaround which seems to work is to set the WCF Application Pool permissions to the same as the Sharepoint Application Pools. Im not sure its elegant but until I find a better way this seems to work. Thanks to the following blog: Chaks' Corner WCF and Sharepoint - System.IO.FileNotFound Exception

Monday, March 02, 2009

How to fix issue with Symantec Endpoint client not installing due to a required reboot. | Shnake's Tech Tips

I needed to remove my old Symantec AV and install Symantex Endpoint Protection, however the installer kept saying there it would not install due to pending reboot actions - even after four reboots !

My thanks to the following link who shows the relevant registry to sort this problem out.

Thursday, February 26, 2009

SharePoint Documents in "Checked Out" limbo mode after upload from explorer with mandatory fields not completed

We have been uploading documents into SharePoint from the file system by dragging and droping them from Explorer, and we could'nt work out why they were being shown as "Checked Out" even though the Version Control settings were set to not use "Check-in/Out".

The reason turns out to be related to mandatory fields being by passed by the Explorer upload method. If you load a document via the filing system and a mandatory field is not completed then Sharepoint leaves the document in a “Checked Out” state. However you cannot “Discard the Checked Out” state because no document has been “Checked In” in the first place !

So you have the situation where a document is in limbo – not checked in or checked out but only visible for the user who loaded the document to complete the mandatory fields.

BUT even if you do complete these fields – it would seem that Sharepoint keeps the document in the limbo state and won’t allow you to do anything with them unless you fully check them in.

AND the problem is that SharePoint doesn’t have a “bulk check-in” function!

Reference: Automatically checkin files after uploading « SharePoint, ASP.NET and more

Binding Excel 2007 values using (DIP) Server Document Properties to Sharepoint- Not Simple or Intuitive

We had a requirement to link values entered in Excel 2007 cells so that when they were saved to a Sharepoint Document library those values were seemlessly displayed Document library as fields.

This functionality is handled much more easily by Word 2007 - see these excellent articles (DIP Metadata and Word 2007 Custom Doc Properties) - but Excel 2007 doesnt seem to share this functionality out of the box.

It turns out that there are 3 types of Metadata Properties in Excel 2007 (where WB is the ThisWorkbook object in this example):
  • WB.BuiltinDocumentProperties
  • WB.CustomDocumentProperties
  • WB.ContentTypeProperties

To access this Mata data visually use the Excel "Office button" -> Prepaire -> Properties menu. Choosing "advanced properties" gives you access to both add new custom properties and the built in properties. You can assign fixed text values to them or link them to named ranges within the sheet, however you cannot get to the Server Document Properties from this dialog.

ie the XL-> Custom Properties GUI only gives you access to the following Property sets (and of course these aren't what you need for Sharepoint)

  • WB.BuiltinDocumentPropertiesSet
  • WB.CustomDocumentPropertiesSet

To update the data which will feed back to Sharepoint fields you need to use code to get to the WB.ContentTypeProperties object which has a type of "MetaProperties".

The WB.ContentTypeProperties object is a collection which can be iterated through and each field has an ID and Name and a Value. The ID is an internal value and seems to Map to the same internal name as that of the Sharepoint field it is connected to.

{Note: the internal field names can lead to some confusion such as where a field with a Name of "col1" seems to create an internal ID name of "_x0063_ol1" and a field with a Name of "Project Lead Finance" has an internal ID name of "Project_x0020_Lead_x0020_Finance". This is normal Sharepoint practice!}

Using macro code to set the values of a MetaProperty in this way seems to trigger an event in the Server Document Properties DIP (Document information Panel) to update the field value to the new value you've set. {Note: The DIP is an InfoPath based piece of XML which displays fields in Office 2007 applications. It may be possible to code against it to achieve a more automated link to native Excel custom properties but I haven't had a chance to look at that yet}

Below is a very simple piece of code to set a Server Document Property to the value of cell A1:

Sub SetServerProperties()
Dim WB As Workbook
Set WB = ThisWorkbook
For Each Prop In WB.ContentTypeProperties
If Prop.Name = "Project Lead Finance" Then
Prop.Value = Range("A1").Value
End If
Next Prop
End Sub

Using macro code has the disadvantage of Excel documents having to be saved as XLSM documents and I am sure there must be a way to trap an update event of an standard Excel Custom property using something like VSTO, however that is for another post.

{Note: for Excel 2003 just updating the fields in WB.CustomDocumentPropertiesSet before a save does seem to pass them back to Sharepoint ok}

My thanks to an article published by Sadalit Van Buren who pointed me in the right direction with this article A Matter Of Degree: XML Mapping of Document Properties with Excel and SharePoint - Not Simple or Intuitive

Wednesday, February 04, 2009

Sharepoint Permission levels and permissions

Ive been working on setting Sharepoint permissions programmatically at a document level and found an interesting article below:

One of the things we noticed last week was that if you set the permissions on a single folder or document for someone who is not already in the document library, sharepoint adds them to the document library permissions root with [Limited Access].

The full article is here http://office.microsoft.com/en-us/sharepointtechnology/HA101001491033.aspx. , but in summary:

Limited Access


The Limited Access permission level is designed to be combined with fine-grained permissions to give users access to a specific list, document library, item, or document, without giving them access to the entire site. However, to access a list or library, for example, a user must have permission to open the parent Web site and read shared data such as the theme and navigation bars of the Web site. The Limited Access permission level cannot be customized or deleted.
Note You cannot assign this permission level to users or SharePoint groups. Instead, Windows SharePoint Services 3.0 automatically assigns this permission level to users and SharePoint groups when you grant them access to an object on your site that requires that they have access to a higher level object on which they do not have permissions. For example, if you grant users access to an item in a list and they do not have access to the list itself, Windows SharePoint Services 3.0 automatically grants them Limited Access on the list, and also the site, if needed.

Referencing Sharepoint Assemblies on x64bit Installs causes build errors for ASP.NET apps (in VS.NET 2008)

Debugging a WCF application on a 64 bit server using VS2008 gave me odd errors where sharepoint.security.dll could not be loaded - it turned out that you have to use the 32bit version of the microsoft.sharepoint.xxx.dll libraries - see the following article.

robgruen's WebLog : Referencing Sharepoint Assemblies on x64bit Installs causes build errors for ASP.NET apps (in VS.NET 2008):