As you know, Request Manager is used to manage incoming requests in SharePoint 2013. In this blog post, I’ll show you how to configure Request Manager.
Step 1: Create a new web application with a host header and a site collection with the SharePoint Management Shell tool.
Go to Start, and click All Programs. Expand the Microsoft SharePoint 2013 Products folder. Click on the SharePoint 2013 Management Shell program and select the Run as administrator option.
Next, run the following script:
New-SPSite “http://url.hnsc.com” -HostHeaderWebApplication “http://url ” -Name “url.HNSC” -Description “spider-man HNSC” -OwnerAlias “DomainUser” -language 1033 -Template “STS#0”
Example: New-SPSite “http://Demo.hnsc.com” -HostHeaderWebApplication “http://Demo ” -Name “Demo.HNSC” -Description “spider-man HNSC” -OwnerAlias “DomainUser1” -language 1033 -Template “STS#0”
Step 2: Start the Request Management Services in Central Administration.
Open the Central Administration site. Select Application Management and click Manage services on the server under Service Applications to start Request Management.
Step 3: Go to Start, and click All Programs. Expand the Microsoft SharePoint 2013 Products folder. Click on the SharePoint 2013 Management Shell program and select the Run as administrator option.
# Get the RM settings for a particular web app.
$wa = Get-SPWebApplication http://Demo.hnsc.com
$rmSettings = $wa | Get-SPRequestManagementSettings
# View the current settings
$rmSettings
# Create a Machine Pool with a Name and use an array of Routing Targets
$mpName = “Primary Machine Pool”
$serverNames = @(“Demo”)
$mp1 = Add-SPRoutingMachinePool -RequestManagementSettings $rmSettings -Name $mpName -MachineTargets $serverNames
# Display the Machine Pool Configuration
Get-SPRoutingMachinePool -RequestManagementSettings $rmSettings
Press Enter.
Step 4: Create a rule.
Go to Start, and click All Programs. Expand the Microsoft SharePoint 2013 Products folder. Click on the SharePoint 2013 Management Shell program and select the Run as administrator option.
Run the script below:
# Create a rule criteria, and then add a Throttling Rule
# Throlling Rules don’t use a machine pool, threshold is the health score
$criteria = New-SPRequestManagementRuleCriteria -Property UserAgent -MatchType Regex -Value “.*Microsoft Office OneNote 2013*”
$rmSettings | Add-SPThrottlingRule -Name “Refuse OneNote Requests” -Criteria $criteria
# create the Rule Criteria, a regex is semi validated
$mpName = “Primary Machine Pool”
$ruleName = “Serve all PDF requests from the $mpName”
$critera = New-SPRequestManagementRuleCriteria -Property Url -MatchType Regex -Value “.*.pdf”
# Get the correct Machine Pool$mp = Get-SPRoutingMachinePool -RequestManagementSettings $rmSettings -Name $mpName
# Create the rule, and add it to an execution group (0 if omitted) and a Machine Pool, expiry is a time at which to stop that rule
$rule = Add-SPRoutingRule -RequestManagementSettings $rmSettings -Name $ruleName -ExecutionGroup 0 -MachinePool $mp -Criteria $critera
Press Enter.
Step 5: Go to C:WindowsSystem32driversetc
Add host to the host.txt file.
Open your site.
Questions? Contact us or check out our online documentation.