header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Change Permissions on a document library
Last Post 24 Nov 2009 08:04 AM by Alan Renouf. 0 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
Alan RenoufUser is Offline
New Member
New Member
Posts:31

--
24 Nov 2009 08:04 AM
    Hi, I currently have Sharepoint Portal 2003 & WSS 2.0.

    I am working on a script that will:

    a) enumerate the permissions on all document libraires on a group of sites (site names will be read from a text file)
    b) modify permissions for all document libraries in the same group of sites

    At the moment I can list the document libraries and the users and their permissions with the following code but I am getting very stuck with changing the permissions to give everyone read only permissions or even removing the users from the document library together.

    Here is what I have at the moment:

    ## loads Sharepoint assembly
    [System.reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

    #sets site to work with
    $siteurl = "http://test"

    #creates mysite object / variable
    $mysite=new-object Microsoft.Sharepoint.SPSite($siteurl)

    #creates siteweb object / variable
    $siteweb = $mysite.OpenWeb();
    $listsnew = $siteweb.Lists
    $doclibs = $siteweb.Folders | where {$_.ContainingDocumentLibrary -ne "00000000-0000-0000-0000-000000000000"}

    foreach ($lib in ($doclibs | where {$_.name -eq "My test"})){
            Write-Host $siteurl $siteweb
            Write-Host "Document Library: " $lib.name
            $mylist = $siteweb.Lists[$lib]
            $mylist.Permissions
    }

    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer