Author Archive | jbmurphy

PowerShell script to backup all SharePoint 2010 lists in all webs in all sites

More backups the better. I wanted a file level backup of every list. Below I used PowerShell to iterate through all the lists on the server and dump them into a folder

$backupDir="c:\Temp"
foreach ($web in $(Get-SPSite | Get-SPWeb)){
	foreach ($list in $web.Lists) {
	mkdir -force "$backupDir\$($Web.Title.replace(' ',''))\"
	Export-SPWeb $($web.Url) -itemurl "$($list.RootFolder.ServerRelativeUrl)" -path "$backupDir\$($Web.Title.replace(' ',''))\$($list.Title.replace(' ','')).cmp"
	}
}

Install-SPSolution, Add-SPSolution and Update-SPSolution return error: not supported with version 4.0.30319.269 of the Microsoft .Net Runtime.

Just tried to install a soliution, and I received the error:

Install-SPSolution : Microsoft SharePoint is not supported with version 4.0.30319.269 of the Microsoft .Net Runtime.

I just installed the new PowerShell 3.0. To fix, launch a new powershell with -Version 2, and then run your command again:

powershell -version 2

That is what I get for installing the newest and the greatest!

My git notes

Been playing around with git to manage my “Environment”. This is a note to self. May add more at some point
List files that have been “staged”
  • git diff –name-only –cached
To create a “Centro repo”
  • To setup an empty central repo:
    • mkdir /your/path/folder/project.git
    • cd /your/path/folder/project.git
    • git init –bare –shared
  • To add files to the central repo:
    • Go to the existing file structure and setup a new git repo (if it is not there already)
    • cd your/local/workspace/project
    • git init
    • git add .
    • git commit -m “First Commit”
    • git remote add origin server.domain.com:/your/path/folder/project.git
    • git push origin master
  • If you make a change  in your local copy and you want to push it up to the Centro repo
    • git add .
    • git commit -m “This is what changed”
    • git push origin master
  • And to get those changes to other machines
    • git pull origin master
  • And to setup a new machine
    • git clone server.domain.com:/your/path/folder/project.git

Got most of the info from here

Sharepoint 2010 URL for a Calendar’s Week and Month Views

This may be a post for myself, and everyone may already know this, but I couldn’t find it quickly in a google search. I wanted to have a link to the “Week” view of a SharePoint 2010 calendar, but could not find the parmters to pass. Here they are:

?CalendarPeriod=week
?CalendarPeriod=month
?CalendarPeriod=day

And to have a specific day:

?CalendarDate=8/24/2012

A PowerPoint 2010 pptx file from a network share opens read-only

Credit for this one goes to @xrobx99. He did all the work behind this post. I felt that it was such an obscure “bug”, that maybe my posting of the solution might help someone that is expereincing the same issue.

The problem we were having was that when a user would open a large PowerPoint (.pptx) file from a network share,  it would always open as read-only. Looking like this :

Now, if you try and search for PowerPoint 2010 and read-only, all I can say is, good luck. You quickly get lost in “your permissions are wrong” ,and “people telling you to right click and deselect Read-only”. We had been trough all of that, and we could not lick the problem.

The symptoms we were experiencing were:

  • If a user double clicks on a large pptx in a network share through windows explorer, the file is opened read-only
  • If a user right clicks the file and selects open through windows explorer, the file opens correctly
  • If the file is opened either by “double click” or “right click open” on the local machine, the file opens correctly
  • If the file is opened either by “double click” or “right click open” in the PowerPoint file open dialog on either a network share or local machine, the file opens correctly

The solution that @xrobx99 figured out is that if you disable the “Preview Pane” and the “Details Pane”, the file will open correctly every time. Of course you can disable these via group policy:

User Configuration/Administrative Templates/Windows Components/Windows Explorer/Explorer Frame Pane/Turn off Details Pane
And
User Configuration/Administrative Templates/Windows Components/Windows Explorer/Explorer Frame Pane/Turn off Preview Pane

@xrobx99 concluded that if you leave these two panes enabled, windows explorer will open the file to generate a tumbnail, and if you double click the file during that time, it will open read-only.

Hope that helps some one.

Powered by WordPress. Designed by WooThemes