Friday, October 31, 2014

PowerShell Commands to Delete the Service Applications of SharePoint 2013


A copy of this: 
http://blog.blksthl.com/2013/11/27/delete-the-service-applications-of-sharepoint-2013/


Delete the Service Applications of SharePoint 2013

 
 
 
 
 
 
Rate This

Delete Service Applications in SharePoint 2013
Candyxx
Too much candy?
Cheers all!
I have noted that it is not always that easy to get rid of a Service Application should you wish to remove it completely. It can be either during initial setup, after a service breakdown or for any other reason, you want it gone and you want it to be completely gone when you are done. The next step is often to set it up again from scratch…so any remnants will cause you problems.
So, which way is the easiest to choose? I say PowerShell, 100(or maybe 99) out of 100.
Below, I have for your convenience created oneliners that will take care of all of your Service Applications for you.
After each Command, add the flag -RemoveData to have all data and databases removed at the same time.
Use the -RemoveData with care though, be absolutely sure that all data absolutely needs to be deleted Before using the flag.

The commands available, in alphabetical order
Service Application
Command
Access ServicesRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Access Services”} | Select-Object id).id.tostring()
Access Services 2010Remove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Access Services 2010*”} | Select-Object id).id.tostring()
Application Discovery and Load Balancer Service Application Remove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Application Disc*”} | Select-Object id).id.tostring()
App Management ServiceRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “App man*”} | Select-Object id).id.tostring()
Business Data Connectivity serviceRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Business*”} | Select-Object id).id.tostring()
Excel Services ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Excel*”} | Select-Object id).id.tostring()
Machine Translation ServiceRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Machine Translation*”} | Select-Object id).id.tostring()
Managed metadataRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Managed metadata*”} | Select-Object id).id.tostring()
PerformancePoint Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Performance*”} | Select-Object id).id.tostring()
PowerPoint Conversion Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “PowerPoint Conv*”} | Select-Object id).id.tostring()
Search Administration Web Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Search Admin*”} | Select-Object id).id.tostring()
Search Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Search Service*”} | Select-Object id).id.tostring()
Secure Store Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Secure Store*”} | Select-Object id).id.tostring()
Security Token Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Security Token*”} | Select-Object id).id.tostring()
State ServiceRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “State Service*”} | Select-Object id).id.tostring()
Usage and Health Data Collection Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Usage and Health*”} | Select-Object id).id.tostring()
User Profile Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “User Profile*”} | Select-Object id).id.tostring()
Visio Graphics ServiceRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Visio*”} | Select-Object id).id.tostring()
Word Automation ServicesRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Word auto*”} | Select-Object id).id.tostring()
Work Management Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Work Management*”} | Select-Object id).id.tostring()
Running the commands above will look something like this
DeleteServiceApp
Note: Beware of the signle and double quotes if you copy the code…quotesx

No comments:

Post a Comment