Answered Unable to delete an orphanned web application

  • Sonntag, 11. September 2011 05:13
     
     

    I tried to delete a web app from Central Admin. It raised an error. The IIS website got deleted. But the clontent db and the reference to the web app did not get removed from the Central Admin. Since then, I have been trying to delete this via powershell with the following being reported:

     Get-SPWebApplication http://myWebAppURL  | Remove-SPWebApplication

    Remove-SPWebApplication : An object in the SharePoint administrative framework, "SPWebApplication Name=myWebAppName", 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:
    At line:1 char:79
    + Get-SPWebApplication myWebAppURL  | Remove-SPWebApplication <<<<
        + CategoryInfo          : InvalidData: (Microsoft.Share...PWebApplication:SPCmdletRemoveSPWebApplication) [Remove-
       SPWebApplication], InvalidOperationException
        + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletRemoveSPWebApplication

    Since it does not show what the dependent object is, I have no way of knowing what it is. I don't see any pending timer job for this web application.

    To summarize, the web app is:

    1. Showing in Central Admin
    2. Corresponding IIS sites are gone
    3. Content DB is still there in database

    How do I proceed?


    Thanks, Soumya

Alle Antworten

  • Sonntag, 11. September 2011 05:47
     
     

    Hi ,

    check this url

    http://dhondiyals.wordpress.com/2010/04/11/resolved-an-object-in-the-sharepoint-administrative-framework-could-not-be-deleted-because-other-objects-depend-on-it/


    Regards, Fadi Abdulwahab. http://sqlgoogler.blogspot.com/ Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you
  • Sonntag, 11. September 2011 15:14
     
     

    Thanks Fadi for directing me to Kailashs' blog. The difference is in his error message has a specific dependent object

    The dependant objects are as follows: SPSolutionDeploymentJobDefinition Name=solution-deployment-mywebpart.wsp-0 Parent=SPTimerService Name=SPTimerV3“.

    However, my error does not give this specific object. That means I don't know what the dependent object is.

     


    Thanks, Soumya
  • Sonntag, 11. September 2011 16:25
     
     

    Did you try this?

    http://spmike.com/2010/08/13/deleting-orphaned-service-web-application-pools-in-sharepoint-2010



    Aryan Nava | Twitter: @cloudtxt | Blog: http://virtualizesharepoint.com
    Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you.

    Disclaimer: This posting is provided "AS IS" with no warranties.

  • Sonntag, 11. September 2011 18:41
     
     
    Yes Aryan. I tried this. The web(service) app pool won't delete saying there is a web application that uses the app pool. On the other hand, I am not able to delete the web app itself that gives the error given in my initial post.
    Thanks, Soumya
  • Donnerstag, 27. Oktober 2011 20:13
     
     Beantwortet
    Although I could not get a very clean resolution, I could get around with this problem by creating a new webapp and attaching the content db to that webapp. However, before doing this, I had to try deleting all orphanned objects from SharePoint. Followed a blog similar to http://sharepointserver-2007.blogspot.com/2008/10/how-to-delete-orphan-configuration.html. Once the above was done, I could create a new webapp and take the content db of the old webapp that I could not delete and attach.
    Thanks, Soumya
  • Dienstag, 1. Mai 2012 17:17
     
     

    were you ever able to remove the original "problem" web application? It looks like you were able to recreate a new one and move the content to it, but that you were not able to clean up the original one.

    thanks

    Eric VanRoy

  • Dienstag, 1. Mai 2012 17:59
     
     
    Last time I ran into this, I ended up deleting manually from the config DB without any repurcussion. This is obviously unsupported so the only alternative assuming a corrupt config db is to create a new farm.

    Pranav Sharma
    SharePoint Consultant, Portal Solutions

    Twitter: @ePranav LinkedIn: ePranav Facebook: PortalSolutions Blog: pranavsharma.com About Me: pranavsharma.info

  • Dienstag, 15. Mai 2012 16:24
     
     

    for what it is worth... It was able to be cleared up with a MS call. they had ot look in the sitemap database to determine a GUID and then run powershell commands to delete the non-existent db reference. Highly reoemmend caution when doing this since it would be working directly with GUID's. contact me is you wish the powershell commands.

    Eric VanRoy

  • Dienstag, 15. Mai 2012 17:24
     
     

    Hi Eric,

    I wish the powershell commands if you have time please. May be wtih a little bit of some step by step explanation.


    Thanks, Soumya | MCITP, SharePoint 2010

  • Dienstag, 15. Mai 2012 21:20
     
     Vorgeschlagene Antwort

    After determine the GUID of the offending database (it is in the sitemap table of the config database, but it is not supported to query the database itself so you will need to look in a restored backup of that database :) ) then you can execute the following powershell:

    $db-Get-SPDatabase -id <GUID you recovered above>;

    $db  

    $db.Delete()

    This removed the site collection that was causing issues.

    Note: The "$db" step is not needed, but PLEASE do it to verify you have the correct database. If you have the correct one it will have no value for the web applicaiton name, but the Site Collection count will be 1.

    Hope this helps someone else too.

    Eric VanRoy

  • Dienstag, 15. Mai 2012 21:27
     
     
    OK thanks Eric.

    Thanks, Soumya | MCITP, SharePoint 2010