I finally got around to registering for a SP2013/O365trail dev account:
http://msdn.microsoft.com/en-US/office/dn448479
The first thing I noticed was the nice metro style tiles on the landing page that even changes colour in accordance to the sites theme. I wanted to know how to add my own, so I started fiddling and found a hidden Promoted Links list called GettingStarted.
I merely added my own entry to the Promoted Links list.
Note: If you give your image a transparent background it will use the colour of the current theme.
All Promoted Links lists have a metro view by default, you can create your own by adding the Promoted Links app to your site, it can be found under Site Contents > Your Apps > Promoted Links.
Monday, October 7, 2013
Friday, September 27, 2013
Microsoft SQL Server 2012 Setup Error When Enabling NetFx3 With Error Code: -2146498298
Installing SQL Server 2012 on Windows Server2012 for SharePoint2013.
"The following error has occurred:
Error while enabling Windows feature: NetFx3, Error Code: -2146498298, Please try enabling Windows feature: NetFx3 from Windows management tools and then run setup again. For more information on how to enable Windows features, see http://go.microsoft.com/fwlink/?linkid=227143"
Now retry the SQL setup.
"The following error has occurred:
Error while enabling Windows feature: NetFx3, Error Code: -2146498298, Please try enabling Windows feature: NetFx3 from Windows management tools and then run setup again. For more information on how to enable Windows features, see http://go.microsoft.com/fwlink/?linkid=227143"
To fix manually install/enable dotNet3.5 feature.
Now retry the SQL setup.
Tuesday, September 17, 2013
Nintex Workflow 2010 Installation Failed with Access Denied for My Computer Zone
When attempting to install NintexWorkflow2010 for the SharePoint2010 Contoso farm on WindowsServer2008 the installation was failing, with 'Access denied' to the 'MyComputer' assembly zone.
This error was due to the UAC (User Account Control) being enabled for the administrator account that the installation was running under.
Once done set the UAC back to what it was.
This error was due to the UAC (User Account Control) being enabled for the administrator account that the installation was running under.
The fix:
- Log into the SharePoint Application Server
- Open up Control Panel,
- Go to User Accounts
- Click on the ‘Change User Account Control settings’ link.
- Move the slider down to 'Never notify'
- Click ‘Ok’
- Click 'Yes'
Once done set the UAC back to what it was.
Friday, May 17, 2013
How to create an event handler for sharepointmoss 2007
The easiest ways is to download and install WSP Builder from codeplex its a visual studio plug in that adds the correct confirmations, using statements, mapped folder paths, overrideable functions, future scope, etc. for you by right clicking and adding a event to your project you can also us it to build your WSPs, deploy to SP, cycle IIS and attach to the correct w3wp for debugging purposes. If however this is not for you, it is possible to do it 'manually' by following the following instructions.
Add the Microsoft.SharePoint reference and using statement to your newly create project.
Derive your class from SPItemEventReceiver
e.g. public class MyEventAction : SPItemEventReceiver
Override the required *ed or *ing function(s) out of the list required for your project:
ItemAdded
ItemAdding
ItemAttachmentAdded
ItemAttachmentAdding
ItemAttachmentDeleted
ItemAttachmentDeleting
ItemCheckedIn
ItemCheckedOut
ItemCheckingIn
ItemCheckingOut
ItemDeleted
ItemDeleting
ItemFileConverted
ItemFileMoved
ItemFileMoving
ItemUncheckedOut
ItemUncheckingOut
ItemUpdated
ItemUpdating
e.g.
Create a folder that syncs to the hive location under templates then features then create a folder with the name of the feature and in it create a xml file called Feature.xml
Update the Feature.xml to look sorting like the following.
Now create an Elements.xml file in the MyEventHandler folder that identifies the assembly, class, and method to implement as the event handler.
The Type attribute ListTemplateId is for the type of list this action applies to:
Save and build project.
Deploy using STSADM.
Then you will have to do and iisreset using cmd
For more information see:
http://msdn.microsoft.com/en-us/library/ms453149(v=office.12).aspx
Add the Microsoft.SharePoint reference and using statement to your newly create project.
Derive your class from SPItemEventReceiver
e.g. public class MyEventAction : SPItemEventReceiver
Override the required *ed or *ing function(s) out of the list required for your project:
ItemAdded
ItemAdding
ItemAttachmentAdded
ItemAttachmentAdding
ItemAttachmentDeleted
ItemAttachmentDeleting
ItemCheckedIn
ItemCheckedOut
ItemCheckingIn
ItemCheckingOut
ItemDeleted
ItemDeleting
ItemFileConverted
ItemFileMoved
ItemFileMoving
ItemUncheckedOut
ItemUncheckingOut
ItemUpdated
ItemUpdating
e.g.
public override void ItemAdded(SPItemEventProperties properties) { base.ItemAdded(properties); }
Create a folder that syncs to the hive location under templates then features then create a folder with the name of the feature and in it create a xml file called Feature.xml
Update the Feature.xml to look sorting like the following.
<Feature Scope="Web" Title="My Event Handler" Id="GUID" xmlns="http://schemas.microsoft.com/sharepoint/"> <ElementManifests> <ElementManifest Location="Elements.xml"/> </ElementManifests> </Feature>
Now create an Elements.xml file in the MyEventHandler folder that identifies the assembly, class, and method to implement as the event handler.
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <Receivers ListTemplateId="104"> <Receiver> <Name>MyEventHandler</Name> <Type>ItemAdded</Type> <SequenceNumber>10000</SequenceNumber> <Assembly>MyEventHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a26b5449ac4a4cf3</Assembly> <Class>MyEventHandler.AddedAction</Class> <Data></Data> <Filter></Filter> </Receiver> </Receivers> </Elements>
The Type attribute ListTemplateId is for the type of list this action applies to:
ID | Name |
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 |
300 | Portal Sites list |
301 | Blog Posts list |
302 | Blog Comments list |
303 | Blog Categories list |
1100 | Issue tracking |
1200 | Administrator tasks list |
2002 | Personal document library |
2003 | Private document library |
Save and build project.
Deploy using STSADM.
stsadm -o installfeature -filename MyEventHandler\Feature.xml stsadm -o activatefeature -filename MyEventHandler\Feature.xml -url http://Server/Site/Subsite
Then you will have to do and iisreset using cmd
iisreset -noforce
For more information see:
http://msdn.microsoft.com/en-us/library/ms453149(v=office.12).aspx
Tuesday, May 7, 2013
Installing SharePoint 2010 SSRS Web Part
About Report Explorer and Report Viewer
Report Explorer and Report Viewer are SharePoint Web Parts that were introduced in SQL Server 2000 Reporting Services Service Pack 2 (SP2).
Thy provide a way to view reports and explore the report server folder hierarchy from a SharePoint site.
Note: That customizing the Web Parts is not supported. The Web parts are intended to be used as is, and should not be extended or modified.
Report Viewer
Requirements for using the Report Viewer and Report Explorer Web Parts
Modes
Viewing Reports with SharePoint Web Parts can be done in 2 different ways called Native and SharePoint Mode.
SharePoint mode
If you want to access a report server that runs in SharePoint mode, use the web parts that are installed by the Reporting Services Add-in for SharePoint products. For more information about the add-in, see Overview of Reporting Services and SharePoint Technology Integration.
Native mode
If you want to access report server content on a SharePoint site from a native mode report server, use the SharePoint Web Parts Report Explorer and Report Viewer that are included with Reporting Services, installation instructions can be found below.
Installing
Where to get the cab file
By default Reporting Services 2008 R2 installs the RSWebParts.cab file into the following folder:
How to add it
Using the STSADM.exe tool found under 12hive bin, run the following command:
Using SharePoint 2010 Management Shell with administrative privileges on the computer that has the installation of the SharePoint product, run the following command:
Note: Specifying -globalinstall adds the Web Parts to the global assembly cache (GAC). This is only necessary if you want to connect the Web Parts.
More information can be found at: http://msdn.microsoft.com/en-us/library/ms159772.aspx
Report Explorer and Report Viewer are SharePoint Web Parts that were introduced in SQL Server 2000 Reporting Services Service Pack 2 (SP2).
Thy provide a way to view reports and explore the report server folder hierarchy from a SharePoint site.
Note: That customizing the Web Parts is not supported. The Web parts are intended to be used as is, and should not be extended or modified.
Report Viewer
- Report Viewer displays a report and provides a toolbar that you can use to navigate pages, search for content, or export the report.
- You can add the Report Viewer Web Part to a Web Part page to always show a specific report on that page or you can connect it to Report Explorer to display reports that are opened through that Web Part.
- Report Explorer connects to Report Manager on the report server computer. You can browse available reports on a report server and subscribe to individual reports.
- If Report Builder is enabled and you have sufficient permissions, you can start Report Builder from the Report Explorer Web Part.
- Report Explorer displays the contents of a folder using a page in Report Manager.
- Access to individual items and folders throughout the report server folder hierarchy are controlled through role assignments on the report server. When you select a report, it opens in a new browser window.
- The HTML viewer on the report server displays the report and provides the report toolbar, not the Report Viewer Web Part. If you want to customize the toolbar settings, be sure to specify the URL access parameters on the report server. For instructions, see Using URL Access Parameters.
Requirements for using the Report Viewer and Report Explorer Web Parts
- Report Manager must be installed.
- The report server version must be SQL Server 2005 Reporting Services or later.
- The report server must run in native mode. You cannot use the Report Explorer and Report Viewer Web Parts to connect to or view reports on a report server that runs in SharePoint mode. For more information about modes, see Planning a Deployment Mode.
- Report Explorer and Report Viewer Web Parts are distributed through a cabinet (.cab) file that is included with Reporting Services. Instructions for installing, configuring, and using the Web Parts are provided in the following sections of this topic.
Modes
Viewing Reports with SharePoint Web Parts can be done in 2 different ways called Native and SharePoint Mode.
SharePoint mode
If you want to access a report server that runs in SharePoint mode, use the web parts that are installed by the Reporting Services Add-in for SharePoint products. For more information about the add-in, see Overview of Reporting Services and SharePoint Technology Integration.
Native mode
If you want to access report server content on a SharePoint site from a native mode report server, use the SharePoint Web Parts Report Explorer and Report Viewer that are included with Reporting Services, installation instructions can be found below.
Installing
Where to get the cab file
By default Reporting Services 2008 R2 installs the RSWebParts.cab file into the following folder:
C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Reporting Services\SharePoint
How to add it
Using the STSADM.exe tool found under 12hive bin, run the following command:
stsadm -o addwppack -filename "RSWebParts.cab" -globalinstallYou should see a message of “Operation completed successfully.”
Using SharePoint 2010 Management Shell with administrative privileges on the computer that has the installation of the SharePoint product, run the following command:
Install-SPWebPartPack -LiteralPath "RSWebParts.cab" -GlobalInstallYou should see a message similar to the following, indicating the Web Part was deployed.
Note: Specifying -globalinstall adds the Web Parts to the global assembly cache (GAC). This is only necessary if you want to connect the Web Parts.
More information can be found at: http://msdn.microsoft.com/en-us/library/ms159772.aspx
Saturday, April 27, 2013
SharePoint 2010 Hierarchy
- SP Farm
- SP Service
- SP Web Application
- SP Content Database
- SP Site
- SP Web
- SP List
- SP List Item
- SP Field
http://msdn.microsoft.com/en-us/library/office/cc768619(v=office.14).aspx
SPFarm
The SPFarm object is the top node in the extensible configuration object model, which is designed to interact with the configuration data store. It contains global settings for all the servers, services, and solutions that are installed in a server farm. Use the Servers, Services, or Solutions property to retrieve these collections.
To access the current server farm object, you can use members on SPFarm.Local. For example, to return an SPServiceCollection object that represents the collection of services in the current server farm, use SPFarm.Local.Services. In addition, you can use the Farm property of classes that derive from the SPPersistedObject class, or you can use the Farm property of the SPSolution class, to get the server farm of the current object or solution.
SPService
To return the parent service of a service instance, use the Service property of the SPServiceInstance class. Use the Services property of the SPFarm class to return an SPServiceCollection object that represents the collection of services on the server farm. Use an indexer to return a single service from the collection using the GUID that identifies the service. For example, if the collection is assigned to a variable named myServices, use myServices[index] in C#, or myServices(index) in Visual Basic, where index is the GUID that identifies the service.To retrieve a single service from the collection by name, use the GetValue method. For example, if the collection is assigned to a variable named myServices, use myServices.GetValue
SPWebApplication
All servers that run the parent Web service (SPWebService) of the Web application must have a provisioned instance of the application. All instances of the application must be configured identically.
Various objects in the Microsoft.SharePoint.Administration namespace provide a WebApplication property through which you can access the containing Web application. Use the WebApplication property of the SPSite class to get the Web application that contains a site collection. To get the Web application of the current HTTP context, you can use SPContext.Current.Site.WebApplication.
Use the WebApplications property of the SPWebService class to return an SPWebApplicationCollection object that represents the collection of Web applications within a Web service. Use an indexer to return a single Web application from the collection. For example, if the collection is assigned to a variable named myWebApplications, use myWebApplications[index] in C#, or myWebApplications(index) in Visual Basic, where index is either the name or the GUID that identifies the Web application.
SPContent Database
Use the ContentDatabase() property of the SPSite class or of the SPWorkItemCollection class to return the content database for a site collection or work item collection. Use the ContentDatabases property of the SPWebApplication class to return the collection of content databases that are used by the Web application.
Use an indexer to return a single content database from a collection of content databases. For example, if the collection is assigned to a variable named myContentDatabases, use myContentDatabases[index] in C#, or myContentDatabases(index) in Visual Basic, where index is either the index number of the field in the collection or the GUID for the content database.
SPSite
To instantiate an SPSite object for a specific site collection on an ASP.NET page, or for a specific site collection within a console application.
Within an ASP.NET application, you can use the Site property of the SPContext class to return an SPSite object that represents the current site collection.
Use the Sites property of the SPWebApplication class to return an SPSiteCollection object that represents the collection of site collections in a SharePoint Web application. Use an indexer to return a single site collection from the collection. For example, if the collection of site collections is assigned to a variable named oSiteCollections, use oSiteCollections[index] in C#, or oSiteCollections(index) in Visual Basic, where index is either the display name or the index number of the site collection in the collection.
Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. If you create your own SPSite object, you can use the Dispose method to close the object. You can also instead implement a using statement so that the .NET Framework common language runtime (CLR) automatically releases the memory that is used to store the site collection.
However, if you have a reference to a shared resource, such as when the object is provided by the GetContextSite method in a Web Part, do not use either method to close the object. Using either method on a shared resource causes an Access Violation error to occur. In scenarios where you have a reference to a shared resource, instead let Microsoft SharePoint Foundation or your portal application manage the object.
SPWeb
Many methods and properties in the Microsoft.SharePoint namespace can return a single website. You can use the Webs property of the SPWeb class to return all the immediate child websites beneath a website, excluding children of those child websites. You can also use the AllWebs property of the SPSite class to return all websites within the site collection; or use the GetSubwebsForCurrentUser method of SPWeb to return all websites for the current user.
Use an indexer to return a single website from the collection. For example, if the collection is assigned to a variable named collWebSites, use collWebSites[index] in C#, or collWebSites(index) in Visual Basic, where index is the index number of the site in the collection, the display name of the website, or the GUID for the site.
SPList
A list consists of items or rows, and columns or fields, that contain data. The Items property returns the collection of items in the list, and the Fields property returns the collection of fields in the list. To improve performance, it is best practice to use one of the GetItem* methods to return a filtered collection of items from the list.
Various SPList properties, ParentList properties, and other properties or methods for classes in the Microsoft.SharePoint namespace return a list or collection of lists from a specific context. Otherwise, use the Lists property of either the SPWeb or SPList class to return an SPListCollection object that represents either the collection of lists in a site or the collection of parent lists for a list. Use an indexer to return a single list from the collection. For example, if the collection is assigned to a variable named collLists, use collLists[index] in C#, or collLists(index) in Visual Basic, where index is the index number of the list in the collection, the display name of the list, or the GUID of the list.
SPListItem
You can use an indexer to return a single item from a list item collection. For example, if the collection is assigned to a variable named collListItems, use collListItems[index] in Microsoft C#, or collListItems(index) in Microsoft Visual Basic, where index is the index number of the item in the collection, or the internal name or display name of a list field. For an indexer based on a name, Microsoft SharePoint Foundation first looks for the field by internal name and then by display name.
SPField
Use the Fields property of either the SPList class or the SPListItem class to return an SPFieldCollection object that represents the collection of fields for a list or list item. Use an indexer to return a single field from this collection. For example, if the collection is assigned to a variable named collFields, use collFields[index] in C#, or collFields(index) in Microsoft Visual Basic, where index is either the index number of the field in the collection or the display name of the field.
If you set properties of the SPField class and its inheriting classes, you must call the Update method for changes to take effect in the database.
Wednesday, April 17, 2013
Sunday, April 7, 2013
Online security with 2-step verification
What is 2-step verification:
2-step verification adds an extra layer of security for your online accounts and apps by requiring you to enter a verification code generated by an unique personal authenticator in addition to your username and password, when signing in to your account.
Why you should use 2-step verification:
2-step verification drastically reduces the chances of having the personal information of your accounts stolen by someone else. Why? Because 'bad guys' would have to not only get your password and your username, they'd have to get a hold of your authenticator as well.
Google:
http://support.google.com/accounts/bin/answer.py?hl=en&answer=180744
Lastpass:
http://blog.lastpass.com/2011/11/introducing-support-for-google.html
Dropbox:
https://www.dropbox.com/help/363/en
Facebook:
http://sevenlylabs.com/how-to-setup-2-step-verification-for-your-facebook-page/
Microsoft:
http://answers.microsoft.com/en-us/windowslive/forum/liveid-wlsecurity/two-factor-authentication-tfa-what-is-a-microsoft/79321863-cf01-44f3-a181-87f531c5129e
Paypal:
https://www.paypal.com/us/cgi-bin?cmd=xpt/Marketing_CommandDriven/securitycenter/PayPalSecurityKey-outside&bn_r=o
Add to your own code:
http://www.twilio.com/blog/2013/04/add-two-factor-authentication-to-your-website-with-google-authenticator-and-twilio-sms.html
2-step verification adds an extra layer of security for your online accounts and apps by requiring you to enter a verification code generated by an unique personal authenticator in addition to your username and password, when signing in to your account.
Why you should use 2-step verification:
2-step verification drastically reduces the chances of having the personal information of your accounts stolen by someone else. Why? Because 'bad guys' would have to not only get your password and your username, they'd have to get a hold of your authenticator as well.
Google:
http://support.google.com/accounts/bin/answer.py?hl=en&answer=180744
Lastpass:
http://blog.lastpass.com/2011/11/introducing-support-for-google.html
Dropbox:
https://www.dropbox.com/help/363/en
Facebook:
http://sevenlylabs.com/how-to-setup-2-step-verification-for-your-facebook-page/
Microsoft:
http://answers.microsoft.com/en-us/windowslive/forum/liveid-wlsecurity/two-factor-authentication-tfa-what-is-a-microsoft/79321863-cf01-44f3-a181-87f531c5129e
Paypal:
https://www.paypal.com/us/cgi-bin?cmd=xpt/Marketing_CommandDriven/securitycenter/PayPalSecurityKey-outside&bn_r=o
Add to your own code:
http://www.twilio.com/blog/2013/04/add-two-factor-authentication-to-your-website-with-google-authenticator-and-twilio-sms.html
Wednesday, March 27, 2013
Process Explorer
Process Explorer aka procexp, is a amazingly helpful little peace of standalone code. There have been so many scenarios that I would not have survived without it but now that I need to blog about it I realise theirs just to much to cover all of it without making it look like a one dimensional tool.
So I will just cover the basics, read more at:
http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
Introduction
Process Explorer shows you information about which handles and DLLs processes have opened or loaded.
Its display consists of two sub-windows.
The top window always shows a list of the currently active processes, including the names of their owning accounts, whereas the information displayed in the bottom window depends on the mode that Process Explorer is in.
If it is in handle mode,
you'll see the handles that the process selected in the top window has opened.
If it is in DLL mode,
you'll see the DLLs and memory-mapped files that the process has loaded.
Process Explorer has everything from a powerful search capability that will quickly show you which processes have particular handles opened or DLLs loaded to the useful unique capabilities such as tracking down DLL-version problems or handle leaks, and provide insight into the way Windows and applications work.
Ever wondered which program has a particular file or directory open or what sits behind a particular window or application? With Process Explorer you can now find out.
Download
Run Process Explorer now from Live.Sysinternals.com
Runs on:
Client: Windows XP and higher (Including IA64).
Server: Windows Server 2003 and higher (Including IA64).
Installation
Simply run Process Explorer (procexp.exe).
The help file describes Process Explorer operation and usage. If you have problems or questions please visit the Sysinternals Process Explorer Forum.
So I will just cover the basics, read more at:
http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
Introduction
Process Explorer shows you information about which handles and DLLs processes have opened or loaded.
Its display consists of two sub-windows.
The top window always shows a list of the currently active processes, including the names of their owning accounts, whereas the information displayed in the bottom window depends on the mode that Process Explorer is in.
If it is in handle mode,
you'll see the handles that the process selected in the top window has opened.
If it is in DLL mode,
you'll see the DLLs and memory-mapped files that the process has loaded.
Process Explorer has everything from a powerful search capability that will quickly show you which processes have particular handles opened or DLLs loaded to the useful unique capabilities such as tracking down DLL-version problems or handle leaks, and provide insight into the way Windows and applications work.
Ever wondered which program has a particular file or directory open or what sits behind a particular window or application? With Process Explorer you can now find out.
Download
Run Process Explorer now from Live.Sysinternals.com
Runs on:
Client: Windows XP and higher (Including IA64).
Server: Windows Server 2003 and higher (Including IA64).
Installation
Simply run Process Explorer (procexp.exe).
The help file describes Process Explorer operation and usage. If you have problems or questions please visit the Sysinternals Process Explorer Forum.
Sunday, March 17, 2013
Google Calendar - Repeating an event on the last of the month
I regularly attend Information Worker gatherings which occur on the last Thursday of every month.
I added a repeating Google calendar entry a wile back only to realise that in some months there were 5 Thursdays instead of 4 and my calendar event was actually set to repeat "Monthly on the fourth Thursday" and for the life of me I could not figure out how to change this.
I added a repeating Google calendar entry a wile back only to realise that in some months there were 5 Thursdays instead of 4 and my calendar event was actually set to repeat "Monthly on the fourth Thursday" and for the life of me I could not figure out how to change this.
After some frustration I manage to find the following ways of doing it.
Add the entry on an appropriate month, one with 5 Thursdays in my case.
A fairly easy way is to find a month that actually has 5 Thursdays and make the event start from there. This will set the recurrence to repeat "Monthly on the last Thursday", instead of "Monthly on the fourth Thursday".
Add the entry in the main calendar view using simple English.
The simplest way I found is to just write out the entire event in plain English as a single line of text using 'at' and 'on'.
For example:
This will create an event called "Information Worker Cape Town Community Night", with the 'Where' field set to Park 3, Engen House, Raapenberg Road, Mowbray, 7925" and the repetition set to "Monthly on the last Thursday".
Hack the ICS
This solution is probably the hardest, but because the ICalendar format does support this, you could write the code manually. To do this you would have to export the calendar to a file, hack it and import it back.
NOTE: If you're re-importing events from the same Google Calendar, do not delete the events in your calendar first. Simply import the file, which will make the necessary updates. Deleting all the events will cause you to not be able to import your file.
While it's nice to know this, seems like more effort than just typing what you want in English right?
A better way...
Perhaps Google can provide us with an additional option in the repeat popup to allow for this.
Or maybe the IW organisers should maintain there own calendar feed that we could all subscribe to. This would also mean that if a particular meeting gets moved or cancelled, all the subscribers calendars would automatically be updated!
- Add the entry on an appropriate month, one with 5 Thursdays in my case.
- Add the entry in the main calendar view using simple English.
- Hack the ICS
- A better way...
Add the entry on an appropriate month, one with 5 Thursdays in my case.
A fairly easy way is to find a month that actually has 5 Thursdays and make the event start from there. This will set the recurrence to repeat "Monthly on the last Thursday", instead of "Monthly on the fourth Thursday".
Add the entry in the main calendar view using simple English.
The simplest way I found is to just write out the entire event in plain English as a single line of text using 'at' and 'on'.
For example:
Information Worker Cape Town Community Night at Golf Park 3, Engen House, Raapenberg Road, Mowbray, 7925 on the last Thursday of every month
This will create an event called "Information Worker Cape Town Community Night", with the 'Where' field set to Park 3, Engen House, Raapenberg Road, Mowbray, 7925" and the repetition set to "Monthly on the last Thursday".
Hack the ICS
This solution is probably the hardest, but because the ICalendar format does support this, you could write the code manually. To do this you would have to export the calendar to a file, hack it and import it back.
NOTE: If you're re-importing events from the same Google Calendar, do not delete the events in your calendar first. Simply import the file, which will make the necessary updates. Deleting all the events will cause you to not be able to import your file.
While it's nice to know this, seems like more effort than just typing what you want in English right?
A better way...
Perhaps Google can provide us with an additional option in the repeat popup to allow for this.
Or maybe the IW organisers should maintain there own calendar feed that we could all subscribe to. This would also mean that if a particular meeting gets moved or cancelled, all the subscribers calendars would automatically be updated!
Thursday, March 7, 2013
Impersonation
Impersonation, a feature that was added in Windows SharePoint Services 3.0, enables you to perform actions on behalf of another user. Impersonation is useful in scenarios such as timer operations that need to update something asynchronously on behalf of a user or to run a high privilege code for a low privilege user.
You can either RunWithElevatedPrivileges to impersonate the System Account or by passing an User Token to the SPSite object to impersonate a specific user.
Note:
This is not to be used to perform long running processes as user tokens usually expire after approximately 24 hours.
RunWithElevatedPrivileges (impersonate the System Account)
Passing User Token (impersonate a specific user)
Get site context using the system account.
Then get the user token of the user you want to impersonate.
Finally use this to open a new SPSite using this users token.
Note:
Impersonation requires two-way trust and will not be available if the Web front-end that interacts with the SharePoint database sits on a server that is located between two other networks as in such scenarios the Web front-end server has only one-way trust.
You can either RunWithElevatedPrivileges to impersonate the System Account or by passing an User Token to the SPSite object to impersonate a specific user.
Note:
This is not to be used to perform long running processes as user tokens usually expire after approximately 24 hours.
RunWithElevatedPrivileges (impersonate the System Account)
SPSecurity.RunWithElevatedPrivileges(() => { // Your code here });
Passing User Token (impersonate a specific user)
Get site context using the system account.
Then get the user token of the user you want to impersonate.
Finally use this to open a new SPSite using this users token.
SPUserToken userToken = tmpWeb.AllUsers[someUser].UserToken; using (SPSite site = new SPSite(url, userToken)) { using (SPWeb web = site.OpenWeb()) { // Your code here } }
Note:
Impersonation requires two-way trust and will not be available if the Web front-end that interacts with the SharePoint database sits on a server that is located between two other networks as in such scenarios the Web front-end server has only one-way trust.
Wednesday, February 27, 2013
Setting Up the Development Environment for SharePoint 2010 on Windows 7
The development environment that you create by using these instructions will not support SharePoint farm installations, and you should not host active production sites with this configuration. These instructions enable you to get started with an environment that is specifically suited to developing SharePoint custom solutions.
Note:
For a Windows PowerShell script that installs and configures all of the prerequisites and products that you will need to get started with SharePoint Server 2010 development, see SharePoint 2010 Easy Setup Script.
Hardware requirements
Processor: 64-bit, four cores
RAM: 4 GB for developer or evaluation use (8 GB of RAM is preferable)
Hard disk: 80 GB for system drive
Prerequisite & hotfixes
SharePoint requires your operating system to have certain prerequisites installed before installation begins. But you cannot use PrerequisiteInstaller.exe, included in setup files, on Windows 7.
You must install the WCF Hotfix for Microsoft Windows 7.
Updates the ASP.NET common language runtime (CLR) to recognize a new option of optimizing compilations. To take advantage of this option, set the optimizeCompilations property of the tag in your web.config file to true.
This change significantly improves the initial page load time after you have installed a solution to the bin directory.
You must also install the ADO.NET Data Services Update for .NET Framework 3.5 SP1 to enable REST-based data services. This update is available for Windows Server 2008 R2 and Windows 7.
Note:
You can use a separate Microsoft SQL Server instance, but you should not configure your installation as a SharePoint farm and you should not host active sites on this configuration.
To set up a developer workstation
Using a text editor such as Notepad, open the installation configuration file, config.xml, located in the installation folder e.g.: c:\SharePointFiles\files\Setup\config.xml
Add this line inside the <configuration> tag:
Review the complete configuration file. It now looks similar to the following for SharePoint Foundation 2010. The complete configuration file will be longer for SharePoint Server 2010 (and therefore the text below cannot replace the contents of that file), but should use the same setting for the AllowWindowsClientInstall attribute.
Note:
All of the text in this configuration file is case-sensitive. If you do not edit the configuration file as described in the previous step or if you do not save the configuration file, when you try to run the installation you see the following error message.
Now install the following additional prerequisites:
It can be found in the setup directory under ...\PrerequisiteInstallerFiles\FilterPack\FilterPack.msi
Next manually enable each of the required Windows Features under the Internet Information Services and then restart your computer to complete the changes that you made to Windows Features.


Note:
They have been broken into two figures for the sake of readability.
Install SharePoint 2010

After the installation is complete, you are prompted to start the SharePoint Products and Technologies Configuration Wizard.
Note:
If you are using a local instance of Microsoft SQL Server 2008, install the Microsoft SQL Server 2008 KB 970315 x64 before starting the wizard.
More details can be found at:
http://msdn.microsoft.com/en-us/library/ee554869(v=office.14).aspx
Note:
For a Windows PowerShell script that installs and configures all of the prerequisites and products that you will need to get started with SharePoint Server 2010 development, see SharePoint 2010 Easy Setup Script.
--------------------------------------------------------
Hardware requirements
Processor: 64-bit, four cores
RAM: 4 GB for developer or evaluation use (8 GB of RAM is preferable)
Hard disk: 80 GB for system drive
--------------------------------------------------------
Prerequisite & hotfixes
SharePoint requires your operating system to have certain prerequisites installed before installation begins. But you cannot use PrerequisiteInstaller.exe, included in setup files, on Windows 7.
You must install the WCF Hotfix for Microsoft Windows 7.
Updates the ASP.NET common language runtime (CLR) to recognize a new option of optimizing compilations. To take advantage of this option, set the optimizeCompilations property of the tag in your web.config file to true.
<compilation optimizecompilations="true">
This change significantly improves the initial page load time after you have installed a solution to the bin directory.
You must also install the ADO.NET Data Services Update for .NET Framework 3.5 SP1 to enable REST-based data services. This update is available for Windows Server 2008 R2 and Windows 7.
Note:
You can use a separate Microsoft SQL Server instance, but you should not configure your installation as a SharePoint farm and you should not host active sites on this configuration.
--------------------------------------------------------
To set up a developer workstation
Using a text editor such as Notepad, open the installation configuration file, config.xml, located in the installation folder e.g.: c:\SharePointFiles\files\Setup\config.xml
Add this line inside the <configuration> tag:
<Setting Id="AllowWindowsClientInstall" Value="True"/>
Review the complete configuration file. It now looks similar to the following for SharePoint Foundation 2010. The complete configuration file will be longer for SharePoint Server 2010 (and therefore the text below cannot replace the contents of that file), but should use the same setting for the AllowWindowsClientInstall attribute.
<Configuration> <Package Id="sts"> <Setting Id="SETUPTYPE" Value="CLEAN_INSTALL" /> </Package> <DATADIR Value="%CommonProgramFiles%\Microsoft Shared\Web Server Extensions\14\Data" /> <Logging Type="verbose" Path="%temp%" Template="Microsoft Windows SharePoint Services 4.0 Setup *.log" /> <PIDKEY Value="PIDKey Value" /> <Setting Id="UsingUIInstallMode" Value="1" /> <Setting Id="SETUP_REBOOT" Value="Never" /> <Setting Id="AllowWindowsClientInstall" Value="True"/> </Configuration>
Note:
All of the text in this configuration file is case-sensitive. If you do not edit the configuration file as described in the previous step or if you do not save the configuration file, when you try to run the installation you see the following error message.
Now install the following additional prerequisites:
- Microsoft FilterPack 2.0
- Microsoft Sync Framework
- SQL Server Native Client
- Windows Identity Foundation (Windows6.1-KB974405-x64.msu)
- Chart Controls
- SQL Server Analysis Services - ADOMD.Net
It can be found in the setup directory under ...\PrerequisiteInstallerFiles\FilterPack\FilterPack.msi
Next manually enable each of the required Windows Features under the Internet Information Services and then restart your computer to complete the changes that you made to Windows Features.
Note:
They have been broken into two figures for the sake of readability.
--------------------------------------------------------
Install SharePoint 2010
After the installation is complete, you are prompted to start the SharePoint Products and Technologies Configuration Wizard.
Note:
If you are using a local instance of Microsoft SQL Server 2008, install the Microsoft SQL Server 2008 KB 970315 x64 before starting the wizard.
More details can be found at:
http://msdn.microsoft.com/en-us/library/ee554869(v=office.14).aspx
Sunday, February 17, 2013
Code trick to manipulate existing SPtimer jobs
Today I got to go on a trip down memory lane.
Long story short I had to create a sp2007 timerjob, had a few ups and downs and found this very helpful post to manipulate already running timer jobs.
SharePoint 2007 has a number of timer jobs. These are things that run on a scheduled basis.
To see a list of them go to Central Administration > Operations > Timer Job Definitions
So say for instance, Contoso wants you to deliver a solution based on "Information Management Policy" in a flat 4 hours. Well that's great, except that you can't demo it because guess what, that job is set to run on a daily basis. I think it would be very useful to test such things that run based on a timer in a development environment, so there has to be a way to configure these jobs to run on a shorter time schedule. Luckily, there is such a way.
For instance, the "Information Management Policy" job, is a part of the "PolicyConfigService" One way would be to use SharePoint's API to write code to change the job's schedule.
As you can see, the above code replaced the schedule for the Information management policy job to a minute based schedule.
Now, when you set a site collection policy to delete a document, it can be demonstrated in a minute's time.
Long story short I had to create a sp2007 timerjob, had a few ups and downs and found this very helpful post to manipulate already running timer jobs.
SharePoint 2007 has a number of timer jobs. These are things that run on a scheduled basis.
To see a list of them go to Central Administration > Operations > Timer Job Definitions
So say for instance, Contoso wants you to deliver a solution based on "Information Management Policy" in a flat 4 hours. Well that's great, except that you can't demo it because guess what, that job is set to run on a daily basis. I think it would be very useful to test such things that run based on a timer in a development environment, so there has to be a way to configure these jobs to run on a shorter time schedule. Luckily, there is such a way.
For instance, the "Information Management Policy" job, is a part of the "PolicyConfigService" One way would be to use SharePoint's API to write code to change the job's schedule.
namespace ConsoleApplication1 { using System; using Microsoft.SharePoint; using Microsoft.SharePoint.Administration; class Program { static void Main(string[] args) { using (SPSite tmpSPSite = new SPSite("http://moss2007")) { SPServiceCollection tmpSPServiceCollection = tmpSPSite.WebApplication.Farm.Services; foreach (SPService tmpSPService in tmpSPServiceCollection) { if (tmpSPService.Name == "PolicyConfigService") { foreach (SPJobDefinition tmpSPJobDefinition in tmpSPService.JobDefinitions) { if (tmpSPJobDefinition.Title == "Information management policy") { SPMinuteSchedule tmpSchedule = new SPMinuteSchedule(); tmpSchedule.BeginSecond = 0; tmpSchedule.EndSecond = 59; tmpSchedule.Interval = 5; tmpSPJobDefinition.Schedule = tmpSchedule; tmpSPJobDefinition.Update(); } Console.WriteLine("JOB: " + tmpSPJobDefinition.Title); } } } } } } }
As you can see, the above code replaced the schedule for the Information management policy job to a minute based schedule.
Now, when you set a site collection policy to delete a document, it can be demonstrated in a minute's time.
Thursday, February 7, 2013
Trying to delete a SP site after SP1 (using old sp DB)
Error
Specified method is not supported.
Troubleshoot issues with Microsoft SharePoint Foundation
After installing SP1 for SP2010, you'll noticed that you can still create new site/webs but you can no longer delete them, this is because the database of the web application needs to be upgraded.
If you go to
Go to Central Admin -> Upgrade and Migration -> Review database status
You will see the some DB has the following status “need to be upgraded”.
Solution:
More info on, resuming of a failed database upgrade / initiating a database upgrade:
http://technet.microsoft.com/en-us/library/ff607813.aspx
Specified method is not supported.
Troubleshoot issues with Microsoft SharePoint Foundation
After installing SP1 for SP2010, you'll noticed that you can still create new site/webs but you can no longer delete them, this is because the database of the web application needs to be upgraded.
If you go to
Go to Central Admin -> Upgrade and Migration -> Review database status
You will see the some DB has the following status “need to be upgraded”.
Solution:
Upgrade-SPContentDatabase PowerShell command
More info on, resuming of a failed database upgrade / initiating a database upgrade:
http://technet.microsoft.com/en-us/library/ff607813.aspx
Sunday, January 27, 2013
Sharepoint link list content query columns
I had a request from one of the Contoso business units that they have a collection of links to physical files and actual sites that they need on every new meeting workspace site that they create using specific custom business units meeting workspace templates, with the ability to configure and update the list in a central place with real time updates.
Lucky for me SharePoint2010 provides the perfect out of the box feature to solve this.
I knew I would have to create a links list on the root/parent site that gets used for the meetingworkspace and that the template would have to be edited to add some sort of a lookup to it in conjunction with a 'content query webpart', but alas it was not so easy once everything was done I had a whole bunch of (blank) links staring back at me.
Here are a few pointers on what I did wrong and how to fix it if it ever happens to you.
First things first, create the links list. For this example lets call it 'Links'
Note: 'URL' consists of two parts an address and a description.
Step 2: is to add the contentquery webpart to the page you need it on (ps. if it’s not available you will first have to activate the appropriate feature(s))
Once added, edit the webparts settings, the topmost setting is the most important one, choosing where / what the content query is pulling for you.
In this case we will be using the 3rd option to select items from a list, clicking the brows button you will be prompted to select the list you want to query.
Now scrolling down a bit we get to the more powerful stuff
So I assumed the out of the box configuration to the title/url will just link up and work. (FAIL)
The problem is that the links list XSL saves the URL data differently than what you would expect.
Using title is null and void for the purpose of what I was trying to achieve here, using url only gave me the url and not the display title.
The fix, use [Custom Columns]
Done :)
Note: This trick can also be used to filter and group results.
Update: This is a must read on the simplistic power of the content query webpart.
https://www.nothingbutsharepoint.com/sites/eusp/Pages/How-to-Customize-SharePoint-List-Content-Display-using-Content-Query-Web-Part.aspx
Lucky for me SharePoint2010 provides the perfect out of the box feature to solve this.
I knew I would have to create a links list on the root/parent site that gets used for the meetingworkspace and that the template would have to be edited to add some sort of a lookup to it in conjunction with a 'content query webpart', but alas it was not so easy once everything was done I had a whole bunch of (blank) links staring back at me.
Here are a few pointers on what I did wrong and how to fix it if it ever happens to you.
First things first, create the links list. For this example lets call it 'Links'


Note: 'URL' consists of two parts an address and a description.
Step 2: is to add the contentquery webpart to the page you need it on (ps. if it’s not available you will first have to activate the appropriate feature(s))
Once added, edit the webparts settings, the topmost setting is the most important one, choosing where / what the content query is pulling for you.
In this case we will be using the 3rd option to select items from a list, clicking the brows button you will be prompted to select the list you want to query.
Now scrolling down a bit we get to the more powerful stuff

So I assumed the out of the box configuration to the title/url will just link up and work. (FAIL)
The problem is that the links list XSL saves the URL data differently than what you would expect.
Using title is null and void for the purpose of what I was trying to achieve here, using url only gave me the url and not the display title.

Done :)
Note: This trick can also be used to filter and group results.
Update: This is a must read on the simplistic power of the content query webpart.
https://www.nothingbutsharepoint.com/sites/eusp/Pages/How-to-Customize-SharePoint-List-Content-Display-using-Content-Query-Web-Part.aspx
Thursday, January 17, 2013
Fun with Meeting Workspace
Its a Web site that is a repository for all the information and materials needed for one or more meetings. You can set up a Meeting Workspace site when you create a meeting invitation in Microsoft Outlook 2010. The subject, the attendee names, the date, the time, and the location from the meeting request are added to the Meeting Workspace site automatically by Outlook.
The first time you create a Meeting Workspace for a meeting, you must add the Meeting Workspace command
The internet is filled with blogs showing how to work with meeting workspaces and how to add the appropriate ribbon button to outlook to use/create meetings workspaces via outlook and they all look similar to the following:
'
How to integrate with Microsoft Outlook 2010
To add the Meeting Workspace command to the QAT, do the following:
- Open a meeting item.
- On the meeting window, click the Customize the Quick Access Toolbar arrow, and then click More Commands.
- In the Choose commands from box, click Commands Not in the Ribbon.
- In the list of commands, click Meeting Workspace and then click Add.
Add a command to the ribbon To add the Meeting Workspace command to the ribbon, do the following:
- Open a meeting item.
- On the meeting window, click the File tab.
- Click Options.
- Click Customize Ribbon.
- In the Choose commands from box, click Commands Not in the Ribbon.
- In the list of commands, click Meeting Workspace, then in the Customize the Ribbon lists, click the tab and group into which you want to put the command, and then click Add.
'
However that is also where it all stops....
With out going into all the endless tweaks that can be done for the actual workspace in SharePoint or endless lists of shortfalls e.g. cannot save content in template, 'folder 1' losing instance id from webparts, webparts losing there settings after saved as template to name but a few.
Even before we get to any of the wonderful things, what if 10% of Contoso's staff fell asleep during the office 2010 training and don't know how to enter the URL to start using Meeting Workspace for the first time or perhaps they are lazy or the people upstairs just don't trust end-users... well then we have an issue of how to insure that everyone is using the right URL(s).
The fix is actually very simple, they way outlook knows what SharePoint Meeting Workspace it is bound to is stored in the end-users registry settings. This setting can be preconfigured and pushed to all desired machines on the domain or can even be exported to be run by individuals.
HKEY_USERS Hierarchy:
Software\Microsoft\Office\14.0\Meetings\Profile\
Name:
MRUInternal
Type:
REG_SZ
Data: (e.g.)
https://contoso.forums.co.za/|Meetings Workspace|1033| {00000000-0000-0000-0000-000000000000}#1ContosoExcoForumTemplate|Contoso Exco Forum Template||
Now everyone is on the same page and the magic of collaboration can begin in full swing.
Monday, January 7, 2013
AllowUnsafeUpdates, What you need to know
Knowing more about how things work is always a key to building better and more secure applications.
For an in-depth review on AllowUnsafeUpdates see Hristo Pavlov’s Blog:
http://hristopavlov.wordpress.com/2008/05/16/what-you-need-to-know-about-allowunsafeupdates/
http://hristopavlov.wordpress.com/2008/05/21/what-you-need-to-know-about-allowunsafeupdates-part-2/
In short here is how to deal with AllowUnsafeUpdates:
1) Don’t update SharePoint objects from your code behind on GET requests as if you do so your code will be exploitable via a cross-site scripting.
2) If your code is processing a POST request then make sure you call SPUtility.ValidateFormDigest() before you do anything else. This will ensure that the post request is validated (that it is not a cross-site scripting attack) and after that you will not have to worry about AllowUnsafeUpdates, because its default value will be true after the form digest is validated.
The Microsoft idea behind introducing the AllowUnsafeUpdates property is to protect YOU from cross-site scripting attacks. The way this works is that if your application is running in an HTTPContext (i.e. it’s a web part for instance) and the request is a GET request then SharePoint will refuse to do any changes unless the value of AllowUnsafeUpdates is set to true and by default it will be false for GET requests. If you try to do any updates to lists, webs or any SharePoint objects that require an SPSite to be created first, and if you don’t set AllowUnsafeUpdates to true you will get an exception.
Note: If the HTTPContext.Current is null then AllowSafeUpdates will be always true.
Note: You have to be careful because sometimes the ParentWeb of an object is not the same instance of the web you have retrieved the object from. For example when you go initialWeb.Lists[listId] you would expect that the returned list’s ParentWeb instance is the same as you initialWeb. However this is not the case. So if somewhere later in your code you go list.ParentWeb.UpdateSomething() this will not work because you have never set the AllowUnsafeUpdates property of list.ParentWeb. You have set it for your initialWeb but even that this is the same web as the list’s parent web both are different instances.
For an in-depth review on AllowUnsafeUpdates see Hristo Pavlov’s Blog:
http://hristopavlov.wordpress.com/2008/05/16/what-you-need-to-know-about-allowunsafeupdates/
http://hristopavlov.wordpress.com/2008/05/21/what-you-need-to-know-about-allowunsafeupdates-part-2/
In short here is how to deal with AllowUnsafeUpdates:
1) Don’t update SharePoint objects from your code behind on GET requests as if you do so your code will be exploitable via a cross-site scripting.
2) If your code is processing a POST request then make sure you call SPUtility.ValidateFormDigest() before you do anything else. This will ensure that the post request is validated (that it is not a cross-site scripting attack) and after that you will not have to worry about AllowUnsafeUpdates, because its default value will be true after the form digest is validated.
The Microsoft idea behind introducing the AllowUnsafeUpdates property is to protect YOU from cross-site scripting attacks. The way this works is that if your application is running in an HTTPContext (i.e. it’s a web part for instance) and the request is a GET request then SharePoint will refuse to do any changes unless the value of AllowUnsafeUpdates is set to true and by default it will be false for GET requests. If you try to do any updates to lists, webs or any SharePoint objects that require an SPSite to be created first, and if you don’t set AllowUnsafeUpdates to true you will get an exception.
Note: If the HTTPContext.Current is null then AllowSafeUpdates will be always true.
Note: You have to be careful because sometimes the ParentWeb of an object is not the same instance of the web you have retrieved the object from. For example when you go initialWeb.Lists[listId] you would expect that the returned list’s ParentWeb instance is the same as you initialWeb. However this is not the case. So if somewhere later in your code you go list.ParentWeb.UpdateSomething() this will not work because you have never set the AllowUnsafeUpdates property of list.ParentWeb. You have set it for your initialWeb but even that this is the same web as the list’s parent web both are different instances.
Subscribe to:
Posts (Atom)