Wednesday, July 15, 2015

change the site to open the files as permissive

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Add-PSSnapin Microsoft.SharePoint.Powershell
$site = Get-SPSite("http://san001/sites/Harry")
$web = $site.OpenWeb()
$list = $web.GetList("http://san001/sites/Test/Shared Documents")
$list.browserfilehandling                      

$list.browserfilehandling = "Permissive"
$list.update()                                             
$list.browserfilehandling                     

One example is to loop through one web.


Add-PSSnapin Microsoft.SharePoint.Powershell
$site = Get-SPSite("http://san001/sites/Test")
$web = $site.OpenWeb()
foreach ($list in $web.Lists) 
{ 
     if($list.browserfilehandling -eq "Strict") 
     { 
          $list.browserfilehandling = "Permissive"; 
          $list.update(); $site.url, $list.title, $list.browserfilehandling
     } 
}

No comments:

Post a Comment

HTML

Script:

JS