Retrieve Managed Accounts

Scenario/Problem: You need to retrieve managed accounts on the farm.

Solution: Use the Get-SPManagedAccount cmdlet.

Issuing the Get-SPManagedAccount cmdlet without any parameters displays all managed accounts on the SharePoint farm. To retrieve a specific managed account, you can use the account name, as shown in Listing 4.8.

Listing 4.8. Retrieving a Specific Managed Account

Get-SPManagedAccount "SP\Administrator"

Tip

Pipe the result to other cmdlets that accept managed accounts or assign the result to a variable for use within a cmdlet script.

Get PowerShell™ for SharePoint® 2013 How-To now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.