What you will find here

If you are one of those multi hat kind of person you might want to take a look here.
Some of the sections here will cover: SharePoint, SQL, Server, VB Script, Batch files, PCI Compliance

Icon

Icon
Showing posts with label SharePoint. Show all posts
Showing posts with label SharePoint. Show all posts

Wednesday, March 29, 2017

Issues openning pdf files in browser SharePoint 2010?

Here an easy solution

$webApp = Get-SPWebApplication("http://yourwebappurl")
$webApp.AllowedInlineDownloadedMimeTypes.Add("application/pdf")
$webApp.Update()

Thank Brandon Atkinson



Tuesday, November 3, 2015

Openning excel doc in SharePoint errors - Read only document or security certificate problem.

This was very tricky but figured out eventually.

SharePoint 2010 and 2013, excel 2010.

Microsoft update KB3054886 will brake the ability to open excel documents with content type.

Just go to your installed updates remove "KB3054886" No need to restart computer just Explorer.

I hope this helps. It took me several hours to fix it and there are no other post online about this.



Tuesday, July 22, 2014

Mass add link to Navigation Pane SharePoint 2010 Power shell


--add a link to navigation pane mass sites

$sites = Get-SPWeb "Site Here"
foreach ($site in $sites.webs)
{
$web = Get-SPWeb $Site.URL
$qlNav = $web.Navigation.QuickLaunch
$qlHeading = $qlNav | where { $_.Title -eq "Libraries" }
$linkNode = New-Object Microsoft.SharePoint.Navigation.SPNavigationNode("Name", "URL", $true)
$qlHeading.Children.AddAsLast($linkNode)
$qlHeading.Update
$web.Update
$web.Dispose
}

enjoy

Wednesday, April 16, 2014

Edit library in SharePoint site list with PowerShell


I like simple scripts I don't really like functions and all that when I need is to run a quick update.
Here a really nice one I've modified from some smart guys
I needed to remove the property "Force Check Out" from all libraries on my site collection.
 

$sites = Get-SPWeb {Site URL}
foreach ($site in $sites.webs)
{
$web = Get-SPWeb $site.URL
$library = $web.Lists[{Library Name}]
$library.ForceCheckOut = $false
$library.Update()
$web.Update()
$web.Dispose()
}
 
Additional options here

$library.EnableVersioning = $true
$library.EnableMinorVersions = $true
$library.MajorVersionLimit = $majorVersionLimit
$library.MajorWithMinorVersionsLimit = $minorVersionLimit
$library.ForceCheckOut = $requireCheckOut

I hope it helps

Friday, March 28, 2014

Add library to SharePoint sites using power shell


Will work on your sites three, run from your top site.

$sites = Get-SPWeb <site url>
foreach ($site in $sites.webs)
{
 $listTemplate = $Site.ListTemplates["Document Library"];
 $Site.Lists.Add(<Library name>,<Library Name>,$listTemplate);
 $list = $Site.Lists[<Library Name>];
 $list.Title = <Library Title>;
 $List.DefaultItemOpen = "PreferClient";
 $list.EnableVersioning = $true;               
 $list.EnableMinorVersions = $false;
 $list.MajorVersionLimit = 0;        
 $list.ForceCheckout = $true;
 $List.OnQuickLaunch = $true;
 $List.ContentTypesEnabled = $true
 $list.Update()
 $ctToRemove = $list.ContentTypes[<Main Content Type>]
 $list.ContentTypes.Delete($ctToRemove.Id)
 $list.Update()
 $SPWeb1 = Get-SPWeb -Identity <Main Site where content type is>
 $ctToAdd = $SPWeb1.ContentTypes[<Content Type Name>];
 $ct = $List.ContentTypes.Add($ctToAdd);
 $list.Update()
 $Site.Dispose() 
 $SPWeb1.Dispose()
}

SharePoint Add Gropup to Site using Power Shell


Simple Script to add an existing group to a site or sites.

$sites = Get-SPWeb "Site url"
foreach ($site in $sites.webs)
{
$site.AssociatedGroups.Add($site.SiteGroups["Group Name"]);
$GroupAccount = $site.SiteGroups["Group Name"]
$timeoffassignment = New-Object Microsoft.SharePoint.SPRoleAssignment($GroupAccount)
$timeoffrole = $site.RoleDefinitions["Read"]
$timeoffassignment.RoleDefinitionBindings.Add($timeoffrole)
$site.RoleAssignments.Add($timeoffassignment)
$site.Update()
$site.Dispose()
}