Removing a Managed Account from SharePoint 2010

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".  

PowerShell

Fairly quickly I was able to remove the offending ManagedAccount and restore functionality to the "Managed Accounts" section of Central Administration.

Managed Accounts

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.

Advertisements

5 Responses to Removing a Managed Account from SharePoint 2010

  1. I had this problem after removing an account from AD that was listed ‘managed accounts’ but not actually assigned to any services. I added the account back to AD. This allowed me back into the managed accounts page on central admin, but I couldn’t remove the account.

    Remove-SPManagedAccount -identity “domain\accountname” failed.
    Get-SPManagedAccount -identity “domain\accountname” worked though, so I did:
    Get-SPManagedAccount -identity “domain\accountname” |Remove-SPManagedAccount and that did work!

    Cheers

  2. Akalpita says:

    RE:Blogger

    Wow.Man Good Hint.

  3. vincent says:

    I also get usernames truncated with an ellipsis (…) when running Get-SPManagedAccount, as shown in the screenshot. I don’t see from the help for this command how to return a wide format so that I see the full usernames.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: