460 likes | 740 Views
PowerShell with SharePoint 2013 and Office 365. Jerry Yasir , www.NetComLearning.com SharePoint Server MVP , MCT MCSE SharePoint 2013, MCSA 2012. Agenda. SharePoint and PowerShell Basics Managing Web Applications and Site Collections Upgrading SharePoint Managing Apps with PowerShell
E N D
PowerShell with SharePoint 2013 and Office 365 Jerry Yasir, www.NetComLearning.com SharePoint Server MVP, MCT MCSE SharePoint 2013, MCSA 2012
Agenda SharePoint and PowerShell Basics Managing Web Applications and Site Collections Upgrading SharePoint Managing Apps with PowerShell Managing Office 365 & SharePoint Online
Add PowerShell Snap-In to PowerShell • PowerShell does not Load SharePoint cmdLets • First Add SharePoint SnapIn to Load SharePoint cmdLets
Working with SharePoint Objects • Creating Site Collections and Sites • Moving Site Collections • Restoring Site Collection • Creating Web Applications • Working with Services • Managing Service Applications
Getting Ready for Upgrade Test-SPContentDatabase& Mount-SPContentDatabase Deferred Site Collection Upgrade = New cmdlets Managing solutions in 14 / 15 hive Test-SPContentDatabase –Name Wss_Content –WebApplication http://servername Mount-SPContentDatabase –Name Wss_Content –WebApplication http://servername
Solution Management No Change with same commands Add-SPSolution Install-SPSolution Activates solution for web application(s) -CompatibilityLevel (14, 15) – Installs solution to 14 / 15 hive Add-SPSolution –LiteralPath C:\solution.wsp Install-SPSolution -Identity solution.wsp-GACDeployment-CompatibilityLevel15
Deferred Site Collection Upgrades Cmdlets to: Manage Health Checks Upgrade Request Evaluation Site Collections Copy View upgrade status with Get-SPSite
Site Collection Health Checks Test-SPSite Runs Site Collection Health Checks All rules by default or specify specific rule Repair-SPSite Automatically repairs all issues Test-SPSite –Identity http://server/sitecollection Repair-SPSite–Identity http://server/sitecollection
Upgrading Site Collections Upgrade-SPSite Starts Upgrade Process on Site Collection Also resumes failed upgrades -Unthrottled – bypasses throttle limits -VersionUpgrade – used to upgrade from version 14 Upgrade-SPSite http://server/sitecollection -VersionUpgrade
Monitoring Upgrade Status Get-SPSiteUpgradeSession Reports upgrade status for content db and site collection Use with -ContentDatabase or -Site Content Database requires a filter parameter: -HideWaiting -ShowCompleted -ShowFailed -ShowInProgress Get-SPSiteUpgradeSession –Site http://server/sitecolection $database = Get-SPContentDatabaseMyContentDb Get-SPSiteUpgradeSession –ContentDatabase $database -ShowInProgress
Upgrade Evaluation Site Collections Request-SPUpgradeEvaluationSite Requests an upgrade evaluation site collection Target URL auto-generated -Email – specify whether site collection owner and farm admin receive notification Request-SPUpgradeEvaluationSite http://server/sitecollection
Copying Site Collections Copy-SPSite Copies a site collection to a new URL -Identity – source URL -TargetUrl – destination URL -DestinationDatabase (optional) – name of new database Copy-SPSite http://server/sitecollection -DestinationDatabaseMyContentDb -TargetUrl http://server/sitecollection2
Automating Provisioning Most Service Applications deployed by: Creating a Service Creating a Proxy Parameters vary by application Service Application Name Database Application Pool Most SAs take time to provision
Translation Provides translation capability with Bing Translation New-SPTranslationServiceApplication –Name TranslationService -ApplicationPool “SharePoint Web Services Default” –DatabaseServerMyDatabaseServer–DatabaseNameTranslationServiceDatabase New-SPTranslationServiceApplicationProxy–Name TranslationServiceProxy –ServiceApplicationTranslationService –DefaultProxyGroup
Work Management Service Provides aggregation between SharePoint, Exchange, and Project New-SPWorkManagementServiceApplication –Name "WM Service App" -ApplicationPool “SharePoint Web Services Default” New-SPWorkManagementServiceApplicationProxy -name "WMServiceProxy" -ServiceApplication “WM Service App”
Services Provisioning You need to Provision the Services from Services on Server Page $ExcelService = Get-SPServiceInstance | Where TypeName -like "Excel*" $ExcelService.Provision() Windows 7
PowerShell – App Terminology AppPackage – physical file containing the app (.app) App – instance of an app on a given subsite .Idpropery used often in cmdlets
Installing Apps with PowerShell Import-SPAppPackage – imports app package -Path – location of .app file -Site – URL of site collection -Source – MarketPlace / ObjectModel / CorporateCatalog / DeveloperSite Install-SPApp – installs instance of an app -Identity – app object -Web – URL to the site $spapppack = Import-SPAppPackage -Path .\myapp.app-Site http://dev.adventure.com -Source ObjectModel $appinstance= Install-SPApp -Web http://dev.adventure.com -Identity $spapppack
Exporting Apps with PowerShell Get-SPAppInstance – returns an instance of an app -Identity – app instance -Web – URL of site Export-SPAppPackage – exports app package from content db -App – id of app -Path – path of exported file $appinstance = Get-SPAppInstance –Web http://dev.adventure.com | Where-Object { $_.Title -eq“AppTitle" } Export-SPAppPackage–App $appinstance.App–Path .\myexportedapp.app
Uninstalling & Updating Apps Update-SPAppInstance – updates an instance of an app Uninstall-SPAppInstance – removes an instance of an app Get a reference to the previous app instance Import new App Package Update app instance using new app package $appInstance= Get-SPAppInstance -web http://dev.adventure.com | Where-Object { $_.Title -eq“AppTitle" } $appv2 = Import-SPAppPackage -Path .\myapp-v2.app -Site http://dev.adventure.com -Source ObjectModel Update-SPAppInstance – Identity $appInstance–App $appv2 #To Uninstall an App Uninstall-SPAppInstance-Identity $app
Getting Started with PowerShell and SPO Base OS Windows Server 2012, Windows Server 2008 R2 SP1, Windows 8, Windows 7 SP1 .NET Framework 4.5 Windows Management Framework 3.0 Microsoft Online Services Sign-in Assistant All the latest updates Windows Azure AD Module for Windows PowerShell 32-bit Windows Azure AD Module for Windows PowerShell64-bit SharePoint Online Management Shell
Connecting to SharePoint Online Connect-SPOService Connects to SharePoint Online -Url – URL to SharePoint Online tenant administration i.e.: https://mytenant-admin.sharepoint.com -Credential – complete username of a global administrator i.e.: admin@mytenant.onmicrosoft.com Connect-SPOService –Url https://mytenant-admin.sharepoint.com –Credential admin@mytenant.onmicrosoft.com
What commands are available? Get-Command –Module Microsoft.Online.SharePoint.PowerShell
Working with Site Collections Get-SPOSite Returns one or more site collections -Identity (optional) – URL of site collection -Limit (optional) – number of site collections to return Default 200, ALL can be used -Filter (optional) – server side filtering using { } Used in lieu of –Identity Note case sensitive operators (-like, -notlike, -eq, -ne) -Detailed – Returns non-default properties such as CompatibilityLevel Get-SPOSite Get-SPOSite -Detailed Get-SPOSite –Identity https://mytenant.sharepoint.com Get-SPOSite –Filter {Url -like “*term*}
Creating new Site Collections New-SPOSite Creates a site collection -Url – full URL of new site collection -Owner – full user name of site owner i.e.: admin@mytenant.onmicrosoft.com -StorageQuota – in MB -Template (Optional) – i.e.: STS#0 Get-SPOWebTemplate – returns all installed site templates -Title (Optional) – name of site collection New-SPOSite -Url https://mytenant.sharepoint.com/sites/mynewsite -Owner user@domain.com -StorageQuota 1000 -Title "My new site collection“ –Template STS#0
Deleting Site Collections Remove-SPOSite Moves site collection to recycle bin -Identity – URL of site collection Supports –confirm and -NoWait Remove-SPOSite –Identity http://mytenant.sharepoint.com/sites/sitename -NoWait
Restoring Site Collections Restore-SPODeletedSite Restores a site collection from the recycle bin -Identity – URL of site collection Restore-SPODeletedSite–Identity http://mytenant.sharepoint.com/sites/sitename -NoWait
Upgrading Site Collections Test-SPOSite -Identity – URL of site collection Upgrade-SPOSite -Identity – URL of site collection -V2VUpgrade – Required to do a version upgrade -QueueOnly – only add the site collection to the upgrade queue Test-SPOSite -Identity http://mytenant.sharepoint.com/sites/sitename Upgrade-SPOSite -Identity http://mytenant.sharepoint.com/sites/sitename -V2VUpgrade
Working with Users Get-SPOUser -Site – full URL of site collection -LoginName (Optional) – specific user account name i.e.: admin@mytenant.onmicrosoft.com Add-SPOUser Adds existing user to a SharePoint Group -Site – full URL of site collection -LoginName – specific user account name -Group – SharePoint group Get-SPOUser -Site https://mytenant.sharepoint.com -LoginName user@domain.com Add-SPOUser -Site https://mytenant.sharepoint.com -LoginName user@domain.com -Group "Team Site Members“
www.netcomlearning.com PowerShell 3.0 Courses Automating Administration with Windows PowerShell (10961) • July 22nd DC, NYC & Live Online • September 16th DC, NYC & Live Online Pre-requisites: • Previous Windows Server and Windows Client management knowledge and hands on experience • Experience Installing and Configuring Windows Server into existing enterprise environments, or as standalone installations. • Knowledge and experience of network adapter configuration, basic Active Directory user administration, and basic disk configuration. Locations: Attend in-class or Live Online Instructor-led • New York • Las Vegas (All Inclusive Travel Package) • Arlington VA
www.netcomlearning.com MCSE: SharePoint MCSE: SharePoint • 20331: Core Solutions of Microsoft SharePoint Server 2013 • 20332: Advanced Solutions of Microsoft SharePoint Server 2013 Upcoming Classes: • August 5th in NYC, DC & Live Online • August 26th in Las Vegas & Live Online ** Contact Netcom Learning for SharePoint 2010 Course Schedules Locations: Attend in-class or Live Online Instructor-led • New York • Las Vegas (All Inclusive Travel Package) • Arlington VA • Philadelphia, PA
www.netcomlearning.com MCSD: SharePoint Developer MCSD: SharePoint Developer • 20488: Developing Microsoft SharePoint Server 2013 Core Solutions • 20489: Developing Microsoft SharePoint Server 2013 Advanced Solutions Upcoming Classes: • September 23rd in NYC, DC & Live Online • October 7th in Las Vegas & Live Online (All Inclusive Travel Package) Locations: Attend in-class or Live Online Instructor-led • New York • Las Vegas (All Inclusive Travel Package) • Arlington VA
Q & A 1-888-5-NETCOM (563-8266) info@netcomlearning.com www.NetComLearning.com