Dear all,
Especially when starting out in configuring a freshly installed or upgraded SharePoint Server 2010, a lot of configuration tasks await you as an administrator or configurator. Some tasks can be carried out using PowerShell, some can only be carried out using the Central Administration, and some both. This post provides you with a short list of the most important commands you could need for initially configuring your new SP2010 environment.
Before using these, please make sure to carefully read the documentation of the cmdlets before using them in a productive environment. Test them also with the –whatif flag in order to predict behaviour of the commandlets.
1. Configuring Farm Environments
After install: Move Taxonomy Data:
Move-SPProfileManagedMetadataProperty -ProfileServiceApplicationProxy
2. Usage data configuration
Set-SPUsageService
Set-SPUsageDefinition (DaysRetained) – specific event type
Sep-SPUsageApplication (DatabaseServer, DatabaseName) – change SQL server for logging
3. Health data configuration:
Not possible w/ PowerShell (only in combination with usage data config)
4. Diagnostic logging
Set-SPLogLevel (EventSeverity, TraceSeverity, Identity) –
Get-SPLogLevel
Clear-SPLogLevel – reset to default
5. Outgoing email (stsadm)
- On a farm: stsadm.exe -o email -outsmtpserver -fromaddress -replytoaddress -codepage (z.B. 50500)
- On a single server: stsadm.exe -o email -outsmtpserver -fromaddress -replytoaddress -codepage (z.B. 50500) -url
6. Mobile Account Configuration
Set-SPMobileMessagingAccount -identity -webapplication (central admin) -serviceurl -userId -password
Get-SPMobileMessagingAccount – retrieve information of mobile account
7. Configuring Remote BLOB Storage
- SQL Server Configuration Manager + SMSS (Run Query for provisioning)
- Install RBS (msi, run from command line using msiexec)
- Enable RBS w/ PowerShell:
cdb = Get-SPContentDatabase
rbss = cdb.RemoteBlobStorageSettings
rbss.Installed()
rbss.Enable()
rbss.SetActiveProviderName($rbss.GetProviderName()[0])
8. Service Applications
Start-SPServiceInstance -Identity (Guid)
Stop-SPServiceInstance -Identity (Guid)
9. Configuring service app proxy groups
Add-SPServiceApplicationProxyGroupMember -Identity (proxy group) -Member (serviceapp)
Remove-SPServiceApplicationProxyGroupMember -Identity -Member
10. Establish Trust between farms using certificates
- Export consuming farms root cert:
$rootCert = (Get-SPCertificateAuthority).RootCertificate
$rootCert.Export("Cert") | Set-Content "C:\root.cer" -Encoding byte
- Export STS cert:
stsCert = (Get-SPSecurityTokenServiceConfig).LocalLoginProvider.SigningCertificate
Export as in step 1
- Export publishing farm’s root cert:
See step 1., but perform on publishing farm
11. Establish trust on the consuming farm to the publishing farm
$trustCert = Get-PfxCertificate C:\root.cer
New-SPTrustedRootAuthority OtherFarm -Certificate $trustCer
12. Establish trust on the publishing farm to the consuming farm:
$trustCert = Get-PfxCertificate C:\root.cer
New-SPTrustedRootAuthority OtherFarm -Certificate $trustCer
$stsCert= Get-PfxCertificate C:\sts.cer
New-SPTrustedServiceTokenIssuer OtherFarm -Certificate $stsCert
All commands are enough to be executed on only one machine in the farm
Why do this? Necessary for cross-Farm services!
13. Publish service applications
Publish-SPServiceApplication -Identity
Get-SPTopologyServiceApplication – Get load balancing URL for consuming farm
14. Connect to a service published on another farm:
Receive-SPSharedServiceApplicationInfo
New-SP*ServiceApplicationProxy cmdlet -Name -Url
15. Delete a service application
$spsApp = Get-SPServiceApplication -Name
Remove-SPServiceApplication $spsApp -RemoveData (deletes also database)
16. Set up Visio Services
Set-SPVisioPerformance
New-SPVisioSafeDataProvider
Remove-SPVisioSafeDataProvider
17. Create a content database
New-SPContentDatabase -Name –WebApplication
18. Determine disk space used by a specific site collection
$used = (Get-SPSiteAdministration -Identity <sitename>).DiskUsed
19. Move site collection to another database
Move-SPSite -Identity <siteName> -DestinationDatabase WSS_AnotherOne_By_PS
Pre-Reqs: Db must be attached to the same web app and physically on the same server
Post actions: iisreset required.
20. Move multiple site collections to another database
Get-SPSite -ContentDatabase <source db> | Move-SPSite -DestinationDatabase <dest db>
Caution: Use the commands at your own risk and only after also consulting the Microsoft’s official help on how to best use them.
This was the first part of SP-related cmdlets, but there are more to come soon!
Best regards,
Martin
Read Full Post »