February 2013
Intermediate to advanced
304 pages
8h 26m
English
Scenario/Problem: You need to obtain a specific web application reference.
Solution: Use the Get-SPWebApplication cmdlet to assign a variable to the results using the -Identity parameter.
Providing the identity of the web application with the Get-SPWebApplication cmdlet retrieves a specific web application. Use this to assign the results to an object for use in other cmdlets, as shown in Listing 5.2.
Listing 5.2. Assigning a Variable to a Specific Web Application
$webApp = Get-SPWebApplication -Identity "PSWebApp"
Identity, in this case, can be the display name shown when retrieving all web applications (Get-SPWebApplication). You can also use the URL instead.
Read now
Unlock full access