MOSS 2007 - Delete recycle bin for 10 personal sites - HOW???

Hi all
I need to delete the First and Second stage Recycle bin for all of our personal sites, as the total size of these has somehow exceeded 140GB.
I am however stuck as to how to do this. I have tried lots of Powershell scripts to get this done, but nothing has worked. I also tried to just switch off the Recycle Bin but this operation just times out, as the Bin is too large now for this to work.
My most recent Powershell script that I tried is the only one that didnt throw any errors and seemed to do something for about 6 seconds, but checking the recycle bin for the site I tried it against shows that it is still full:
param([string]$Url, [switch]$help)
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
function GetHelp()
$HelpText = @"
DESCRIPTION:
NAME: Remove-SPSiteSecondStageRecycleBin
Empties the second-stage recycle bin for a Microsoft.SharePoint.SPSite Collection
PARAMETERS:
-url Url to SharePoint Site Collection
SYNTAX:
Remove-SPSiteSecondStageRecycleBin -url http://ansafile
Empties the second stage recycle bin for the SiteCollection.
Remove-SPSiteSecondStageRecycleBin -help
Displays the help topic for the script
$HelpText
function Remove-SPSiteSecondStageRecycleBin([string]$url)
$siteCollection = New-Object Microsoft.SharePoint.SPSite($url);
$recycleQuery = New-Object Microsoft.SharePoint.SPRecycleBinQuery;
$recycleQuery.ItemState = [Microsoft.SharePoint.SPRecycleBinItemState]::SecondStageRecycleBin;
$recycleQuery.OrderBy = [Microsoft.SharePoint.SPRecycleBinOrderBy]::Default;
$recycledItems = $siteCollection.GetRecycleBinItems($recycleQuery);
$count = $recycledItems.Count;
for($i = 0; $i -lt $count; $i++)
$g = New-Object System.Guid($recycledItems[$i].ID);
$recycledItems.Delete($g);
$siteCollection.Dispose()
if($help) { GetHelp; Continue }
if($url) { Remove-SPSiteSecondStageRecycleBin -url $url }
After pressing Enter after adding the above, I then entered the below into Powershell:
Remove-SPSiteSecondStageRecycleBin -url http://ansafile
This seemed to do something, but not what I needed it to do, ie delete the recycle bin for the whole sharepoint insstallation. ANSAFILE is the internal name of the Sharepoint site. Also, I am using Powershell v2, in an ISE window. My server is running Windows
Server 2008 Std x64 edition. Sharepoint version is 12.0.0.6565
Hopefully someone can help, as I have never used Powershell before, and had to take over the Sharepoint which I have never done before either, and its a bit of a struggle
Thanks to all
Naz

Hi, I tried using that code, I pasted it into a Powershell ISE window, pressed enter, and got the following:
GAC    Version        Location                                                                                                                                                   
True   v2.0.50727     C:\Windows\assembly\GAC_MSIL\Microsoft.SharePoint\12.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.dll                                                      
New-Object : Constructor not found. Cannot find an appropriate constructor for type microsoft.sharepoint.spsite.
At line:3 char:19
+ $site = new-object <<<<  microsoft.sharepoint.spsite($url);
    + CategoryInfo          : ObjectNotFound: (:) [New-Object], PSArgumentException
    + FullyQualifiedErrorId : CannotFindAppropriateCtor,Microsoft.PowerShell.Commands.NewObjectCommand
I have no idea what this means, or how to resolve it. I tried to find some solutions onlione, but nothing came up. Any ideas?
Thanks for your help
Naz

Similar Messages

  • PowerShell - to search recycle bin - for any document with title containing "disaster" in it?

    Hi there,
    I am looking for PowerShell - to search recycle bin - for any document with title containing "disaster" in it? 
    E.g. it should search for any documents with title "SharePoint Disaster Recover.doc" or whatever title contains this word?
    Thank you so much.

    This should do it:
    Get-SPSite http://yourServer/sites/yourSite |
    Select -ExpandProperty RecycleBin |
    Where { $_.Title -Like "*disaster*" } |
    Select DirName, Title
    or for all Site Collections in the farm:
    Get-SPSite -Limit All |
    Select -ExpandProperty RecycleBin |
    Where { $_.Title -Like "*disaster*" } |
    Select DirName, Title
    Mike Smith TechTrainingNotes.blogspot.com
    Books:
    SharePoint 2007 2010 Customization for the Site Owner,
    SharePoint 2010 Security for the Site Owner

  • I have several disks with many comedy routines;I want to select a few from each disk and combine them to one disk for my personal use.How?

    I have several disks with many comedy routines;I want to select a few from each disk to make one single disk for my personal use.How?

    Copy the routines into a new folder on your hard drive. Then burn the folder to a new blank disc using Disk Utility.

  • I deleted the tab for inbox in mail how do I get it back?

    I deleted the tab for inbox in mail how do I get it back? The small oval tab next to sent box and flagged, just under the taskbar.

    Is this where the icon was ?

  • I need explorer for certain web sites, how do I get it back for those?

    I need explorer for certain web sites, how do I get it back for those? I had an icon in case I needed Explorer, but now Firefox comes up. How do I change that back?
    Thank you!

    You can launch Internet Explorer from its icon on the desktop, Start Menu or the Quick Launch section of the taskbar. If you've lost the shortcuts somehow, you can create one as follows:
    # Right-click the desktop and choose New, then Shortcut.
    # Click the Browse button and select the following file:
    #* C:\Program Files\Internet Explorer\iexplore.exe
    # Give the shortcut a name, like ''Internet Explorer'' then click the Finish button.

  • Indentify deleted (recycle bin) items in SP10/13

    I'm trying to find all documents on a sharepoint server, including the ones that are in the recycle bins.
    At the moment I'm using the following to find all items in the document libraries
    foreach (SPWebApplication app in SPWebService.ContentService.WebApplications) {
    foreach (SPSite site in app.Sites) {
    foreach (SPWeb web in site.AllWebs) {
    foreach (SPList list in web.Lists) {
    if (list is SPDocumentLibrary) {
    foreach (SPListItem item in list.Items) ...
    and accordingly for finding all items in the recycle bins:
    foreach (SPWebApplication app in SPWebService.ContentService.WebApplications) {
    foreach (SPSite site in app.Sites) {
    foreach (SPWeb web in site.AllWebs) {
    SPRecycleBinItemCollection recycleBinItems = web.RecycleBin;
    foreach (SPRecycleBinItem recycleItem in recycleBinItems)
    This gives me all the documents, BUT since a recycle item has another ID/GUID then a list item I am unable to identify the recycle bin items since identifying them with their title is not enough for me.
    Is there any way to access their previous GUID without restoring them or searching them differently to get the GUID directly?

    There is such property as LeafName in SPRecycleBinItem, which is the same as earlier
    Id in SPListItem for files (not for folders). If SPListItem was a file, then its LeafName would be "id" + "_.000" after deleting; If SPListItem was a folder, then its LeafName would be earlier Name of SPListItem.
    Source: http://sharepoint.stackexchange.com/questions/38780/how-to-know-old-id-of-item-in-recycle-bin

  • MOSS 2007- Migration Tools available for data extraction

    Hi All,
    I am working on MOSS 2007. I need export entire data from sharepoint portal to excel files. The data could be from Lists, Libraries, Content Types, Static Page data etc. The amount of data is huge.
    1) Is there any migration tool available for such extraction? Kindly suggest.
    2) Also is it possible to search for data in entire web site based on the content type?
    Thanks.

    Hi,
    We don't have ready script, you might have to modify one.
    Check below URL if they help you,
    http://blogs.technet.com/b/heyscriptingguy/archive/2014/02/04/use-powershell-to-create-csv-file-to-open-in-excel.aspx
    http://technet.weblineindia.com/web/export-data-to-excel-using-openxml-sdk/2/
    https://support.office.com/en-us/article/Share-Excel-data-with-others-by-exporting-it-to-a-SharePoint-site-262ba5a9-d065-4ad6-9d92-c16a10ae8ac8?ui=en-US&rs=en-US&ad=US
    https://selecteditemsexport.codeplex.com/
    Regards
    Prasad Tandel

  • MOSS 2007 bulk upload tools for upload 80 gb data to library

    hi,
    i have created document library on MOSS 2007 , now i need to upload 80 gb data to library .
    please help.
    Thanks,
    Saidireddy

    Assuming you're migrating from the file system:
    - Windows Explorer view for simple scenarios (limited feedback if something goes wrong)
    - You can try if MS SyncToy supports 2007 (free tool, advanced features)
    - There are free community tools out there on TechNet gallery and CodePlex
    - Lastly, to do an Enterprise level migration you will need to use a commercial product such as DocAve or Quest
    So it depends on your needs and requirements
    Kind regards,
    Margriet Bruggeman
    Lois & Clark IT Services
    web site: http://www.loisandclark.eu
    blog: http://www.sharepointdragons.com

  • How to hide Recycling bin and View All Site Content

    Is there a way to hide the "View All Site Content" and the "Recycling Bin" without modifying with S Designer.
    Thanks

    Hiding these links with CSS is a "band-aid" fix.  Users are still downloading the HTML for these controls, and users that don't use CSS will still see them in their entirety.  The best option is to remove them from your site's master page entirely.
    First, look for the following lines of code in your master page.  This code renders the "View All Site Content" link:
    <Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="ViewFormPages">
    <div class="ms-quicklaunchheader"><SharePoint:SPLinkButton id="idNavLinkViewAll" runat="server" NavigateUrl="~site/_layouts/viewlsts.aspx" Text="<%$Resources:wss,quiklnch_allcontent%>" AccessKey="<%$Resources:wss,quiklnch_allcontent_AK%>"/></div>
    </SharePoint:SPSecurityTrimmedControl>
    Now, the "Recycle Bin" link should look something like this:
    <SharePoint:SPLinkButton runat="server" NavigateUrl="~site/_layouts/recyclebin.aspx" id="idNavLinkRecycleBin" ImageUrl="/_layouts/images/recycbin.gif" Text="<%$Resources:wss,StsDefault_RecycleBin%>" PermissionsString="DeleteListItems"/>
    Now save, check in, and publish your changes.  I hope this helps!
    Kyle

  • HT4528 How can I find a Note I accidentally deleted? Is there a recycle bin for Notes?

    I am missing the note I made that was like a journal. I did not delete it but it isn't showing up in my list. I think it may have been accidentally deleted. Is there any chance of recovery?

    Here are the methods to recover deleted notes from iPhone:
    Restore with iCloud backup
    Restore with iTunes backup
    Extract from iCloud or iTunes backup using an iPhone backup extractor;
    Recover directly from iPhone using an iPhone data recovery app.

  • I have an issue with passwords when I first type them in any social or personal site, how can I hide the passwords when im typing so no one see them...

    Well the thing is that when I open any site that requires passwords everyone can see what I´m typing instead of appearing dots like in old version for example:
    username: littlegirl
    password: hjy --> this is what i dont want isntead of appearing words i want dots
    just after typing and entering dots appears where can i switch this?

    Hi,
    Please check if this happens in [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode]. Safe mode disables the installed '''Extensions''', and themes ('''Appearance''') in '''Tools''' ('''Alt''' + '''T''') > '''Add-ons'''. Hardware acceleration is also temporarily disabled - the manual setting is '''Tools''' > '''Options''' > '''Advanced''' > '''General''' > [https://support.mozilla.org/en-US/kb/Options%20window%20-%20Advanced%20panel?as=u '''Use hardware acceleration when available''']. All these settings/options/add-ons can also be individually or collectively disabled/enabled/changed in Firefox normal mode to check if an extension, theme, option or hardware acceleration is causing issues. Disabling/enabling hardware acceleration, and some types of add-ons in normal mode may require a Firefox restart.
    [http://support.mozilla.com/en-US/kb/Uninstalling+add-ons Uninstalling Add-ons]
    [http://kb.mozillazine.org/Uninstalling_toolbars Uninstalling Toolbars]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
    [https://support.mozilla.org/en-US/kb/Options%20window Options]
    An easier method would be to consider the [https://support.mozilla.org/en-US/kb/reset-firefox-easily-fix-most-problems Reset Firefox] feature via '''Help''' ('''Alt''' + '''H''') > '''Troubleshooting Information'''.
    (To revert to the previous profile, close the new profile, start Firefox and choose the '''*.default''' profile. While the [https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles Profile Manager] is open, you can also delete the newly reset profile (the one containing random numbers)).
    [https://support.mozilla.org/en-US/kb/Managing-profiles Managing profiles]
    [https://support.mozilla.org/en-US/kb/Profiles?s=profile&r=2&e=sph&as=s Profiles Howto]

  • Spwll check is in spanish for a site while in english for all other sites, how do I change it back

    ''Duplicate post, continue here - [https://support.mozilla.com/en-US/questions/792930]''
    For some reason Firefox changed the spell check language to spanish, and I don't know how to change it back to english.

    http://support.google.com/toolbar/bin/answer.py?hl=en&answer=9279
    Also, on the results page, there will be a little gear icon in the upper right corner.   Click that.   Click Languages along the left.  Choose "English" at the bottom.

  • I deleted my saved password from a site, how do I get the site to remeber my new password? The dropdown box doesn't appear now when I type in my password

    I removed my saved password from some sites that I needed to change my password for because they wouldn't auto log me in anymore. So I removed them and then retyped my new passwords in and the usual "do you want us to remember this password" drop down box didn't pop up.

    Firefox would normally have asked if you want to store a new password when you erase the password and enter a new password.
    Did you check the password exceptions and make sure that the Password Manager is enabled?
    *http://kb.mozillazine.org/User_name_and_password_not_remembered

  • Product Database Management For Manufacturers Web Site - How do I do this W/ Templates?

    In short, I have an excell database of product. I am
    developing a web site for a factory with many products. I have
    never used a database to fill specific template data, except for
    3rd party shopping carts...
    So, how do create a database, upload it to the site, and
    allow users to access product information? Looking for your typical
    database to template set up with tags in specics spots withint he
    HTML of the template that reference the columns of data in a
    specific row of the database.
    I basically need a shipping cart, but with no "BUY" or "VIEW
    CART" buttons.
    Thanks!

    I'm not an expert on this but you need to know what sort of
    server
    you're going to be using. The server can drive what database
    you're
    going to use.
    MySQL?
    MSSQL?
    Access?
    There are others.
    If you're on a PHP server you may want to stay with MySQL.
    Talk to your
    server admin to see what is installed. MySQL has a control
    panel called
    "Workbench" that can manage the database.
    MSSQL uses Enterprise Manager to administer the database.
    Whether it's MySQL or MSSQL, each will be able to import
    data; same can
    be said for Access. Access is probably the least flexible; in
    other
    words, it's not built for as high of performance but for
    small sites
    without a lot of traffic, it's probably fine. With Access,
    you basically
    build the tables and everything on your own computer and then
    upload the
    mdb file to the server.
    Once you have the database, you can start to build a page in
    Dreamweaver. The first thing you should do is pick your
    server script
    language VBScript, php, ... You then create a connection to
    the
    database. Once the connection is made, those tables become
    available to
    drag and drop on your page. From there you can do repeats and
    form
    columns of data to display products.
    That's it in a nutshell.

  • Recycle bin to show all deleted items on the site collection for specific user group

    hi there, is there any way where a certain sharepoint group (i.e. site collection members) to view and restore deleted items on theentire collection, without giving them site collection rights orgive them more rights than necessary? we wanted to create
    aSP group that has the permission to restore deleted items and give them to selected users so that our users won't have to contact us when they want to restore a deleted item

    I don't believe you can. If an item get's deleted it should go to the first recycle bin @ /_layouts/15/RecycleBin.aspx
    The Recycle Bin gives a site collection administrator
    greater control when users delete files, versions of files, list items, libraries, lists, and folders from a SharePoint site by providing a second stage safety net before an item is permanently deleted from a site. When a user deletes an item from the Recycle
    Bin, the item is sent to a second stage Recycle Bin (also known as the Site Collection Recycle Bin) that the site collection administrator manages. This article focuses on how a site collection administrator can manage the Recycle Bin for a site collection.
    https://support.office.com/en-US/Article/Manage-the-Recycle-Bin-of-a-SharePoint-site-collection-5fa924ee-16d7-487b-9a0a-021b9062d14b
    Ibrahim Sukari, Technical Consultant | SharePoint | Dynamics CRM |
    LinkedIn Profile

Maybe you are looking for