Overview of my SharePoint resources to keep up to speed with latest technology. (v1: 12-10-2016)
1) Using the https://www.changedetection.com/ website to track sites like:
https://technet.microsoft.com/en-us/library/sharepoint-online-it-professional-service-description.aspx
http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=346
https://support.office.com/en-us/article/SharePoint-Online-software-boundaries-and-limits-8f34ff47-b749-408b-abc0-b605e1f6d498
https://www.changedetection.com/log/office/support/what-s-new-in-microsoft-sharepoint-online-02449ef0-027e-4089-8717-f0ae7ea58029_log.html
https://blogs.office.com/sharepoint/
1b) Twitter
#SP2010
#SqlHelp
#LazyWeb
#Office
@lucienengelen
@Kjonge
..
2) Listen to the latest news @ The Microsoft CloudShow: http://www.microsoftcloudshow.com/podcast
3) Follow online events & webcasts:
https://ignite.microsoft.com/#fbid=5sJ5o7G556X
https://www.sharepointeurope.com/
(Potential) partners:
http://en.share-gate.com/?_ga=1.229530332.1930697738.1473866799
http://www.avepoint.com/
http://www.metalogix.com/
https://harmon.ie/
4) Microsoft Mechanics
https://www.youtube.com/user/OfficeGarageSeries
5) Microsoft Virtual Academy
https://mva.microsoft.com/
6) Pluralsight training
https://www.pluralsight.com/
7) Linked In Special Interest Groups
BI: https://www.linkedin.com/groups/59185
SharePoint Community: https://www.linkedin.com/groups/43166
HealthCare: https://www.linkedin.com/groups/98243
SharePoint 2013: https://www.linkedin.com/groups/3839320
SharePoint Enterprise Solutions architects: https://www.linkedin.com/groups/93094
8) The SharePoint network (previously SPYammer)
https://techcommunity.microsoft.com
Wednesday, October 12, 2016
Thursday, June 11, 2015
Error removing SQL SnapShots
When trying
to delete some Microsoft SQL Server 2012 (SP1) snapshots, that I created as part of a recovery procedure before
upgrading a SharePoint farm to Service Pack 1, I ran against this error:
Drop
database [snapshotDbName]
Msg 21, Level 21, State 1, Line 1
Warning: Fatal error 615 occurred at Jun 11 2015 2:51PM. Note the error and time, and contact
your system administrator.
Or via the
interface:
I knew I
had enough rights because I was using the same account that created the snapshots.
After trying setting the snapshot-parent-db to single user, etc. etc. I ran
into this solution:
alter
database [YourDBName]
set emergency
The result
will be:
Msg 5093, Level 16, State 1, Line 1
The operation cannot be performed on a database
snapshot.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
BUT, now
you ARE able to delete the snapshot using the UI or:
drop database [bwdba_SS]
drop database [bwdba_SS]
Don’t know
why but .. it works because of the (emergency) herbs :)
Friday, August 01, 2014
Display page properties in SharePoint page, like “last modified date” & “modified by” using SPServices (& jQuery)
A colleague got the request to add the latest modification date & modifier name to a SharePoint page.
This is convenient for users visiting the page, to see when the page is changed and by who.
This is convenient for users visiting the page, to see when the page is changed and by who.
I didn’t have much time (as usual) for this assignment and different options ran through my mind. At first I played a little bit with a custom page-layout where I would stuck the Modify data & modifier properties into the aspx; I quickly ran into all kinds of trouble using this option (publishing features must be on, the test O365 SharePoint site began throwing errors at me, (even after activating built-in page layouts), this was out of scope for my assignment so I quickly went out looking for other technology that could help me out!
SPServices
The SharePoint 2013 Client Side Object Model (CSOM) is one of those technology options. Another option is jQuery, SPServices is such a jQuery library. But how do you implement this? Lots of examples but little of them are in context / complete and therefore not very useable for beginners. This is one of the reasons I wanted to blog about my solution, to create a full working example that can get you started. Visit this blog on when to use the CSOM / when to use the jQuery libraries.
SPServices is an initiative from Marc. D. Anderson. Visit his site for loads of resources !
I started my journey with the SPServices “framework” which you can find here: http://spservices.codeplex.com/documentation
The SharePoint 2013 Client Side Object Model (CSOM) is one of those technology options. Another option is jQuery, SPServices is such a jQuery library. But how do you implement this? Lots of examples but little of them are in context / complete and therefore not very useable for beginners. This is one of the reasons I wanted to blog about my solution, to create a full working example that can get you started. Visit this blog on when to use the CSOM / when to use the jQuery libraries.
SPServices is an initiative from Marc. D. Anderson. Visit his site for loads of resources !
I started my journey with the SPServices “framework” which you can find here: http://spservices.codeplex.com/documentation
This codeplex project is full of usable resources and is providing most of the content of my final script. To start off you will need to reference 2 links; one to include the JQuery classes and the other one to include the SPServices classes. SPServices provides you with easy to use code that in the back talks to the SharePoint object model. This way you can create effective functions that are not available in SharePoint 2013 out of the box. For example: (all examples from the documentation part of the codeplex project with detailed info available!)
Form Enhancements/Assistance
SPCascadeDropdowns; It allows you to easily set up cascading dropdowns on a list form. (What we mean by cascading dropdowns is the situation where the available options for one column depend on the value you select in another column.) This is not possible with SharePoint OOB components!
SPDisplayRelatedInfo; This function lets you display related information on forms when an option in a dropdown is chosen.
SPLookupAddNew; This function allows you to provide a link in forms for Lookup columns so that the user can add new values to the Lookup list easily.
SPRedirectWithID; This function allows you to redirect to a another page from a new item form with the new item's ID. This allows chaining of forms from item creation onward.
SPSetMultiSelectSizes; Sets the size of the boxes in a multi-select picker based on the values they contain.
SPArrangeChoices; Rearranges radio buttons or checkboxes in a form from vertical to horizontal display to save page real estate.
SPAutocomplete; The SPAutocomplete lets you provide values for a Single line of text column from values in a SharePoint list. The function is highly configurable and can enhance the user experience with forms.
SPUpdateMultipleListItems; SPUpdateMultipleListItems allows you to update multiple items in a list based upon some common characteristic or metadata criteria.
SPFilterDropdown; The SPFilterDropdown function allows you to filter the values available in a Lookup column using CAML against the Lookup column's source list.
SPComplexToSimpleDropdown; Converts a "complex" dropdown (which SharePoint displays if there are 20+ options) to a "simple" dropdown (select).
SPFindPeoplePicker; The SPFindPeoplePicker function helps you find and set People Picker column values.
SPFindMMSPicker; The SPFindMMSPicker function helps you find an MMS Picker's values.
Utilities
SPGetCurrentSite; This utility function, which is also publicly available, simply returns the current site's URL. It mirrors the functionality of the WebUrlFromPageUrl operation.
SPGetCurrentUser; This function returns information about the current user. It is based on an insightful trick from Einar Otto Stangvik.
SPGetLastItemId; Function to return the ID of the last item created on a list by a specific user. Useful for maintaining parent/child relationships.
SPGetDisplayFromStatic; This function returns the DisplayName for a column based on the StaticName.
SPGetStaticFromDisplay; This function returns the StaticName for a column based on the DisplayName.
SPScriptAudit; The SPScriptAudit function allows you to run an auditing report showing where scripting is in use in a site.
SPGetQueryString; The SPGetQueryString function returns an array containing the Query String parameters and their values.
SPListNameFromUrl; Returns the current list's GUID *if* called in the context of a list, meaning that the URL is within the list, like /DocLib or /Lists/ListName.
SPFilterNode; Can be used to find namespaced elements in returned XML, such as rs:data or z:row from GetListItems.
SPXmlToJson; SPXslToJson is a function to convert XML data into JSON for client-side processing.
SPConvertDateToISO; Convert a JavaScript date to the ISO 8601 format required by SharePoint to update list items.
SPGetListItemsJson; SPGetListItemsJson combines several SPServices capabilities into one powerful function. By calling GetListItemChangesSinceToken, parsing the list schema, and passing the resulting mapping and data to SPXmlToJson automagically, we have a one-stop shop for retrieving SharePoint list data in JSON format. No manual mapping required!
SPDropdownCtl; The function finds a dropdown in a form based on the name of the column (either the DisplayName or the StaticName) and returns an object you can use in your own functions.
The solution:
First of all creating a script; Then adding the script to a page where you want to display the page’s properties. This way, users can still edit the page content without messing with the script code. The code can be inserted into a script editor webpart or in a content editor webpart, depending on your situation you can also upload the script to a resource library and link the content editor webpart to your script. This way users won’t see the script at all, you can modify the script on 1 location and without the need to edit your page.
First of all creating a script; Then adding the script to a page where you want to display the page’s properties. This way, users can still edit the page content without messing with the script code. The code can be inserted into a script editor webpart or in a content editor webpart, depending on your situation you can also upload the script to a resource library and link the content editor webpart to your script. This way users won’t see the script at all, you can modify the script on 1 location and without the need to edit your page.
The script:
The script I put together looks like this; I’ve added some comments in there to explain what’s going on:
<!-- Reference jQuery on the Google CDN (content delivery network), if you want to make an external link to the (for this script correct) jquery library -->
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<!-- Alternatively Reference jQuery on the locale Site Assets , uncomment to activate and comment out the above one to deactivate the CDN method-->
<!--<script type="text/javascript" src="https://<yoursite>.sharepoint.com/SiteAssets/jquery.min.js"></script>-->
<!-- Reference SPServices on cdnjs (Cloudflare) if you want to make an external link to the (for this script correct) SPServices library -->
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2014.01/jquery.SPServices.min.js"></script>
<!-- Alternatively Reference jQuery on the locale Site Assets, uncomment to activate and comment out the above one to deactivate the CDN method -->
<!--<script type="text/javascript" src="https://michindusinc.sharepoint.com/SiteAssets/jquery.SPServices.min.js"></script>-->
<!--<script type="text/javascript" src="https://michindusinc.sharepoint.com/SiteAssets/jquery.SPServices.min.js"></script>-->
<script language="javascript" type="text/javascript">
<!—A little helper to format the date like you would like it, in this case.. Dutch formatting-->
function SPConvertDate(t)
{
var d = new Date(t.substr(0,4), parseInt(t.substr(5,2)) - 1, t.substr(8,2), t.substr(11,2), t.substr(14,2), t.substr(17,2));
var month = ((d.getMonth()+1) < 10) ? "0" + (d.getMonth()+1) : (d.getMonth()+1);
var date = (d.getDate() < 10) ? "0" + d.getDate() : d.getDate();
var minutes = (d.getMinutes() < 10) ? "0" + d.getMinutes() : d.getMinutes();
var amPm = (d.getHours() < 12) ? "am" : "pm";
return date + "-" + month + "-" + d.getFullYear() + " " + d.getHours() + ":" + minutes+amPm;
}
<!—here starts the main programà
$(document).ready(function() {
<!—here you can populate the only 2 parameters; the list-name where the page resides and the page ID of the page you want to show the modified date for; I’m using the pageID to prevent disfunction of the script if someone decides to rename a page ..à
var ListName = "2AAC79F6-98B3-45D4-BD77-EDE404B99C39"
var PageID = "3"
var ListName = "2AAC79F6-98B3-45D4-BD77-EDE404B99C39"
var PageID = "3"
<!—then we define our query that will filter all pages in the list to the one we would like to show. Of course you can modify this query and even show multiple pages information. Via these methods we can access all properties / metadata from a SharePoint page, you just need to know the column names and ways to extract it; another nice thing is that it’s a query, which is familiar to a lot of people!à
var CamlQuery = "<Query><Where><Eq><FieldRef Name='ID'/><Value Type='Number'>" + PageID + "</Value></Eq></Where></Query>";
<!—Then we define which fields (metadata) we would like to extract and show in our page à
var CamlViewFields = "<ViewFields><FieldRef Name='Title' /><FieldRef Name='Modified' /><FieldRef Name='Author' /></ViewFields>";
var CamlViewFields = "<ViewFields><FieldRef Name='Title' /><FieldRef Name='Modified' /><FieldRef Name='Author' /></ViewFields>";
<!—now let’s build and execute our query à
$().SPServices({
$().SPServices({
operation: "GetListItems",
async: false,
listName: ListName,
CAMLViewFields: CamlViewFields,
CAMLQuery: CamlQuery,
completefunc: function (xData, Status) {
<!—we’re getting a XML back, let’s get our data out of it and fill some variables with the dataà
$(xData.responseXML).SPFilterNode("z:row").each(function() {
var Author = new String($(this).attr("ows_Author"));
Author = Author.split(";#")[1]
ModifiedDate = $(this).attr("ows_Modified")
<!—making a liHtml variable which in this specific case I turned into a DIV type later, if you want to display more than one pages’ info, you might want to construct an <li>info</li> kind of html à
<!—making a liHtml variable which in this specific case I turned into a DIV type later, if you want to display more than one pages’ info, you might want to construct an <li>info</li> kind of html à
var liHtml = "Latest update: " + SPConvertDate(ModifiedDate) + " <br>By: " + Author;
$("#tasksUL").append(liHtml);
});
}
});
});
</script>
<!—and then display your html à
<h1>Page properties:</h1><br/>
<div id="tasksUL"/>
Ok, we’ve got our script.. Now what? Let’s insert it into a web part and see if it works, the end result:
First, we add a script editor or content editor web part to the page;
Now we can add other content to the page, when the page is saved the info updates automatically!
You can download the script here:
Wednesday, June 25, 2014
TomTom Issue: Connecting to your computer
A bit of a different post, not about SharePoint this time !I finally resolved an issue with my TomTom today and thought to share this solution with the world :)
My problem was that after a few seconds of starting my navigation in the car, it would display this message:
"Connecting to your computer".
And this message would stay there forever, until you click OK. Because this message would pop up after 15 / 40 seconds, you almost always are driving. So it was very annoying to pay attention to it and press the OK button while driving.
I logged a ticket with TomTom support, they suggested to reload the software on it, this didn't help. I decided to do some serious debugging and after a few moments I found the answer... The error / message was caused by plugging the TomTom into the Peugeot's own USB connection and not using the TomTom provided 12v ->USB connector:
Because I was using the Peugeot powered USB, TomTom thought it was connected to a computer; showing me the annoying message ! Using the normal 12v connection and TomTom USB converter that comes with the navigation device, no message; problemo solved :)
Cheers,
Jeroen
Wednesday, June 18, 2014
No Managed Metadata columns in Power Query
When using Power Query to retrieve data from an O365 SharePoint list, you run into trouble when that list data contains columns connected to the Term Store (managed metadata).
These columns are not retrieved by Power Query, not using the "SharePoint List" connection and also not using the "oData" connection.
So, the managed metadata column "organisatie eenheid" is in this list:
But not in the Power Query result sets (oData):
I've notified Microsoft of this issue here, let's wait and see if there are any workarounds or fixes !
Will keep you posted...
Update 24 June 2014:
Ben Martens from Microsoft searched around and asked the product team about this issue and unfortunately the conclusion is that right now, it's not possible to get MMD data extracted from SharePoint.
Both the ListData.mvc as OData connections won't bring back these columns from your SharePoint lists.
Sorry for you ...
Let's hope these services get modified by the SharePoint team and start exposing this data, there are many scenarios where people really want to work with the Managed Metadata ! (why use it if it's not supported !?!). Thanks Ben for this update !
These columns are not retrieved by Power Query, not using the "SharePoint List" connection and also not using the "oData" connection.
So, the managed metadata column "organisatie eenheid" is in this list:
But not in the Power Query result sets (oData):
Or in the "From SharePoint List" resultset:
I've notified Microsoft of this issue here, let's wait and see if there are any workarounds or fixes !
Will keep you posted...
Update 24 June 2014:
Ben Martens from Microsoft searched around and asked the product team about this issue and unfortunately the conclusion is that right now, it's not possible to get MMD data extracted from SharePoint.
Both the ListData.mvc as OData connections won't bring back these columns from your SharePoint lists.
Sorry for you ...
Let's hope these services get modified by the SharePoint team and start exposing this data, there are many scenarios where people really want to work with the Managed Metadata ! (why use it if it's not supported !?!). Thanks Ben for this update !
Thursday, June 12, 2014
Use English as your #0365 (sub) site's default language or else...(use oData)
Hi there,
a quick post on something I discovered yesterday during the creation of a proof of concept a #0365 site that provides it's list data to an Excel Power Query & Power Pivot report. (Which will be published on a Power BI site, that will be described on it's own blog post :) )
I was having trouble getting the data from the O365 SharePoint list into Excel. After making the connection with Power Query:
The "navigator" which should show me all available lists on a given SharePoint URL was empty:
I quickly asked the community for feedback here: http://community.office365.com/en-us/f/172/p/226946/756295.aspx#756295
a quick post on something I discovered yesterday during the creation of a proof of concept a #0365 site that provides it's list data to an Excel Power Query & Power Pivot report. (Which will be published on a Power BI site, that will be described on it's own blog post :) )
I was having trouble getting the data from the O365 SharePoint list into Excel. After making the connection with Power Query:
The "navigator" which should show me all available lists on a given SharePoint URL was empty:
I tried different security settings, checking the data connections, removing all data connections and adding them again, blaming the latest Power BI update, googling, nothing worked. And the strange thing was that I'd seen it work in an earlier POC I did...
Eventually I tried another site URL (on the same O365 web application), that one worked !
Now I had to find out what the difference was between the working and none working sites. Soon I realized it was the regional and language settings. I made the regions the same, no difference. But when I created a new site and gave English as the default language upon creation, Power BI could instantly connect to it.
Eventually I tried another site URL (on the same O365 web application), that one worked !
Now I had to find out what the difference was between the working and none working sites. Soon I realized it was the regional and language settings. I made the regions the same, no difference. But when I created a new site and gave English as the default language upon creation, Power BI could instantly connect to it.
I created a new site to test because changing the default language in O365 SharePoint is not as easy, I think I'll need Power Shell to do this but of course I need to focus on my original POC first :)
I quickly asked the community for feedback here: http://community.office365.com/en-us/f/172/p/226946/756295.aspx#756295
I also found a post from Kasper de Jonge, a senior program manager at the Microsoft SQL Server BI division and a good friend; He said he'll take this issue up with the PQ team and just posted an update on this:
"Update: Yes it is a known issue which they are working on with SP, the workaround is to connect to the sharepoint API using OData, rather than using the From SharePoint option in PQ"
Thanks Kasper !
Labels:
English,
Navigator,
O365,
oData,
PowerBI,
PowerPivot,
PowerQuery,
PQ,
SP
Monday, May 19, 2014
SharePoint performance presentation
I've uploaded the presentation I gave at the Information Worker Community evening Microsoft Johannesburg in October 2013: (download the PPT for fun animations)
Thursday, January 30, 2014
#PowerPivot refresh schedule disappears after creating new version of #excel file on #SP2013 #help
The challenge is as follows:
When you create a new version of your PowerPivot excel file and you load it to SharePoint 2013, the Data Refresh Schedule you had configured is now gone.. As soon as there is a new version (or a new file with versions disabled) the schedule is gone and you have to re-create it.
This problem only seems to happen on SharePoint 2013, SharePoint 2010 keeps a reference to the selected schedule after updating the excel document.
The problem visual:
A Power Pivot Excel document with a Schedule enabled:
Schedule is enabled:
Overwrite existing file:
Check PowerPivot Data Refresh:
Gone ...
5 Feb Update:
Posted question on the Microsoft PowerPivot for SharePoint forum
15 April Update:
It seems that "psiodmakFuture-Processing" found the cause of this bug:
We have this problem as well.
I think I found a possible cause. Try the following script:
SPWeb http://yoursharepoint.com).GetFile(path/to/file.xlsx).Properties['ppDRSchedule']
for a working file it should spew out an escaped XML. It's your schedule that was serialized and cached here probably to speed things up. When you save the document with Excel, this value is trimmed to 255 characters, rendering it broken, so the UI (and the timerjob) thinks that the schedule is missing. This might as well be a bug in Excel.
Now we just need a solution from Microsoft :)
23 April Update:
CU 9 for SQL Sever 2012 SP1 is now downloadable, let's give it a try and see if this resolves the outstanding issue...
When you create a new version of your PowerPivot excel file and you load it to SharePoint 2013, the Data Refresh Schedule you had configured is now gone.. As soon as there is a new version (or a new file with versions disabled) the schedule is gone and you have to re-create it.
This problem only seems to happen on SharePoint 2013, SharePoint 2010 keeps a reference to the selected schedule after updating the excel document.
The problem visual:
A Power Pivot Excel document with a Schedule enabled:
Schedule is enabled:
Make a new version & save document:
Overwrite existing file:
Check PowerPivot Data Refresh:
Gone ...
No fix yet, will update this post when I find it !
(Suggestions are welcome ..)
4 Feb Update:
I found the Microsoft KB that describes this issue (Sql Bug 1377755) in the CU6 update for SQL Server 2012:
http://support.microsoft.com/kb/2874957/en-us
I installed the CU8 but so far no luck..the issue is still there!
5 Feb Update:
Posted question on the Microsoft PowerPivot for SharePoint forum
15 April Update:
It seems that "psiodmakFuture-Processing" found the cause of this bug:
We have this problem as well.
I think I found a possible cause. Try the following script:
SPWeb http://yoursharepoint.com).GetFile(path/to/file.xlsx).Properties['ppDRSchedule']
for a working file it should spew out an escaped XML. It's your schedule that was serialized and cached here probably to speed things up. When you save the document with Excel, this value is trimmed to 255 characters, rendering it broken, so the UI (and the timerjob) thinks that the schedule is missing. This might as well be a bug in Excel.
Now we just need a solution from Microsoft :)
23 April Update:
CU 9 for SQL Sever 2012 SP1 is now downloadable, let's give it a try and see if this resolves the outstanding issue...
Wednesday, January 22, 2014
Quick tool: Dev / Demo / Test environment in the cloud
When I got the question to create a proof-of-concept for exporting the number of emails in custom Microsoft-Outlook (exchange) folders, my thoughts went straight back to the period where I used a cloud solution for my team of developers because IT couldn't provide us with a Team Foundation Server.
On http://www.cloudshare.com you can create an environment with one or more VM's which you then can access via Remote Desktop (or your browser). The nice thing of this cloud solution is that they have several prepared VM's which you can "spin up" in a couple of minutes !
One of these VM's is a Microsoft Exchange 2010 SP3 environment (Exchange installed AND CONFIGURED, AD installed & configured etc.) but they have more ! :
(As per 22 January 2014)
CentOS 5 W/ MySQL
CentOS 5.4 Server
CentOS 5.8 Server
CentOS 6 Server
CentOS 6.3 Server
Dynamics CRM Server 2011
Exchange Server 2010 SP1
Exchange Server 2010 SP3
Exchange Server 2013 RTM
Microsoft Forefront TMG 2010
PostgreSQL 9.1
Ruby On Rails
SharePoint 2007
SharePoint 2007 Additional Server Bits Only
SharePoint 2010 Additional Server Bits Only
SharePoint 2010 Enterprise - No Configuration
SharePoint 2010 Enterprise SP1
SharePoint 2010 Enterprise SP1 W/ Duet
SharePoint 2010 Enterprise SP1 W/ SQL 2012 and BI Stack
SharePoint 2010 SP1 (Information Worker)
SharePoint 2010 SP1 Enterprise W/ FAST Search and SQL Server 2012
SharePoint 2010 SP1 Enterprise W/ SQL Server 2012
SharePoint 2010 SP1 Standard W/ SQL 2012
SharePoint 2010 SP1 W/ FAST Search Server
SharePoint 2010 SP1 W/ PowerPivot
SharePoint 2010 SP1 W/ Project Server
SharePoint 2010 Standard - No Configuration
SharePoint 2010 Standard SP1
SharePoint 2010 W/ Fast for SharePoint Additional Server Bits Only
SharePoint 2013 Additional Server Bits Only
SharePoint 2013 with October 2013 Update
SharePoint Foundation 2010 SP1
SharePoint Foundation 2010 SP1 W/ Dev Tools
SharePoint Server 2013
SQL Server 2008 R2 SP1 Standard
SQL Server 2012 Standard
SQL Server 2014 CTP2
Team Foundation Server 2010
Team Foundation Server 2012
Team Foundation Server 2013
Ubuntu 10.04 Desktop
Ubuntu 10.04 Server
Ubuntu 12.04.3 Desktop
Ubuntu 12.04.3 Server LTS 64 bit
Ubuntu 12.04.3 Server LTS 64 bit /W Docker 0.7
Ubuntu 13.10 Server 64 bit
Windows 2003 R2 W/ Oracle 11g
Windows Server 2003 R2 Enterprise
Windows Server 2008 R2 x64 Enterprise SP1
Windows Server 2008 R2 x64 Enterprise SP1 W/ Active Directory
Windows Server 2008 R2 x64 Enterprise SP1 W/ IIS Server
Windows Server 2008 R2 x64 Standard
Windows Server 2008 SP2 x86 Standard
Windows Server 2008 x64 W/ SQL Server 2012 SP1 BI Edition
Windows Server 2012 R2 Standard
Windows Server 2012 R2 Standard W/ Visual Studio 2013
Windows Server 2012 x64 Standard
Windows Server 2012 x64 W/ Active Directory
Windows Server 2012 x64 W/ SQL Server 2012 SP1
Windows Server 2012 x64 W/ SQL Server 2012 SP1 BI Edition
Xubuntu 8
Each of these VM's ready to spin in a couple of minutes.
The nice thing of this solution is that you can actually invite people (developers or customers) to join-in on the environment and start testing or watching what you build.
You get a free and full-functional trial period which makes things even faster. Imagine you suddenly got that invite at the biggest customer ever, you need that PowerPivot demo area for yourself and ready NOW!!
You can do it, with cloudshare.com !!
Other than RDP'ing to this environment (You'll get a local-admin account & password), you can also use "Cloud Folders' to FTP from and to the VM. This way you can actually export your code / results from the cloud to your own machine.
SnapShot's are also available, so no more re-doing all that hard work :)
Some caveats:
- In the trial period, your environment will shut-down automatically when you don't use it. When you are using it, you can "extend" the period before it goes down. This makes sure that cloudshare is not using valuable resources for nothing :P When cloudshare terminates your environment you can "spin it up" at any time again, it's right where you left it !
- You are depending on your connection to the cloud.. no internet = no environment
- Make sure you look at all pricing options, depending what you are going to do with the tool
On http://www.cloudshare.com you can create an environment with one or more VM's which you then can access via Remote Desktop (or your browser). The nice thing of this cloud solution is that they have several prepared VM's which you can "spin up" in a couple of minutes !
One of these VM's is a Microsoft Exchange 2010 SP3 environment (Exchange installed AND CONFIGURED, AD installed & configured etc.) but they have more ! :
(As per 22 January 2014)
CentOS 5 W/ MySQL
CentOS 5.4 Server
CentOS 5.8 Server
CentOS 6 Server
CentOS 6.3 Server
Dynamics CRM Server 2011
Exchange Server 2010 SP1
Exchange Server 2010 SP3
Exchange Server 2013 RTM
Microsoft Forefront TMG 2010
PostgreSQL 9.1
Ruby On Rails
SharePoint 2007
SharePoint 2007 Additional Server Bits Only
SharePoint 2010 Additional Server Bits Only
SharePoint 2010 Enterprise - No Configuration
SharePoint 2010 Enterprise SP1
SharePoint 2010 Enterprise SP1 W/ Duet
SharePoint 2010 Enterprise SP1 W/ SQL 2012 and BI Stack
SharePoint 2010 SP1 (Information Worker)
SharePoint 2010 SP1 Enterprise W/ FAST Search and SQL Server 2012
SharePoint 2010 SP1 Enterprise W/ SQL Server 2012
SharePoint 2010 SP1 Standard W/ SQL 2012
SharePoint 2010 SP1 W/ FAST Search Server
SharePoint 2010 SP1 W/ PowerPivot
SharePoint 2010 SP1 W/ Project Server
SharePoint 2010 Standard - No Configuration
SharePoint 2010 Standard SP1
SharePoint 2010 W/ Fast for SharePoint Additional Server Bits Only
SharePoint 2013 Additional Server Bits Only
SharePoint 2013 with October 2013 Update
SharePoint Foundation 2010 SP1
SharePoint Foundation 2010 SP1 W/ Dev Tools
SharePoint Server 2013
SQL Server 2008 R2 SP1 Standard
SQL Server 2012 Standard
SQL Server 2014 CTP2
Team Foundation Server 2010
Team Foundation Server 2012
Team Foundation Server 2013
Ubuntu 10.04 Desktop
Ubuntu 10.04 Server
Ubuntu 12.04.3 Desktop
Ubuntu 12.04.3 Server LTS 64 bit
Ubuntu 12.04.3 Server LTS 64 bit /W Docker 0.7
Ubuntu 13.10 Server 64 bit
Windows 2003 R2 W/ Oracle 11g
Windows Server 2003 R2 Enterprise
Windows Server 2008 R2 x64 Enterprise SP1
Windows Server 2008 R2 x64 Enterprise SP1 W/ Active Directory
Windows Server 2008 R2 x64 Enterprise SP1 W/ IIS Server
Windows Server 2008 R2 x64 Standard
Windows Server 2008 SP2 x86 Standard
Windows Server 2008 x64 W/ SQL Server 2012 SP1 BI Edition
Windows Server 2012 R2 Standard
Windows Server 2012 R2 Standard W/ Visual Studio 2013
Windows Server 2012 x64 Standard
Windows Server 2012 x64 W/ Active Directory
Windows Server 2012 x64 W/ SQL Server 2012 SP1
Windows Server 2012 x64 W/ SQL Server 2012 SP1 BI Edition
Xubuntu 8
Each of these VM's ready to spin in a couple of minutes.
The nice thing of this solution is that you can actually invite people (developers or customers) to join-in on the environment and start testing or watching what you build.
You get a free and full-functional trial period which makes things even faster. Imagine you suddenly got that invite at the biggest customer ever, you need that PowerPivot demo area for yourself and ready NOW!!
You can do it, with cloudshare.com !!
Other than RDP'ing to this environment (You'll get a local-admin account & password), you can also use "Cloud Folders' to FTP from and to the VM. This way you can actually export your code / results from the cloud to your own machine.
SnapShot's are also available, so no more re-doing all that hard work :)
Some caveats:
- In the trial period, your environment will shut-down automatically when you don't use it. When you are using it, you can "extend" the period before it goes down. This makes sure that cloudshare is not using valuable resources for nothing :P When cloudshare terminates your environment you can "spin it up" at any time again, it's right where you left it !
- You are depending on your connection to the cloud.. no internet = no environment
- Make sure you look at all pricing options, depending what you are going to do with the tool
Saturday, October 19, 2013
O365 Snag, Grouped view in public site: Working On It......(for anonymous users)
So,
I'm helping out a small business by creating an online exposure for them via O365. Just showing the products, with a product-code in a category and an image.
There are about 3000 products so showing them all at once sounds like a bad idea.. Let's just group them on the category, users can open a category and see all product with a little product image (thumbnail) and in the future select them to get a quote for them.
Of course, all of this happens in the "public" = "anonymous" part of the 0365 site.
I'm sorry .. but that's not going to work !
Microsoft support (SRX1219692554ID) suggests you better use an alternative view without the grouping functionality. (That's the final "work around" they gave me after some extensive testing).
As it turns out, the anonymous users don't have sufficient permissions to access this information, resulting in a "working on it" status as soon as these anonymous users hit the + sign before a group. This status won't change.. no matter how long you wait for it; in the background O365 is trying to redirect these users to the login page which in not going to work for these type of users.
Authenticated users see the products in a category:
Anonymous users just see "Working on it..."
The "work around" is of course not helping at-all, there are no other views that have this functionality.. I'm not even daring to think to create a Access APP (view) that can host this functionality for anonymous users...
Big snag !! Maybe some JavaScript + XSLT to the rescue.. I'll post a real work-around as soon as I find one !
I'm helping out a small business by creating an online exposure for them via O365. Just showing the products, with a product-code in a category and an image.
There are about 3000 products so showing them all at once sounds like a bad idea.. Let's just group them on the category, users can open a category and see all product with a little product image (thumbnail) and in the future select them to get a quote for them.
Of course, all of this happens in the "public" = "anonymous" part of the 0365 site.
I'm sorry .. but that's not going to work !
Microsoft support (SRX1219692554ID) suggests you better use an alternative view without the grouping functionality. (That's the final "work around" they gave me after some extensive testing).
As it turns out, the anonymous users don't have sufficient permissions to access this information, resulting in a "working on it" status as soon as these anonymous users hit the + sign before a group. This status won't change.. no matter how long you wait for it; in the background O365 is trying to redirect these users to the login page which in not going to work for these type of users.
Authenticated users see the products in a category:
Anonymous users just see "Working on it..."
The "work around" is of course not helping at-all, there are no other views that have this functionality.. I'm not even daring to think to create a Access APP (view) that can host this functionality for anonymous users...
Big snag !! Maybe some JavaScript + XSLT to the rescue.. I'll post a real work-around as soon as I find one !
Wednesday, October 02, 2013
3rd Party Apps that leave their Sh#!T behind...(or crash your farm in the removal process)
You know the situation, lots of time pressure on the project, the client needs a little [treeview] [search optimizer] [birthday calendar] [pdf / cad / xxx viewer] [etc] (select or choose your own) addition to the SharePoint implementation.
There is no budget, because .. why should we by this ??! Doesn't it come with SharePoint ? We'll think about it when we see it working...
And you know you should use the dev / test environment to run these trials on .. but hey... sometimes there is only 1 environment...
STOP... Don't DO IT !!
Chances are that the 3rd party tool you are installing is NEVER going to leave the farm / web app / site collection, or you going to spend ALLOT of time cleaning up after you try to remove it.
Maybe you don't care what's left behind.. until you see the warnings appear in the health-analyzer.. Maybe you don't look in the health analyzer ? You will... once you install a CU or want to upgrade to SharePoint 2013.. Which won't work.. because there are some missing components ! ALERT ALERT ALERT !!! Of course you did a trial upgrade .. right !?!
The above scenarios I consider "lucky'", in one occasion I saw the whole farm die when I uninstalled a 3rd party product; giving a nice correlation ID message to all visitors until YOU the admin who broke everything (euh.. I clicked uninstall... wtf ?!?! ) will FIX IT ! (For free of course.. )
Things that can get left behind (also after the neat uninstall says "finished":
- Event receivers (in every single site (collection) !
http://speventreceiverman.codeplex.com/
- Web Parts
(web part gallery)
http://etienne-sharepoint.blogspot.com/2011/10/solving-missingwebpart-errors-from.html
- Assemblies
http://etienne-sharepoint.blogspot.com/2011/10/solving-missingassembly-errors-from.html?showComment=1380725089569#c3924490290473490722
- Setup Files
http://etienne-sharepoint.blogspot.com/2011/10/solving-missingsetupfile-errors-from.html
-Features
http://featureadmin.codeplex.com/
There is no budget, because .. why should we by this ??! Doesn't it come with SharePoint ? We'll think about it when we see it working...
And you know you should use the dev / test environment to run these trials on .. but hey... sometimes there is only 1 environment...
STOP... Don't DO IT !!
Chances are that the 3rd party tool you are installing is NEVER going to leave the farm / web app / site collection, or you going to spend ALLOT of time cleaning up after you try to remove it.
Maybe you don't care what's left behind.. until you see the warnings appear in the health-analyzer.. Maybe you don't look in the health analyzer ? You will... once you install a CU or want to upgrade to SharePoint 2013.. Which won't work.. because there are some missing components ! ALERT ALERT ALERT !!! Of course you did a trial upgrade .. right !?!
The above scenarios I consider "lucky'", in one occasion I saw the whole farm die when I uninstalled a 3rd party product; giving a nice correlation ID message to all visitors until YOU the admin who broke everything (euh.. I clicked uninstall... wtf ?!?! ) will FIX IT ! (For free of course.. )
Things that can get left behind (also after the neat uninstall says "finished":
- Event receivers (in every single site (collection) !
http://speventreceiverman.codeplex.com/
- Web Parts
(web part gallery)
http://etienne-sharepoint.blogspot.com/2011/10/solving-missingwebpart-errors-from.html
- Assemblies
http://etienne-sharepoint.blogspot.com/2011/10/solving-missingassembly-errors-from.html?showComment=1380725089569#c3924490290473490722
- Setup Files
http://etienne-sharepoint.blogspot.com/2011/10/solving-missingsetupfile-errors-from.html
-Features
http://featureadmin.codeplex.com/
Add DB server IP to localhost when using SQL Alias
So, when you implement the "best practice" of using SQL Server ALIAS names (to be flexible at all times of where your SharePoint databases will be hosted), apparently it's also a best practice to add the IP & ALIAS name to (all) your WFE & APP's that are using this name.
This came to my attention when I started receiving ERROR logs in the windows APP log of a WFE:
Log Name: Application
Eh.. duh.. of course the database server is available.. I personally know the DBA ! :P :P
This came to my attention when I started receiving ERROR logs in the windows APP log of a WFE:
Log Name: Application
Source:
Microsoft-SharePoint Products-SharePoint Foundation
Date: 2013/10/02
07:24:00 AM
Event ID: 6398
Task Category: Timer
Level: Critical
Keywords:
User: **
Computer: **
Description:
The Execute method
of job definition
Microsoft.SharePoint.Diagnostics.SPDatabaseServerDiagnosticsPerformanceCounterProvider
(ID 5bce4422-820a-465f-aee4-5ce0f31640ce) threw an exception. More information
is included below.
SharePointDbServer:The
network path was not found.
;
Please ensure that
the database server is available
Eh.. duh.. of course the database server is available.. I personally know the DBA ! :P :P
(Yeah, he's one of my personalities)...
Ok; so .. apparently when you use the SPDiag toolkit from MS, this toolkit starts monitoring stuff and will trigger above ERROR in your eventlog, as being described here:
Thank you so much Mohammed Al-Basri for pointing this out :)
I added the HOME ip (in this case it's a single server install) 127.0.0.1 + DB ALIAS name and voila, another problemo solved !
Thursday, September 19, 2013
Slow StatMan query issue with #SP2010 farm
2 days ago I've emailed help@brentozar.com the mail below, unfortunately I haven't heard anything and I haven't managed to resolve this issue yet. That's why I decided to blog about it, so I can also keep you posted on the progress !
Hi Help team,
I'm Jeroen (Dutch)
all the way from South Africa, running into a Microsoft SQL Server 2008 R2 (SP2) -
10.50.4279.0 (X64) Mar 26 2013
17:33:13 Copyright (c) Microsoft
Corporation Enterprise Edition (64-bit)
on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)
challenge.
This server is also
running SharePoint 2010 14.0.6117.5002 (Feb 2012 CU); The problem is that
'suddenly' (used to work without this problem), when the first person uploads a
new document to a SharePoint document library, this upload takes forever.
Thanks to your free
'Triage' tool, I managed to pinpoint the query that is taking forever to
finish:
EXEC
master.dbo.sp_whoisactive
@get_plans=1,@get_transaction_info
=1
results in:
SELECT
StatMan([SC0], [LC0]) FROM (SELECT TOP 100 PERCENT CONVERT([varbinary](200),
SUBSTRING ([Content], 1, 100)++substring([Content], case when
LEN([Content])<=200 then 101 else LEN([Content])-99 end, 100)) AS [SC0],
datalength([Content]) AS [LC0] FROM [dbo].[AllDocStreams] WITH
(READUNCOMMITTED) ORDER BY [SC0] ) AS
_MS_UPDSTATS_TBL
This seems to be
related with the statistics.. Probably the insert query for the document
triggers the query optimizer to create statistics.. which causes a lot of disk
i/o and takes more than 20 minutes to complete...
The
auto_create_statistics & auto_update_statics settings are FALSE / off on
the content-database.
I have manually created the statistics (not trusting the SharePoint timer job that supposed to do that but often fails, as explained here:
I used this query to
create the statistics:
EXECUTE
sp_msforeachdb
'USE [?];
USE
WSS_Content_DiscoverPortal
IF DB_NAME() NOT
IN(''master'',''msdb'',''tempdb'',''model'')
begin
print ''updating statistics in
database ==> '' + db_name()
if exists (select 1 from sys.objects
where name = ''proc_updatestatistics'')
begin
print ''updating statistics
via proc_updatestatistics''
exec proc_updatestatistics
end
else
begin
print ''updating statistics
via sp_updatestats''
exec sp_updatestats
end
end'
But unfortunately,
that doesn't help.. It still hangs on the same "SELECT StatMan…."
query
I have also looked
at the indexes in the database / AllDocStreams table (by the way, the
AllDocStreams table seems to hold all BLOB data for the documents in a
SharePoint 2010 document library).
SELECT a.index_id,
name, avg_fragmentation_in_percent
FROM
sys.dm_db_index_physical_stats (DB_ID(), OBJECT_ID(N'dbo.AllDocStreams'),
NULL, NULL, NULL) AS a
JOIN sys.indexes AS b ON a.object_id =
b.object_id AND a.index_id = b.index_id;
GO
ALTER INDEX
AllDocStreams_CI ON dbo.AllDocStreams
REBUILD;
GO
--1%
ALTER INDEX
AllDocStreams_RbsId ON dbo.AllDocStreams
REBUILD;
GO
--3.5%
To rebuild the
indexes, resulting in 0% fragmentation.
I found this
blogpost that seems to describe the same type of issue.. With no solution
described..
And also these
posts..
SELECT query is
timing out due to SELECT STATMAN process
-->this is
exactly it, but no answer..
BINGO: STATSMAN
QUERY – KNOWN ISSUE WITH UPDATE STATISTICS
--> no answer..
Does the BrentO
help-team have any other pointers for me to look at ??
It's massively
appreciated and I think maybe even challenging enough to take a look at ?
Thanks very much in advance,
Jeroen
Update: 14 October 2013
After posting this issue here: http://dba.stackexchange.com/questions/51303/extremely-slow-statman-query-issue-with-sp2010-farm?noredirect=1#comment90988_51303
I got some nice feedback and started re-checking the settings on the SharePoint content database. Somehow (probably during early testing and trying to resolve this issue) the Database Setting "Auto Create Statistics) was turned on... This is not best practice for the SharePoint content database (SharePoint's timer job is taking care of creating statistics). After turning off this setting (resetting it to default setting), the issue seems to be resolved. Will keep a close monitor on this for the rest of this week and let you know next week if this resolved this painful issue !
Update: 14 October 2013
After posting this issue here: http://dba.stackexchange.com/questions/51303/extremely-slow-statman-query-issue-with-sp2010-farm?noredirect=1#comment90988_51303
I got some nice feedback and started re-checking the settings on the SharePoint content database. Somehow (probably during early testing and trying to resolve this issue) the Database Setting "Auto Create Statistics) was turned on... This is not best practice for the SharePoint content database (SharePoint's timer job is taking care of creating statistics). After turning off this setting (resetting it to default setting), the issue seems to be resolved. Will keep a close monitor on this for the rest of this week and let you know next week if this resolved this painful issue !
Labels:
Performance,
Query,
SharePoint 2010,
Slow,
SQL 2008R2,
StatMan
Brent Ozar - How To Prove Your SQL Server Needs More Memory
I Really enjoyed watching this short 30 minute webcast from Brent Ozar that shows you how to check if your SQL Server needs more memory. Of course the relationship between SQL & SharePoint [xxxx] is clear and will directly impact the performance of any SharePoint implementation !
Thanks so much for sharing this info Brent !
The link to the webcast:
http://www.brentozar.com/archive/2013/09/how-to-prove-your-sql-server-needs-more-memory-video/
My personal notes from this webcast:
(I've put in the time frames of the video when Brent talks about that specific performance counter).
Thanks so much for sharing this info Brent !
The link to the webcast:
http://www.brentozar.com/archive/2013/09/how-to-prove-your-sql-server-needs-more-memory-video/
My personal notes from this webcast:
(I've put in the time frames of the video when Brent talks about that specific performance counter).
64 GB of memory
costs less than your laptop.
- Create a business case to rectify the purchase of more memory for your SQL
- Less than one weekday of your salary.
Cost of your time tuning + changing VS Cost to upgrade
RAM to the next level
|
Memory - Available
Mbytes
|
|
|
SQLServer: Buffer
Manager - Page life expectancy
(18:41) |
SQL keeps the
grapes, but has to start making wine every time from scratch.
How long can SQL
keep the page-date in memory (cache), before turning to disk to get the data.
(Measured in seconds). The higher this value, the better (how long can the
data be kept in-memory). Some say, 300
seconds is absolute lowest.
Even if you are
above 300..if the cache get's cleared very often you still have a
problem! (and putting more memory in
won't solve this problem).
Also see
"Buffer pool questions" for details.
|
|
SQLServer: Memory
Manager - Memory grants pending
(13:10) |
How many queries
are waiting for memory before they can start. Should never be above 0. If
above 0 , you should just add memory !
|
|
SQLServer: Memory
Manager - Target Server Memory
|
Target = size of
the barrel
|
|
SQLServer: Memory
Manager Total Server Memory
|
Total = how full
is it right now
|
|
SQLServer: SQL
Statistics - Batch Requests / sec
(14:27)
|
How busy is my sql
server due to incoming queries.
|
|
SQLServer: SQL
Statistics - Compilations / sec
(14:27) |
(related to above)
Building the execution plans #sec. There should already be execution plan
ready, which lowers the CPU performance.
If SQL Server is forced to compile >10% of queries [because it can't cache them] then we need more memory. |
Avoiding buying RAM
- Parameterize queries
- Keep your ORM up to date (Nhibernate, LINQ, EF, etc)
- Keep these tools up to date ! (developers)
- Transition to stored procedures
- Consider OPTIMIZE FOR AD HOC
- Don't keep these in the cache !
- Only change this is this is causing the problem !
Buffer pool
questions
- What part of our database is "active" ?
- Percentage ?
- Cache the active part; you have to figure this out
- Look at what data-pages are cached in memory ?
- Which databases are cached in memory ?
- Which tables ?
- What data pages are being cached in memory ?
- What queries are constantly running, thereby forcing those pages to be cached
- Analyse using: Sys.dm_exec_query_stats (BrentOzar.com/go/plans)
- Pulls out the top 10 / 20 queries & how much resources they use
- Make sure to order by TotalReads sec
- Analyse which pages are in memory (brentozar.com/go/pool)
- Which database & tables
- This is a one-time snapshot !
- It make a long time to run these queries.. Run them during a course of time.
From easy to hard
(aka, cheap to expensive)
- Slow, and less than 64 GB ? Learn how to explain business costs: your time and risks vs $500 RAM.
- Memory Grants Pending >0 ? Queries can't start, buy more memory
- Compiles / sec over 10% of Batch Requests / Sec ?
- SQL Server May not be able to cache plans.
- Buffer Page Life Expectancy > 300 ? You still may need more memory, but start with tuning indexes & queries.
- http://BrentOzar.com/blitzindex - sp_BlitzIndex
- http://BrentOzar.com/go/indextuning
Thursday, September 12, 2013
Script to download documents from SharePoint that match a certain view
Today I got a
request to put some files from SharePoint on a USB stick.
My boss is currently in some jungle and although they have (satellite) SharePoint connection which is fine to conduct searches and "define which files they need", it's almost impossible to download 11 GB on.
My boss is currently in some jungle and although they have (satellite) SharePoint connection which is fine to conduct searches and "define which files they need", it's almost impossible to download 11 GB on.
That's why he told
me which document-sets he wanted on a USB stick, for HIS boss to take with .
Our situation is
that we have a few document libraries with about 20.000 files in them. Using
views and document-sets to make sense of it all. Who needs folders (which are
just a piece of metadata to group some files together… right )?!
That's all cewl..
But when you want to export a few document-sets and a few hundred other files
grouped together via a value in a column which obviously doesn't exist when you
click the "open in explorer" button.
After some thinking
I decided to see if I can export the files to the file-system via PowerShell.
Pretty soon I found
this article:
This article from
Jack shows the basics for downloading items from a SP list via PowerShell. My
only problem was that I don't need ALL files, just certain files.
So I created a view in SharePoint that matches my criteria. Basically a view per destination folder so that it makes a bit sense after exporting the files. (Folders.. You know.. The old-school stuff before SharePoint libraries !).
So I created a view in SharePoint that matches my criteria. Basically a view per destination folder so that it makes a bit sense after exporting the files. (Folders.. You know.. The old-school stuff before SharePoint libraries !).
Quite soon I found
out about the SPList Class & .GetItems method (sample script I had uses
SpList.Items to iterate through each item in the list.
This method doesn't
support filtering on a view or query, so I changed it to the
SpList.GetItems method.
You can provide a
query or … VIEW to this method ! YAY…
Unfortunately I hit
a snag.. In this part:
$filelocation =
$item["ows_ServerUrl"]
This property
"ows_ServerUrl" in not in the set of properties returned by the
.GetItems method; so you can't use it to provide it to the download component.
After some research
I came across this post:
And there I saw they
provided the file (item) location using the following command:
SPFile file = item.File;
So, I tried the same
method in my script and … voilla ! It was working !!
Downloading the
items that match the view !
Of course you can just change the filtering in the view, matching whatever files you wish to export from SharePoint and run the PowerShell… put them in a folder that matches the view and you're done !
I didn't come across any other example on how to do this, so I thought let's contribute and make a blog about it.
The final script:
#Script to download
documents from SharePoint that match a certain view
#site name
$sourceurl="http://**/sites/newbusiness"
#view name
$viewname="tempj"
#destination
location
$destinationfolder="e:\trial"
#view-name to filter
the export
$spview =
$list.views[$viewname]
$sourceweb =
get-spweb $sourceurl
$sourcelist =
"BRGM"
$list =
$sourceweb.lists[$sourcelist];
$count =
$list.items.Count
write-host
"iterating $count items in list"
$listItems =
$list.GetItems($spview)
write-host $listItems.Count
Write-host
"Items in view"
foreach ($item in
$listItems)
{
Write-host
"Processing:"
Write-host
$item.File.Name
if
($item.FileSystemObjectType -eq "File")
{
$filename
= $item.File.Name
#downloadfile
$spFile
= $item.File;
[string]$targetname
= $filename
[string]$target
= $destinationfolder + "\" + $targetname
[System.IO.File]::WriteAllBytes($target,$spFile.OpenBinary())
}
}
Subscribe to:
Posts (Atom)







