14
ADMINISTRATION OF SHAREPOINT 2010 THROUGH POWERSHELL INFORMATION TECHNOLOGY - 300 Suzanne George Perficient

Administration of SharePoint 2010 through PowerShell Information Technology

Embed Size (px)

DESCRIPTION

Suzanne George presented this at SharePoint Saturday in Austin, 2012

Citation preview

Page 1: Administration of SharePoint 2010 through PowerShell Information Technology

ADMINISTRATION OF SHAREPOINT 2010 THROUGH

POWERSHELLINFORMATION TECHNOLOGY -

300Suzanne GeorgePerficient

Page 2: Administration of SharePoint 2010 through PowerShell Information Technology

• Please turn off all electronic devices or set them to vibrate.• If you must take a phone call, please do so in the hall so as not

to disturb others.• Open wireless access is available with no password• Feel free to “tweet and blog” during the session• Thanks to our Title Sponsors:

Thank you for being a part of the first SharePoint Saturday Austin

Page 3: Administration of SharePoint 2010 through PowerShell Information Technology

ABOUT PERFICIENT

3

Leading Technology Consulting & Solutions Firm

• Founded in 1997

• $240MM+ in annualized Revenue

• Over 1,400 highly-experienced Consultants

• 19 Locations across North America

• 80+% of Revenue from recurring Clients

• Served over 400 Clients in past 12 months

Software Solutions Expertise, including:

• Enterprise Portals & Content Management

• SOA, EAI and BPM

• e-Commerce and Product Information Mgmt

• Business Intelligence/ETL

• Customer Relationship Management

• User Experience/UCD

• Significant Integration Expertise

Key Differentiators

• Focused expertise, lower cost, faster time-to-value

• IT Solutions with Business Focus

• National consultants overlay Local delivery model

• Mature, proven Project Methodology

• Global Development Centers in China & Europe

• Healthcare Thought LeadershipPro

ject

siz

e,

Bre

ad

th o

f Exp

ert

ise

Depth of Expertise, Efficiency & Value, Client Importance

Pro

ject

siz

e,

Bre

ad

th o

f Exp

ert

ise

Depth of Expertise, Efficiency & Value, Client Importance

Page 4: Administration of SharePoint 2010 through PowerShell Information Technology

AGENDA• Getting Started• Creating the Farm• Creating Services• Modifying Configuration• Hot Powershell Tips

4

Page 5: Administration of SharePoint 2010 through PowerShell Information Technology

GETTING STARTED• PowerGUI is your best friend

http://www.powergui.org

• Codeplex example powershell installationhttp://autospinstaller.codeplex.com/

• Understand SharePoint config.xmlhttp://technet.microsoft.com/en-us/library/cc261668.aspx

• Listing of SharePoint site templateshttp://toddbaginski.com/blog/which-sharepoint-2010-site-template-is-right-for-me/

• Slipstreaming SharePoint w/Service Packshttp://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=295

• ULSViewerhttp://archive.msdn.microsoft.com/ULSViewer

• ISO Readerhttp://www.magiciso.com/tutorials/miso-magicdisc-history.htm

5

Page 6: Administration of SharePoint 2010 through PowerShell Information Technology

INSTALLING SHAREPOINT – PREP• Create/Edit Powershell Profile> Test-path $profile> New-item –type file –force $profile> Notepad $profile> Set-ExecutionPolicy RemoteSigned-add line: Add-PsSnapin Microsoft.SharePoint.Powershell> . $profile

• Install Pre-requisites – use /h parameter to get argument options> Write-Output "Installing ADONETDataServices"> Start-Process "$folder\ADONETDataServices_v15_CTP2_RuntimeOnly.exe" -Wait -ArgumentList " /q“> Write-Output "Installing PowerGUI"> Start-Process "$folder\PowerGUI.msi" -Wait -ArgumentList " /quiet /qb /liwe $logfolder-powerguiwindo.log /norestart"

• Check registry$regkey = "HKLM:\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo"$exists = Get-ItemProperty -Path $regkey -Name $databaseServerName -ErrorAction SilentlyContinue$regkey = "HKLM:\System\CurrentControlSet\Control\Lsa"$name = "DisableLoopbackCheck"$exists = Get-ItemProperty -Path "$regkey" -Name "$name" -ErrorAction SilentlyContinue

6

Page 7: Administration of SharePoint 2010 through PowerShell Information Technology

INSTALLING SHAREPOINT• Install SharePoint

– Config.Xml - http://technet.microsoft.com/en-us/library/cc261668.aspx, http://blogs.msdn.com/b/ekraus/archive/2009/11/20/automated-sharepoint-2010-install-with-powershell.aspx

$config = "sharepointInstall_config.xml" $bits = "e:\" cls Write-Progress -Activity "Installing SharePoint Quietly" -Status "Copying config file locally" Copy-Item $config -Destination $bits Write-Progress -Activity "Installing SharePoint Quietly" -Status "Installing SharePoint" cmd.exe /C "$bits\setup.exe /config $config" PS C:\sharepointScript> .\Install-SharePoint.ps1

• Create New Central AdministrationNew-SPConfigurationDatabase –DatabaseName $databaseFarmDB –DatabaseServer $databaseServerName `

–AdministrationContentDatabaseName $databaseFarmAdminDB `–Passphrase (ConvertTo-SecureString $farmPassPhrase –AsPlaintext –Force) `-FarmCredentials $Cred_Farm

if (-not $?) { throw "Failed to create admin database." }Install-SPHelpCollection -All if (-not $?) { throw "Script error." }

7

Page 8: Administration of SharePoint 2010 through PowerShell Information Technology

INSTALLING SHAREPOINT• Create New Central AdministrationNew-SPConfigurationDatabase –DatabaseName $databaseFarmDB –DatabaseServer $databaseServerName `

–AdministrationContentDatabaseName $databaseFarmAdminDB `–Passphrase (ConvertTo-SecureString $farmPassPhrase –AsPlaintext –Force) `-FarmCredentials $Cred_Farm

if (-not $?) { throw "Failed to create admin database." }Install-SPHelpCollection -All Initialize-SPResourceSecurityInstall-SPServiceInstall-SPFeature –AllExistingFeaturesStart-Sleep -s 10#########################################################New-SPCentralAdministration -Port $CentralAdminPort -WindowsAuthProvider $WebAuthProviderInstall-SPApplicationContent

• Add Managed AccountsNew-SPManagedAccount -Credential $Cred_spsearchNew-SPManagedAccount -Credential (Get-Credential) – pop up for user to type credentials

8

Page 9: Administration of SharePoint 2010 through PowerShell Information Technology

INSTALLING SHAREPOINT• Create New Web Application

# Create a new Sharepoint WebApplication New-SPWebApplication -Name $WebAppName `

-Port $WebAppPort `-HostHeader $WebAppHostHeader `-URL $WebAppUrl `-ApplicationPool $WebAppAppPool `-ApplicationPoolAccount (Get-SPManagedAccount $WebAppAppPoolAccount) `-DatabaseName $WebAppDatabaseName `-DatabaseServer $WebAppDatabaseServer

# Create a new Sharepoint Site Collection New-SPSite -URL $SiteCollectionURL `

-OwnerAlias $SiteCollectionOwner `-Language $SiteCollectionLanguage `-Template $SiteCollectionTemplate `-Name $SiteCollectionName `-SecondaryOwnerAlias $SiteCollectionSecondary

9

Page 10: Administration of SharePoint 2010 through PowerShell Information Technology

INSTALLING SHAREPOINT• Applications General Installation Guideline

– Setup proxy– Setup application service

• Setup Search– http://

blogs.msdn.com/b/jjameson/archive/2011/02/28/powershell-script-to-configure-search-in-sharepoint-server-2010.aspx

• Setup Managed Metadata– http://

blogs.msdn.com/b/mcsnoiwb/archive/2010/05/26/script-a-metadata-service-application-using-powershell.aspx

– Create new term http://pacsharepoint.com/2010/06/create-new-term-in-managed-metadata.html

• Setup Web Analytics• Setup User Profile Service - It is easier to “click, click setup”

• Setup additional services– Access, Performance Point, Excel Services, etc

• Setup additional parameters– Content types, email, etc

10

$app = Get-SPServiceApplicationPool $wasAppPoolName -ea SilentlyContinueif($app -eq $null){

Write-Output "Creating Application Pool"$app = New-SPServiceApplicationPool $wasAppPoolName -Account $webappadmin

}Write-Output "Creating web analytics service application"$was = New-SPWebAnalyticsServiceApplication -Name $WebAnalyticsSAName `

-ApplicationPool $wasAppPoolName `-ReportingDataRetention 20 `-SamplingRate 100 `-ListOfReportingDatabases $reportingDbSubscription `-ListOfStagingDatabases $stageDbSubscription

if (-not $?) { throw "Failed to create WAS Service Application" }Get-SPServiceInstance | where-object {$_.TypeName -eq $wasServiceTypeName} | Start-SPServiceInstanceif (-not $?) { throw "Failed to start WAS Service Application" }New-SPWebAnalyticsServiceApplicationProxy -Name $WebAnalyticsSaProxyName `

-ServiceApplication $wasif (-not $?) { throw "Failed to create WAS Proxy Service Application" }Get-SPServiceInstance | where-object {$_.TypeName -eq $wasTypeName} | Start-SPServiceInstanceif (-not $?) { throw "Failed to start WAS Proxy Service Application" }Write-Output "verify service installation"$adminsearchurl = $adminurl + "/_admin/ServiceApplications.aspx"start iexplore $adminsearchurl

Page 11: Administration of SharePoint 2010 through PowerShell Information Technology

HOT POWERSHELL TIPS/SCRIPTS• Get all features of a certain type

– Get-SPFeature | select-object DisplayName | select-string –Pattern “Perficient”

• Install WSP files• Get list of all security groups in a web• Find string in CEWP data• Get Permission of all files• Get All Closed Web Parts• Check if files are ghosted• Setup a new site collection• Setup Adobe iFilter• Get crawl schedules

11

Page 12: Administration of SharePoint 2010 through PowerShell Information Technology

THANKS TO OUR OTHER SPONSORS!Thanks to our Sponsors

Page 13: Administration of SharePoint 2010 through PowerShell Information Technology

SUMMARY• Installing SharePoint• Configuring Services• Advanced Configuration• Powershell Scripts

13

Page 14: Administration of SharePoint 2010 through PowerShell Information Technology

THANK YOU!For further information, please contact:

Suzanne [email protected]. ArchitectPerficient - Microsoft West RegionTwitter: spgenie

14