Remove a Managed Path
Scenario/Problem: You need to delete a managed path from a specific web application on your SharePoint farm.
Solution: Use the Remove-SPManagedPath cmdlet.
Using the Remove-SPManagedPath cmdlet enables you to remove a managed path from the specified web application, as shown in Listing 1.
Listing 1. Removing a Managed Path
Remove-SPManagedPath -Identity "departments"
-WebApplication "SharePoint - 80"
Tip
You may also remove a managed path using the HostHeader parameter instead of the WebApplication parameter. Remove-SPManagedPath has two parameter sets for this purpose.
The Identity parameter
is simply the name of the relative URL used to generate the managed
path, which becomes the name of the managed path. Use the Get-SPManagedPath cmdlet to review the names.
Merge Log Files
Scenario/Problem: You need to trace an issue but don’t want to have to review the logs on each server in the farm.
Solution: Use the Merge-SPLogFile cmdlet.
The Merge-SPLogFile cmdlet is a
wonderful process that consolidates the logs from all servers in the
farm into one log file. This makes tracing and finding issues easier. Listing 2 shows a sample command line.
Listing 2. Merging Log Files
Merge-SPLogFile -Path E:\Logs\MergedLog.log -StartTime "1/19/2013"
-Overwrite
The Path parameter is the path
and filename of the log file you want to create. If it already exists,
the cmdlet will fail unless you include the Overwrite switch parameter. You should use the StartTime parameter (and/or the EndTime parameter) to specify the range of the log entries to gather and merge.
Several other parameters can help you narrow the log search:
• Area
• Category
• ContextFilter
• Correlation
• Level
• EventID
• Message
• Process
• ThreadID
End the Current Log File
Scenario/Problem: You want SharePoint to be finished with the current log file and start a new one.
Solution: Use the New-SPLogFile cmdlet.
The New-SPLogFile cmdlet stops
the current log file and starts a new one. This is helpful if you are
tracing an issue and do not need more entries in the log file or do not
want any issues with the log file being in use. Simply issue the New-SPLogFile cmdlet without any parameters on the server where you want to start a new log file, as shown in Listing 3.
Listing 3. Start a New Log File
New-SPLogFile