Dokumentieren von Farmkonfigurationseinstellungen (SharePoint Foundation 2010)
Gilt für: SharePoint Foundation 2010
Letztes Änderungsdatum des Themas: 2016-11-30
In diesem Artikel wird beschrieben, wie Sie mithilfe von Windows PowerShell 2,0 die Konfigurationseinstellungen in einer Farm dokumentieren. Das Dokumentieren von Konfigurationseinstellungen ist wichtig, zum einen, damit Sie Skriptbereitstellungen für eine Umgebung erstellen können, zum anderen, um im Fall eines Fehlers Konfigurationen rasch neu erstellen zu können.
So dokumentieren Sie Konfigurationseinstellungen mithilfe von Windows PowerShell
Stellen Sie sicher, dass die folgenden Mindestanforderungen erfüllt sind: Weitere Informationen finden Sie unter Add-SPShellAdmin.
Klicken Sie im Startmenü auf Alle Programme.
Klicken Sie auf Microsoft SharePoint 2010-Produkte.
Klicken Sie auf SharePoint 2010-Verwaltungsshell.
Erstellen Sie mithilfe von Editor eine Textdatei. Kopieren Sie anschließend das folgende Skript, und fügen Sie es in die Datei ein. Mit den Befehlen in dem Beispiel werden XML-Dateien erstellt, in denen die Konfigurationen der Webanwendungen und Dienstanwendungen in der aktuellen Farm dokumentiert werden. Verwenden Sie nur die Befehle, die für Ihre Umgebung relevant sind.
## Common SharePoint configuration settings #Retrieve Web Application information. The default depth of 2 does not return much detail--we recommend that you use a depth of 4 for this cmdlet. Get-SPWebApplication | Export-Clixml .\ WebAppFilename.xml -depth 4 #Retrieve custom layout information. Get-SPWebApplication | Get-SPCustomLayoutsPage | Export-Clixml .\Get-SPCustomLayoutsPage.xml #Determine how SharePoint designer access is configured Get-SPWebApplication | Get-SPDesignerSettings | Export-Clixml .\Get-SPDesignerSettings.xml #Retrieve information about alternate access mapping Get-SPAlternateURL | Export-Clixml .\Get-SPAlternateURL.xml #Retrieve information about content databases Get-SPContentDatabase | Export-Clixml .\Get-SPContentDatabase.xml #Retrieve database properties for each database Get-SPDatabase | Export-Clixml .\Get-SPDatabase.xml #Retrieve information about all SharePoint Products installed in the farm, and the versions of all updates installed for each product. Get-SPProduct | Export-Clixml .\Get-SPProduct.xml #Retrieve farm information Get-SPFarm | Export-Clixml .\Get-SPFarm.xml Get-SPFarmConfig | Export-Clixml .\Get-SPFarmConfig.xml #Retrieve information about the servers in the farm Get-SPServer | Export-Clixml .\Get-SPServer.xml #Retrieve information about installed features Get-SPFeature | Export-Clixml .\Get-SPFeature.xml #Retrieve information about globally-installed site templates Get-SPWebTemplate | Export-Clixml .\Get-SPWebTemplate.xml #Retrieve information about deployed solutions Get-SPSolution | Export-Clixml .\Get-SPSolution.xml #Retrieve information about sandboxed solutions deployed in a site collection Get-SPSite | Get-SPUserSolution | Export-Clixml .\Get-SPUserSolution.xml #Retrieve information about installed Help Get-SPHelpCollection | Export-Clixml .\Get-SPHelpCollection.xml #Retrieve information about the logging levels that have been set Get-SPLogLevel | Export-Clixml .\Get-SPLogLevel.xml #Retrieve information about the sites in the farm Get-SPSite | Export-Clixml .\Get-SPSite.xml Get-SPSiteAdministration | Export-Clixml .\Get-SPSiteAdministration.xml Get-SPSiteSubscription | Export-Clixml .\Get-SPSiteSubscription.xml #Retrieve ULS logging information Get-SPDiagnosticConfig | Export-Clixml .\Get-SPDiagnosticConfig.xml Get-SPDiagnosticsPerformanceCounter | Export-Clixml .\Get-SPDiagnosticsPerformanceCounter.xml Get-SPDiagnosticsProvider | Export-Clixml .\Get-SPDiagnosticsProvider.xml #Retrieve information about accounts registered in the configuration database Get-SPManagedAccount | Export-Clixml .\Get-SPManagedAccount.xml Get-SPProcessAccount | Export-Clixml .\Get-SPProcessAccount.xml Get-SPShellAdmin | Export-Clixml .\Get-SPShellAdmin.xml #Retrieve information about the Mobile Messaging account. Get-SPWebApplication | Get-SPMobileMessagingAccount | Export-Clixml .\Get-SPMobileMessagingAccount.xml ##Common service infrastructure settings #Retrieve information about the service applications in the farm Get-SPServiceApplication | Export-Clixml .\Get-SPServiceApplication.xml Get-SPServiceApplicationPool | Export-Clixml .\Get-SPServiceApplicationPool.xml Get-SPServiceApplicationProxy | Export-Clixml .\Get-SPServiceApplicationProxy.xml Get-SPServiceApplicationProxyGroup | Export-Clixml .\Get-SPServiceApplicationProxyGroup.xml Get-SPServiceApplication | Get-SPServiceApplicationEndpoint | Export-Clixml .\Get-SPServiceApplicationEndpoint.xml #Retrieve information about the services running in the farm Get-SPServiceInstance | Export-Clixml .\Get-SPServiceInstance.xml #Retrieve information about common Web service settings Get-SPServiceHostConfig | Export-Clixml .\Get-SPServiceHostConfig.xml ## Common service application configurations #Application Discovery and Load Balancer Service Application Get-SPTopologyServiceApplication | Export-Clixml .\Get-SPTopologyServiceApplication.xml Get-SPTopologyServiceApplicationProxy | Export-Clixml .\Get-SPTopologyServiceApplicationProxy.xml #Business Data Connectivity Service #Retrieve information about data connection files. ###WARNING: The following cmdlet requires run as administrator rights Get-SPDataConnectionFile | Export-Clixml .\Get-SPDataConnectionFile.xml ###WARNING: The following cmdlet requires run as administrator rights Get-SPDataConnectionFile | Get-SPDataConnectionFileDependent | Export-Clixml .\Get-SPDataConnectionFileDependent.xml #Security Token Service Application #Retrieve information about the security token service used for incoming SOAP messages. Get-SPSecurityTokenServiceConfig | Export-Clixml .\Get-SPSecurityTokenServiceConfig.xml #Usage and Health data collection #Retrieve information about the Usage and Health Data Collection service application. Get-SPUsageApplication | Export-Clixml .\Get-SPUsageApplication.xml Get-SPUsageDefinition | Export-Clixml .\Get-SPUsageDefinition.xml Get-SPUsageService | Export-Clixml .\Get-SPUsageService.xml ###Note: These cmdlets are commented out because you are unlikely to want to run them. ### #Get-SPSite | %{$web=Get-SPWeb $_.Url;$webid=$web.Id;$web | Get-SPUser | Export-Clixml .\Get-SPUser-$webid.xml} # Get-SPSite | %{$web=Get-SPWeb $_.Url;$webid=$web.Id;$web | Export-Clixml .\Get-SPWeb-$webid.xml}
Geben Sie zum Ausführen des Skripts in der Windows PowerShell-Konsole an der Eingabeaufforderung (PS C:\>) den folgenden Befehl ein, und drücken Sie dann die EINGABETASTE: C:\<path>\<filename>.ps1
Weitere Informationen finden Sie unter Export-Clixml, Get-SPWebApplication und Get-SPServiceApplication.
Beispiel für die Verwendung eines Cmdlets
In dem Beispiel in diesem Abschnitt werden Möglichkeiten zur Verwendung der empfohlenen Cmdlets gezeigt.
Das Get-SPAlternateURL-Cmdlet stellt Informationen über alternative Zugriffszuordnungen bereit. Wenn Sie das Cmdlet an das Export-Clixml-Cmdlet übergeben, werden die Informationen in eine XML-Datei geschrieben.
Get-SPAlternateURL | Export-Clixml .\Get-SPAlternateURL.xml
Im folgenden Abschnitt wird der Inhalt der Datei Get-SPAlternateURL.xml aufgelistet. Einige Abschnitte sind reduziert.
- <Objs Version="1.1.0.1" xmlns="https://schemas.microsoft.com/powershell/2004/04">
+ <Obj RefId="0">
- <Obj RefId="7">
<TNRef RefId="0" />
<ToString>Microsoft.SharePoint.Administration.SPAlternateUrl</ToString>
- <Props>
<S N="IncomingUrl">https://servername</S>
<URI N="Uri">https://servername/</URI>
+ <Obj N="UrlZone" RefId="8">
- <Obj N="Collection" RefId="9">
<TNRef RefId="2" />
- <IE>
- <Obj RefId="10">
<TNRef RefId="0" />
<ToString>Microsoft.SharePoint.Administration.SPAlternateUrl</ToString>
+ <Props>
- <MS>
<S N="Zone">Default</S>
<S N="PublicUrl">https://servername</S>
</MS>
</Obj>
</IE>
- <Props>
<I32 N="Count">1</I32>
<B N="IsReadOnly">false</B>
<S N="TypeName">Alternate Access Mapping Collection</S>
<S N="DisplayName">SharePoint - 80</S>
<U64 N="DiskSizeRequired">0</U64>
<B N="CanSelectForBackup">false</B>
<B N="CanRenameOnRestore">false</B>
<B N="CanSelectForRestore">false</B>
<S N="Name">SharePoint - 80</S>
<G N="Id">5b65a69a-222d-4fe0-904b-0fb928bc7a89</G>
<S N="Status">Online</S>
<S N="Parent">SPFarm Name=SERVERNAME_SharePoint_Configuration_Database</S>
<I64 N="Version">3661</I64>
+ <Obj N="Properties" RefId="12">
<TNRef RefId="3" />
<DCT />
</Obj>
<S N="Farm">SPFarm Name=SERVERNAME_SharePoint_Configuration_Database</S>
<Ref N="UpgradedPersistedProperties" RefId="11" />
</Props>
</Obj>
<Ref N="UpgradedPersistedProperties" RefId="11" />
</Props>
+ <MS>
+ <Obj N="Zone" RefId="13">
<TNRef RefId="1" />
<ToString>Default</ToString>
<I32>0</I32>
</Obj>
<S N="PublicUrl">https://servername</S>
</MS>
</Obj>
</Objs>
In diesem Beispiel wird die Ausgabe aus der XML-Datei importiert, sodass Sie deren Inhalt besser lesen können.
Import-Clixml .\Get-SPAlternateURL.xml
Sobald eine XML-Datei importiert ist, können Sie die Objekte in der Pipeline so verwenden, als wären sie reale Objekte des gegebenen Typs.
Import-Clixml .\Get-SPAlternateURL.xml | %{$_.Uri}
Sie können die Objekte auch als Teil des Cmdlets übergeben und alle erwarteten Eigenschaften, Methoden und TypeNames anzeigen. Im folgenden Beispiel werden URIs übergeben.
Import-Clixml .\Get-SPAlternateURL.xml | %{$_.Uri | Get-Member}
Weitere Informationen finden Sie unter Export-Clixml, Import-Clixml, Get-SPAlternateURL, ForEach-Object und Get-Member.