Removing a Managed Account from SharePoint 2010
March 22, 2010 5 Comments
Hello to my two regular readers and people who accidentally clicked this link from twitter! My apologies that it has been so long since my last post.
This morning I found a peculiar little quirk of SharePoint 2010 today when trying to make changes to the Managed Accounts on one of my farms.
This error was coming up whenever I tried to access the "Managed Accounts" section of security under Central Administration. Obviously this caused a problem as I could not add / remove any service accounts, and one of them was corrupted. How did I manage to corrupt a service account? Thats a story for another time.
So I figured the easiest way to get rid of this would be to familiarize myself with the SharePoint PowerShell Cmdlets.
First off I loaded the appropriate PowerShell snapin via "Add-PSSnapin Microsoft.SharePoint.Powershell"
By using the "Get-Command -Noun "SP*" I was able to get a full list of SharePoint commands, and pretty much right where I expected it was "Get-SPManagedAccount"
By using this command I was able to output a list of my Managed Accounts :
Simple PowerShell logic dictated that the appropriate commands were most likely "New-SPManagedAccount", "Set-SPManagedAccount" and "Remove-SPManagedAccount".
Fairly quickly I was able to remove the offending ManagedAccount and restore functionality to the "Managed Accounts" section of Central Administration.
For those not familiar with PowerShell this is all very simple and easy to accomplish. If you are ever in doubt on how to use a PowerShell command just type in "Get-Help CommandName -full" and you will have a whole heap of information to help you out.