Whilst playing around with SharePoint Server 2010 there have been a number of occasions where I’ve created a new Service Application, only to find I’ve either done it wrong or need it configured in a slightly different way for whatever reason.
Typically what I’d do is delete the old SharePoint Service Application and create a fresh one. I quite often want to use the same naming convention and this seems to cause problems.
For example, I created a Secure Store Service, realised I’d done something wrong, deleted it and tried to re-create it using the same settings as before. When I try to do so, SharePoint tells me that there’s already a SharePoint IIS Application Pool (SPIisWebServiceApplicationPool) that exists with the same name:
So the first thing you think to check is IIS, right? I did that and did not see the Application Pool to delete it.
Not accepting defeat and wanting to retain my naming convention I looked into this a little further; Is SharePoint 2010 storing a list of Application Pools somewhere and not clearing them out properly?
After a little searching, it struck me that perhaps this was something I could sort out with PowerShell. Here’s how:-
I queried the list of Application Pools using Get-SPServiceApplicationPool to ensure the one I’d previously created was indeed still there and accessible to PowerShell
Then it’s as simple as calling Remove-SPServiceApplicationPool to remove it.
That's it. You've tidied up the the farm by removing the application pool and got to keep your precious naming convention. Thanks PowerShell - I'll sleep easy now.
Remove-SPServiceApplicationPool : An object in the SharePoint administrative framework, "SPIisWebServiceApplicationPool Name=xxxxxxxxxx", could not be deleted because other objects depend on it. Update all of these dependants to point to null or different objects and retry this operation. The dependant objects are as follows:
ReplyDeleteSPSubscriptionSettingsServiceApplication Name=xxx_xxx_xxx_ConfigurationDb_xxx
At line:1 char:32
+ Remove-SPServiceApplicationPool <<<< $appPoolName
+ CategoryInfo : InvalidData: (Microsoft.Share...ApplicationPool:SPCmdletRemoveI...ApplicationPool) [Remove-SPServiceApplicationPool], InvalidOperationException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletRemoveIisWebServiceApplicationPool
What exactly is meant by this? It's not entirely clear...
ReplyDeleteI tried to delete the app pool with Remove-SpServiceAppication Pool "Secure store Service Pool" and then Y
ReplyDeleteIt says object reference not set to an instance of an object
Hi,
ReplyDeleteTried everything listed, somehow it says Object reference not set to an instance of an object.
At line:1 Char:32