Posts

Showing posts from December, 2015

Exploring SharePoint Users, Groups, and Security Using PowerShell

Image
Here's a quick little PowerShell script to list all groups and all users. Note that if an AD group is listed as a user, all the users in that group may not show up in this list until the user has visited SharePoint at least once. For both SharePoint 2007 or 2010 in any PowerShell: [System.Reflection.Assembly]::LoadWithPartialName( "Microsoft.SharePoint" ) $site = New-Object Microsoft.SharePoint.SPSite( "http://yourservername/sites/yoursitecollection " ) $groups = $site.RootWeb.sitegroups foreach ($grp in $groups) { "Group: " + $grp.name; foreach ($user in $grp.users) { " User: " + $user.name} } $site.Dispose() or for SharePoint 2010 in the SharePoint 2010 Management Shell: $site = Get-SPSite http: //yourservername/sites/yoursitecollection $groups = $site.RootWeb.sitegroups foreach ($grp in $groups) { "Group: " + $grp.name; foreach ($user in $grp.users) { " User: " + $user.name} } $site.Dispo

List All Checked Out Items Using PowerShell - SharePoint 2010

Image
http://www.topsharepoint.com/list-all-checked-out-items-using-powershell ----------------------------------------- If you’re in need of a report on checked out files across specific SharePoint site, and if you’re an administrator it is just a matter of time until someone will ask you for it, here is a simple but very useful PowerShell script that displays the report organized into few fields: site URL, who checked it out, since when was checked out, author’s name, file size and email address of the person who checked out the file. The result will be shown in the Management Shell Grid Viewer or you can output the report to a text file. # enter your site URL $spWeb = Get-SPWeb "http://sp2013"   function GetCheckedItems ( $spWeb ) { Write-Host "Scanning Site: $($spWeb.Url)" foreach ( $list in ( $spWeb. Lists | ? { $_ - is [ Microsoft. SharePoint . SPDocumentLibrary ] } ) ) { Write-Host "Scanning List: $($list.RootFolder.ServerRel