André Krijnen

Tag: document library

Powershell: Update all Document Libraries with MajorVersionLimit and MajorWithMinorVersionsLimit

by on Jun.15, 2011, under blog, Powershell, SharePoint 2010

I had to write a Powershell script to run thru all sites in a Web Application to enable Versioning. As well Major as Minor versions. With of course a limit on Major and Minor versions.

Next script should do the trick:

Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
$siteURL = $args[0]
$site = Get-SPSite($siteURL)
foreach($web in $site.AllWebs) {
 Write-Host "Inspecting " $web.Title
 foreach ($list in $web.Lists) {
  if($list.BaseType -eq "DocumentLibrary") {
  Write-Host "Versioning enabled: " $list.EnableVersioning
  $host.UI.WriteLine()
  Write-Host "MinorVersioning Enabled: "  $list.EnableMinorVersions
  $host.UI.WriteLine()
  Write-Host "EnableModeration: " $list.EnableModeration
  $host.UI.WriteLine()
  Write-Host "Major Versions: " $list.MajorVersionLimit
  $host.UI.WriteLine()
  Write-Host "Minor Versions: " $list.MajorWithMinorVersionsLimit
  $host.UI.WriteLine()
  $list.EnableVersioning = $true
  $list.EnableMinorVersions = $true
  $list.MajorVersionLimit = 2
  $list.MajorWithMinorVersionsLimit = 5
  $list.Update()
  Write-Host $list.Title " is updated with MajorVersionLimit 2 and MajorwithMinorVersionsLimit = 5"
  }
 }
}

 

Leave a Comment :, , , , , , more...

https doesn’t redirect to http in document library MOSS 2007

by on Dec.30, 2008, under MOSS

For a company I work for we have an different kind of situation regards the SharePoint site. We have a DMZ with all the webservers we need. We also got a small MOSS 2007 farm where the company hosts his two SharePoint sites. Both sites are on the same farm and on the intranet it works perfectly.

On of these sites is hosted normally on the http port, and the other on is hosted as an extranet application on the https port. The site hosted on the public http port is good, and doesn’t show any problems.

The certificate for the private site is at the reverse proxy server, although it is also a kind of firewall. We used the technet documentation for implementation (link). We did use the Alternative Access Mappings and we did redirect our https port(proxy) to the http port(Site farm).

Everything works perfectly, except for the Document Library. Normal documents can be opened without any problems, but when you want to access a folder in the document library we got a permission denied error from the proxy server. Why you may ask? Well the document library has folders and show all http:// instead of https://. So it redirects from an secure site into a insecure site were the port is blocked on the DNS.

So we maybe thought that this was related to the firewall instead of SharePoint, well forget that. The problem resists in the Document Library and nothing else. Now we contact Microsoft for this issue, but the problem is that Microsoft has only helpdesk people with knowledge of SharePoint or ISA Server. Microsoft helpdesk wants to relate the problem to the firewall instead of their own product, and I can’t blame them, because it’s their product. Well I’m not happy at all with this, because we won’t change anything in the firewall. We tried everything there is needed to work.

The company were I work for doesn’t have this problem to Exchange Server 2003, and this is the same kind of product, and they have the exact same rules and same implementation… Probably this a bug (or feature) and they can’t solve it… maybe later on…

Well I will keep you informed… when I have a solution my blog will keep you informed about it…

3 Comments :, , , , , , , , , , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...