Non-displaying slide…. SharePoint 2010 and 2013 Auditing and Site Content Administration using PowerShell 55095AC.

Slides:



Advertisements
Similar presentations
Drybridge Consulting Party Identification Directory Installing the Microsoft Research Service IDEAlliance and Drybridge Consulting – collaborating to deliver.
Advertisements

Eric J. Oszakiewski MCTS: SharePoint Application Development SharePoint Configuration.
Customizing the MOSS 2007 Search Results November 2007 Rafael Perez.
Chapter 5 Data Management. – The Best & Most Convenient Way to Learn Salesforce.com 2 Objectives By the end of the module, you.
en-us/sharepoint/fp
How to use Sysinternals tools to troubleshoot SharePoint/Office
SOFTWARE PRESENTATION ODMS (OPEN SOURCE DOCUMENT MANAGEMENT SYSTEM)
SharePoint 2010 Permissions Keith Tuomi. profile KEITH TUOMI SharePoint Consultant / Developer at itgroove Developing Online Systems since years.
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
St. Louis Day of Dot Net 2011 Building Web Parts for an Office 365 SharePoint Site Becky Bertram Independent SharePoint Consultant SharePoint MVP, MCSD.NET,
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Welcome to the Minnesota SharePoint User Group November 11 th, 2009 SharePoint 2010 Administration Wes Preston, Brian Caauwe.
1 of 7 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
1 of 4 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Web FOCUS Integration with Microsoft Office SharePoint By: Kelvin Ruiz NASA – Kennedy Space Center.
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
Sharepoint Portal Server Basics. Introduction Sharepoint server belongs to Microsoft family of servers Integrated suite of server capabilities Hosted.
Virtual techdays INDIA │ august 2010 UNDERSTANDING OFFICE WEB APPS Vedant Kulshreshtha │ TSP – Collaboration Platform Microsoft India.
©2011 Quest Software, Inc. All rights reserved. Steve Walch, Senior Product Manager Blog: November, 2011 Partner Training Webcast.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
EDUCATION YOU CAN TRUST ® Windows SharePoint Services Course Review Review provided by: DNS Computing Services, LLC
Role of Account Management at ERCOT Market Participant Identity Management Overview (MPIM)
EBSCOadmin. Select Change Password Select EBSCOadmin Security.
Module 8 Configuring and Securing SharePoint Services and Service Applications.
| | Tel: | | Computer Training & Personal Development Microsoft Office PowerPoint 2007 Expert.
Developing Workflows with SharePoint Designer David Coe Application Development Consultant Microsoft Corporation.
Variations and the MUI in SharePoint 2010 Gary Lapointe, MVP.
TechEd /22/2017 5:40 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Microsoft ® Official Course Module XA Using Windows PowerShell ®
SharePoint 2010 Development Environment A Guide to Setup SharePoint 2010 Development Environment on Windows 7 Machine.
Terry Henry IS System Manager, SharePoint SME Micron Technology Inc.
WCM Platform Improvements ECM and Enterprise Metadata Advanced Routing and Document Sets In Place Records Management.
Microsoft SharePoint Server 2010 for the Microsoft ASP.NET Developer Yaroslav Pentsarskyy
Module 3 Administering and Automating SharePoint.
SharePoint Security Fundamentals Introduction to Claims-based Security Configuring Claims-based Security Development Opportunities.
Searching Business Data with MOSS 2007 Enterprise Search Presenter: Corey Roth Enterprise Consultant Stonebridge Blog:
Module 10 Administering and Configuring SharePoint Search.
What’s new in Kentico CMS 5.0 Michal Neuwirth Product Manager Kentico Software.
New & Improved Events List Relationships and Joins Large List Support Field & List Item Validation.
Intro To PowerShell Jack Fruh Sharepointjack.com.
Module 6 Securing Content. Module Overview Administering SharePoint Groups Implementing SharePoint Roles and Role Assignments Securing and Auditing SharePoint.
Online Conference June 17 th and 18 th SharePoint Online Administration with PowerShell.
Information explosion 1.4X 44X Empower the UserEnable the Compliance Officer In Place and Extensible Easy for IT Exchange, SharePoint, Windows Outlook,
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Search Overview Search Features: WSS and Office Search Architecture Content Sources and.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
What’s New in SharePoint 2010 SharePoint 2010 Development Primer New Developer Tools for SharePoint 2010 SharePoint 2010 Integration with PowerShell.
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Security Overview Functional security – users, groups, and permissions for sites, lists,
Todd Klindt and Shane Young SharePoint911. Who is this Todd guy?
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Automating SharePoint 2010 administration tasks with Power Shell Toni Frankola SharePoint MVP, Croatia
Windows SharePoint Services Installation and Configuration.
Ontolica Fusion 4.0 The easy Automation Tool for SharePoint Steen Jakobsen Fusion Principal Architect
Powering up your Office 365 cmdlets with CSOM Bjoern H Rapp, Senior Architect Public Cloud, SopraSteria.
SQL Database Management
Start-SPPowerShell – Introduction to PowerShell for SharePoint Admins and Developers Paul BAker.
PowerShell 101 sharepoint on-premise
SharePoint 101 – An Overview of SharePoint 2010, 2013 and Office 365
SECTION 1: Add-ons to PowerPoint
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
SharePoint Site Admin Training
Getting Started with the Data ONTAP PowerShell Toolkit
Migration to SharePoint 2013
SharePoint Saturday Omaha April 2016
What Is Sharepoint? Mohsen Ashkboos
SharePoint Essentials Toolkit
PSC Group, LLc Office 365/SharePoint Online Migration traps and tricks
SharePoint 2010 – SharePoint 101
Links Launch Outlook Launch Skype Place Skype on Do Not Disturb.
St. Louis Day of Dot Net 2011 Building Web Parts for an Office 365 SharePoint Site Becky Bertram Independent SharePoint Consultant SharePoint MVP, MCSD.NET,
Presentation transcript:

Non-displaying slide…

SharePoint 2010 and 2013 Auditing and Site Content Administration using PowerShell 55095AC

SharePoint & PowerShell SharePoint did not include support for PowerShell until SharePoint –SharePoint 2013 includes 771 cmdlets –SharePoint 2010 includes 549 cmdlets –SharePoint 2007 includes 0 cmdlets! Or did it? –PowerShell can access SharePoint 2007 via the.Net API Module 1

SharePoint & PowerShell 2010 / 2013 example: $web = Get-SPWeb $web.Title 2007 example: [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") $sitecollection = New-Object Microsoft.SharePoint.SPSite(" ") $web = $sitecollection.RootWeb $web.Title Module 1

SharePoint & PowerShell SharePoint On Premises and SharePoint Online / Office 365 –This class covers the use of PowerShell for on premises SharePoint installations. –PowerShell can also be used with SharePoint Online / Office 365, but with limitations. Module 1

SharePoint & PowerShell On Premises: –Full suite of SharePoint cmdlets (over 700) –Access to the complete SharePoint object API –One add-in to load for the SharePoint cmdlets –Optional use of the standard Active Directory cmdlets SharePoint Online / Office 365: –One add-in for access to Office 365 and user admin. –One add-in for SharePoint Online (only 30 cmdlets) –Requires writing SharePoint Client Side Object Model (CSOM) code for many operations –Is limited to SharePoint features accessible to CSOM and RESTful web services Module 1

SharePoint & PowerShell Search vs. PowerShell –Search Pro’s: Fast and very flexible Available from the browser or from a browser based REST API Limited to content (pages, lists, libraries and files) and user profile services May have access to content external to SharePoint (network shares, non-SharePoint web sites, etc.) –Search Con’s: Not always up to date (depends on crawl schedules) Can miss content due to user created locks Content can be excluded (hidden) from search by site owners at both the site and list/library levels Not as easy to get the output in the format you need Module 1

SharePoint & PowerShell Search vs. PowerShell –PowerShell Pro’s: Can access everything in on premises installs and almost everything in Office 365 Can output and format the data just about any way you like (text, XML, CSV, etc.) Can be “scripted” and rerun as needed Can be scheduled as Windows jobs –PowerShell Con’s: Can be slower than search Can impact server performance Requires the knowledge of PowerShell, the SharePoint cmdlets and the SharePoint object model Module 1

SharePoint & PowerShell PowerShell, SharePoint Management Shell and CMDLETs –The basic PowerShell installed on your PC or Server is not “SharePoint aware”. –The SharePoint Management Shell Command line Auto-loads the SharePoint cmdlets –The PowerShell Integrated Scripting Environment (ISE) Graphical user interface Support for multiple files (tabs) Support for Visual Studio like debugging Does not load the SharePoint cmdlets by default (AddPSSnapin Microsoft.SharePoint.PowerShell) Can be installed by using PowerShell! Module 1

SharePoint & PowerShell Security and Permissions Needed –You will need: Administrator rights to the SharePoint servers Rights to SQL Server via the Shell_Access role Permissions to access the contents of SharePoint sites –Your options: You can use the “setup account” or the farm account that was used to install SharePoint (But this is not the best practice!) Use an account with the needed rights: –Your account must be a member of the SQL SharePoint_Shell_Access role. –Your account must be a member of the WSS_Admin_WPG local security group on each server. –You can configure both of the above using one SharePoint PowerShell cmdlet: Add-SPShellAdmin –Username "domain/user" -Database "databasename" Module 1

SharePoint & PowerShell Common PowerShell permissions related error Exception has been thrown by the target of an invocation This error is related to not having the correct permissions to access content and typically occurs when accessing objects at the SPWeb level or below. I.e. you will need Site Collection Administrator or auditor access to the content. Module 1

SharePoint & PowerShell Getting Started with PowerShell –Get the PowerShell version PS C:\ $PSVersionTable –Get the list of loaded modules and snapins PS C:\ Get-PSSnapin PS C:\ Get-Module PS C:\ Get-Module -ListAvailable –If working with the ISE: Load the SharePoint add-in PS C:\> AddPSSnapin Microsoft.SharePoint.PowerShell Module 1

SharePoint & PowerShell Getting Started with PowerShell –If the Active Directory PowerShell module is installed on your server then PowerShell will automatically load the AD module on the first use of an AD cmdlet. PS C:\> Get-ADDomain –In PowerShell 2.0 you will need to manually load the AD module. PS C:\> Import-Module ActiveDirectory –If the Active Directory PowerShell module is not installed then it can be added using this cmdlet: PS C:\> Add-WindowsFeature RSAT-AD-PowerShell Module 1

SharePoint & PowerShell Common tasks - Counting –Use.Count PS C:\> $sharepointCommands = Get-Command *-SP* PS C:\> $sharepointCommands.count –Evaluate a command and then use.Count PS C:\> ( Get-Command *-SP* ).count –User the Measure-Object cmdlet PS C:\> Get-Command *-SP* | Measure-Object PS C:\> Get-SPSite -Limit All | Measure-Object –Counting Items within a Select-Object PS C:\> Get-SPSite | Select Url, {$_.AllWebs.Count} Module 1

SharePoint & PowerShell Common tasks – Custom Columns –To add a custom column heading you will need to define the column using with two or three options separated with semicolons. Label – the text to display. Example “label="Count"”. Expression – the value to display. Example: “expression={$_.AllWebs.Count}” –An example: PS C:\> Get-SPSite | Select label="Count"; expression = { $_.AllWebs.Count } } Module 1

SharePoint & PowerShell Common tasks – Reformatting Numbers –No formatting: PS C:\> Get-SPSiteAdministration | Select Url, DiskUsed –With formatting: PS C:\> Get-SPSiteAdministration | Select Url, {"{0,26:N0}" -f $_.DiskUsed} –See the courseware for how it works! Module 1

SharePoint & PowerShell Common tasks – Saving Results to a File –Save to Text file: PS C:\> Get-SPWebApplication | Select DisplayName, Url | Out-File c:\test\testpscount.txt –Save to a CSV for later use in Excel: PS C:\> Get-SPWebApplication | Select DisplayName, Url | Export-Csv c:\test\testpscount.txt} –CSV files can be imported back into the pipeline using Imprort-CSV Module 1

SharePoint & PowerShell Creating SharePoint Objects –PowerShell can be used to create anything that can otherwise be created from within the browser in a site, in Central Administration, or from custom code. –PowerShell includes many cmdlets to directly create many common objects. Examples: New-SPSite New-SPWeb New-SPUser –You can also create all types of objects from the SharePoint objects returned from cmdlets. Examples: $web.Lists.Add(……) $web.Lists["Announcements"].Items.Add(……) $web.Lists["Documents"].Folders.Add(……) Module 1

SharePoint & PowerShell Changing SharePoint Objects –SharePoint has two ways of changing objects: calling methods and changing properties. –To see available methods and properties use Get- Member Get-SPWeb | Get-Member –Methods do “work”. Methods always have parentheses, with zero to many parameters. –Properties contain data. Properties are changed using the assignment operator (“=”). Changes to properties are not typically saved without calling the “.Update()” method. – Module 1

SharePoint cmdlets and Objects Module 2

SharePoint cmdlets and Objects GUIDs –Most objects in SharePoint can be identified by a name property, but names can often be changed by administrators, site owners and end users. –As a more reliable ID consider using the GUID assigned to the item. GUIDs are not changed throughout the life of an object. Most often the property containing the GUID is the ID property. Get-SPSite | Select Url, Id –Both of the following commands find the same site: PS C:\> Get-SPSite -Identity PS C:\> Get-SPSite -Identity 6abb01be-ab2d-4679-aec7-db14cd381fc1 Module 2

SharePoint cmdlets and Objects Sites vs. Webs –“Site” is an often misused work in SharePoint –SPWeb A single web site A container of lists, libraries, and pages Primary cmdlet: Get-SPWeb Also accessible from: –The AllWebs property of the SPSite object –The ParentWebUrl of a list or library –SPSite A Site Collection (a container of webs) Primary cmdlet: Get-SPSite Also accessible from: –The Sites property of the SPWebApplication object –The Site property of a child web Module 2

SharePoint cmdlets and Objects The SharePoint Object Hierarchy –SharePoint has a top down structure as seen from both the administration point of view and the SharePoint API object model. SharePoint Farm SharePoint Web Service (SharePoint web pages, not ASP.Net web services) SharePoint Application SharePoint Site Collection (top level site and it's subsites) SharePoint Web (a single site) Lists and Libraries List Items Fields (columns) Data –Each object has a property representing its parent. For example, from a list item you can drill all the way back up to the Farm: $listitem.ParentList.ParentWeb.Site.WebApplication.WebService.Farm Module 2

SharePoint cmdlets and Objects Up and Down the Hierarchy Each object has a property representing its parent. For example, from a list item you can drill all the way back up to the Farm: $listitem.ParentList.ParentWeb.Site.WebApplication.WebService.F arm Each object has collections of its children $mywebapplication = $mywebservice.WebApplications[1] $mysite = $mywebapplication.Sites[1] $myweb = $mysite.AllWebs[1] $mylist = $myweb.Lists[1] $myfield = $mylist.Fields[1] Module 2

SharePoint cmdlets and Objects Expanding Properties –Most properties that are collections of objects will need to be expanded to access the items in the collection. To see all webs (subsites): PS C:\> Get-SPSite -Limit All | Select URL, AllWebs –To see a property of each web: PS C:\> Get-SPSite -Limit all | Select -ExpandProperty AllWebs | Select URL –To see all of the lists in all of the sites (SPWebs) in all of the site collections: PS C:\ > Get-SPSite -Limit All | Select -ExpandProperty AllWebs | Select -ExpandProperty Lists | Select ParentWebUrl, Title Module 2

Memory Usage Tracking Memory Usage –The $PID variable contains the PowerShell process ID –You can use the Get-Process (“gps”) to check the resources being used: # create 100 subsites gps -id $pid; for ($i=0; $i -lt 100; $i++) { $s = New-SPWeb }; gps -id $pid; Module 3

Memory Usage Disposing of Objects –By default, all Get commands dispose of SharePoint objects immediately after the pipeline finishes. –You only need to dispose SPWeb and SPSite objects you explicitly create. gps -id $pid; for ($i=0; $i -lt 100; $i++) { $s = New-SPWeb $s.Dispose(); }; gps -id $pid Module 3

Memory Usage Limiting Impact on Production Servers –Run your high impact scripts: After hours or on weekends. In small batches: –One site collection at a time. –One web application at a time. With “timeouts”: –Use the Start-Sleep cmdlet to pause. Module 3

Memory Usage Limiting Impact on Production Servers –A typical script: PS C:\> Get-SPSite -Limit All | Get-SPWeb -Limit All | Select Url –With a “sleep” step: PS C:\> Get-SPSite -Limit All | ForEach { $_ ; Start-Sleep 5 } | Get-SPWeb -Limit All | Select Url Module 3

Working with Content Module 4: Working with Content We will be working from the courseware for this module. –In this module: Getting Farm information Getting Lists of Web Applications, Site Collections and Webs Getting Lists of Lists and Libraries Working with Features Finding Documents Deleting Content Downloading Files Uploading Files Module 4

Users and Security Module 5: Users and Security We will be working from the courseware for this module. –In this module: Get a single user Get a list of all SharePoint users in a Site Collection Get a list of all groups and their users for all site collections Dealing with Login Names Get Users who that are Active Directory Groups All of the above for groups Including users who have access through AD groups Documenting Broken Inheritance / Unique Permissions Get Role Assignments Module 5

Managing Sites Module 6: Managing Sites We will be working from the courseware for this module. –In this module: Finding Inactive Sites Creating and Deleting Site Collections Getting Site Collection Data Creating and Deleting Subsites SharePoint Designer Settings Module 6