SharePoint-Listen Objekt
$list.Items | select name, E-Mail
$list.Fields | sort title |select title
SharePoint Snapin
Lädt die SharePoint Powershell Snapin
Add-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue
SharePoint ISE als Farm-Admin starten
Die PowerShell ISE als SharePoint-FarmAdmin starten:
Zunächste eine PowerShell als "Adminstrator" starten und anschließend
start-process powershell_ise -verb runas
PSConfig Fortschritt
Mit Hilfe von Tail den Fortschritt beim Update verfolgen
get-content .\Upgrade-xy.log -tail 1 -wait | ? {$_ -match "Upgrading \[SPContentDatabase Name="}
Sitecollection anlegen unter einer Hostnamed-Sitecollection
New-SPSite "https://newsite" -HostHeaderWebApplication "https://hostnamedsitecollection.com/" -Name "NewSite" -Description "New Site" -OwnerAlias "OwnerDomain\OwnerAccount"
Errorlog Handling
Einstellungen lesen
Get-SPLogLevel
Einstellungen setzen
Set-SPLogLevel -TraceSeverity Verbose
Set-SPLogLevel -TraceSeverity VerboseEx
Neue Logdatei
New-SPLogFile
Zurücksetzen auf default
Clear-SPLogLevel
Logdaten von mehreren Nodes sammeln
Merge-SPLogFile -Path "I:\temp\suche.log" -StartTime "14/05/2012 15:45:00" -EndTime "14/05/2012 16:10:00" -correlation "28d5e372-8f8f-4168-8c59-951ee7acb809"

Merge-SPLogFile -Path "E:\temp\suche.log" -correlation "28d5e372-8f8f-4168-8c59-951ee7acb809" -overwrite

Get-SPLogEvent | ? {$_.Correlation -eq "28d5e372-8f8f-4168-8c59-951ee7acb809"} | ft Category, Message -Autosize
Logfile Handling ohne SharePoint
$file = Import-Csv -Delimiter "`t" .\ULS.log -Header Timestamp,Process,TID,Area,Category,EventID,Level,Message,Correlation
$file | Out-GridView
Anwendungs ProxyGroup anlegen
New-SPServiceApplicationProxyGroup –Name “Project 2010 Proxy Group”
Developer Dashboard bei SharePoint 2013 de-/aktivieren (Make sure you create an instance of the Usage & Health Data Collection Service)
cs = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$dds = $cs.DeveloperDashboardSettings
if ($dds.DisplayLevel -eq "On") {
$dds.DisplayLevel = "Off"
Write-Host "Developer dashboard disabled."
} else {
$dds.DisplayLevel = "On"
Write-Host "Developer dashboard enabled."
}
$dds.Update()
Installation/Deinstallation von Solutions
Add-SPSolution -LiteralPath Path
Install-SPSolution -Identity Name.wsp –WebApplication http://WebAppUrl -GACDeployment -force
Install-SPSolution -Identity Name.wsp -GACDeployment -force
Uninstall-SPSolution -Identity Name.wsp -Confirm:$false
Remove-SPSolution -Identity Name.wsp -Confirm:$false
SharePoint Anwendung URL ändern
$WebApp ="01a_Webapplication"
$url = "webapplication.onxy.de"

Remove-SPWebApplication -Identity $WebApp -DeleteIISSite -Zone Default -Confirm:$false
New-SPWebApplicationExtension -Identity $WebApp -Name $WebApp -Zone Default -Port 443 -HostHeader $url -Url ("https://"+$url) -SecureSocketsLayer -AuthenticationProvider (New-SPAuthenticationProvider -DisableKerberos:$false) -Confirm:$false
Alle Sites in einer Webapplication
Get-SPWebApplication https://anwendung.xy | Get-SPSite -Limit All | ForEach-Object { $_.UserAccountDirectoryPath = "OU=Hier,OU=Dort,OU=SharePoint,OU=Verfahren,DC=domain,DC=de" }
Benutzer ändern
Set-SPUser -Identity 'Contoso\jdow' -Web http://test -displayname 'nixdorf, heinz' -email 'heinz.nixdorf@web.de'