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

Similar Messages

  • 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

  • Setting a global margin for any documents to print

    Hello,
    On a Mac running OS X, I have a ruby/java script allowing me to open a Microsoft Word document and print it as a PDF (and extra stuffs, but that's not part of the problem). During the conversion from Word to PDF for most of my documents I get a dialog saying 'A footer of section X is outside of the printable area of the page...'. What I would like to do is not to write a script to click 'yes' when a dialog open but to try to set the default margin for printing to 0. In the 'page setup', there is an option to create customized 'paper size', with a giving width, height and margins (that I can set to 0). By default the paper size is selecting A4, but I would like to find a way to set this paper size as a default to my customized paper size for any document opened on Microsoft Word or printed as PDF!  If I select manually the customized paper size after I open the document on Word, I can print it without having the dialog.
    So my question is to know if there is a way to set a global margin for printing to 0 (let me know if I need to use Acrobat Pro, Distiller etc.), whatever the way is.
    Thank you very much!
    Vincent

    Alan,
    There is nothing specific with the SDK that you have to print a marketing document such as a Sales Order, PO, etc.  What you may want to look at in the 2005A SDK is the "PrintEvent" object.  This event lets you catch a print event in the SAP Business One application, get the relevant data that is sent to the printer and then edit it using a third-party editing tool such as Crystal Reports. The PrintEvent event provides an exit point that allows you to integrate third-party tools for reporting and document editing.
    You can look at the sample code for the PrintEvent here ...
    ..\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB.NET\20.PrintEvent
    HTH,
    Eddy

  • How does one ensure an automatic save function every 5 mins for any document you are working on. Yesterday I erased a doc I was on and had to rework from the start.

    How does one ensure an automatic save function every 5 mins for any document you are working on. Yesterday I erased a doc I was on and had to rework from the start.

    Well I understand that auto save is already present and saving your doc every 5 mins. But then why do you think, this did not happen yesterday in the following case?? I wrote one page of a long document and wanted to format it before proceeding. I selected the part to be formatted and instead erased it. I could not find that page again. I had to rewrite the matter.

  • Cannot search file content on Word document with embedded Excel table

    Cannot search file content on Word document with embedded Excel table. I have Windows 8.1 64-bit and Office 2010 Professional. Only phrases from within Excel tables are not searchable. I have many Word documents with embedded Excel table.
    I use it for my invoices. Those invoices are converted to pdf to be sent via mail. Searching the same phrases in related pdf files Works fine. And yes, folders are indexed, searching service is active......... For example I can find all invoices that have
    specific address or name, which is located in word document, but cannot find invoices with specific item name or price, being that information is in embedded Excel table. (not linked, embedded). I thought that is a question for Windows forum, but guys directed
    me here on Office forum. To clarify, I do not use Ctrl+F inside some document, but Windows Search in my folders. Probably the same happens in Office 2013.
    Thank you.

    Hi, I have a lot of Word documents (invoices, offers). Main part of those documents is embedded Excel file because it is easier to do mathematics in Excel than in Word. There are columns with description, unit price, quantity, taxes... Now, I need
    to find who bought HP switch 2530-24G last year. I open folder with last year invoices and search "2530". Cannot find any. But if that document was converted to pdf for mail, than I can find that phrase. Windows search does not work for content if the content
    is in embedded file.

  • Pricing procedure determination for complaint document with reference to billing

    Hello Guys,
    I am configuring complaint process for project purpose and I got stuck. I need to change the pricing procedure which is determined for complaint
    document . Right now the pricing procedure is copied from Billing Document for which complaint refers to.
    I am searching a place in configuration where I could change the pricing procedure determination for complaint document with reference to billing doc.
    Could you please advise where I can find it ?
    Thank you in advance!
    Br,
    Frederic

    Hello Frederic,
    I would check the following in SPRO:
    - CRM
    - Basic Functions
    - Pricing
    - Pricing in the Business Transaction
    - Determine Pricing Procedures
    Here the pricing procedure depends on sales organization, division, distribution channel, document pricing procedure and and customer pricing procdure.
    Best regards,
    Thomas Wagner

  • Every time i empty my recycle bin it comes up with error code -50. What can i do

    every time i empty my recycle bin it comes up with error code -50.

    Some trash tips:
    http://support.apple.com/kb/HT1526?viewlocale=en_US&locale=en_US
    http://osxdaily.com/2012/07/19/force-empty-trash-in-mac-os-x-when-file-is-locked -or-in-use/
    http://www.thexlab.com/faqs/trash.html
    http://fairerplatform.com/2013/10/force-empty-trash-os-x-mavericks/
    You can also download TrashIt, it can be helpful in stubborn situations:
    http://www.nonamescriptware.com/

  • Report for Purchasing Documents with Over Delivery or Under Delivery Tolera

    Dear All !
    please suggest me a report for Purchasing Documents with Over Delivery or Under Delivery Tolerance limit.
    thanks n regards
    Naagsekhar

    hi,
    Go to ME2N --> Use dynamic selection, choose for hte Puchase doc item --> here select for the over and under delivery and then execute the report..
    Hope it helps..
    Regards
    Priyanka.P

  • How i do to make backups of any documents with iCloud?

    How i do to make backups of any documents with iCloud? in mobile me i can do thay buy with iCloud it its not possible.
    in Mobile Me i can do bachups in a destination called Mobile Me disk, in this store backup docoments world, exel, music photos, etc.
    how i do this in iCloud? or of another way with apple?

    This facility is not provided in iCloud: you will need to find a third-party alternative. This page examines some options:
    http://rfwilmut.net/migrate3

  • Powershell "RunAs" causing recycle bin issues. Would like some input please.

    I developed a script to assist our UserAdmins with creation of AD user accounts and create home folders on the server shares.  I am encountering an issue with the recycle bin becoming corrupt when the user first logs in.  This script must be run
    with an elevated account with permissions to the shares.  I also noted a change in the way the recycle bin is displayed in the share.
    The home folder is created using: 
    New-Item -ItemType Directory -Force -Path $directory
    If I log into my machine as my elevated account and run powershell/powershell_ise, all is well.  The recycle bin displays as "Recycle Bin" with the correct icon image
    However, if I log into my machine with my non-elevated account and select "Run as a different user" for Powershell or Powershell_ISE and use my same elevated account from above the users receive "corrupt" recycle bin errors when logging
    in or viewing the recycle bin properties.  Additionally, recycle bin is now listed as "$Recyle.Bin" and is using a folder icon.  This issue is resolved by removing the users AD account from the home folder permissions and re-adding it with
    identical permissions.
    I see this behavior using Win8.1 x64 as well as Win7 x64 Enterprise.
    On another somewhat relevant topic, when launching Powershell_ISE with "Run as a different user" it often freezes and must be forcibly closed.  Could be relevant, could be coincidence.
    I appreciate any input you may have regarding this issue.
    Thanks,
    Jeff

    I'm trying not to come off as combative, but I feel you are misunderstanding or I am not being clear. The recycle bin is auto-created when the user first logs into the machine as is are the sub folders to the parent folder.  All of the desktop.ini files,
    recycle bin folders and various other user profile objects are created upon first login by that user inside of the folder created in the PowerShell script.  Prior to this the user admins were manually creating the same parent folder with their elevated
    accounts.  Given the isolated conditions in which it works vs when it doesn't there is no indication that permissions are causing this issue.
    I'll try to explain why the issue, I believe, lies with PowerShell.
    1) Launch a PowerShell session from the current logged in elevated account
    2) Run the script
    3) Users home folder is created
    4) Upon user logging in for the first time the user profile objects are created in the home folder on the share
    5) No issues with recycle bin
    vs - from the same machine, same script
    1) Launch a PowerShell session with "Run as different user" context using the same account from above
    2) Run the script
    3) users home folder is created
    4) Upon user logging in for the first time the user profile objects are created in the home folder on the share
    5) Recycle bin is corrupt and icon is wrong
    The only thing that changes between these 2 scenarios is the way in which PowerShell is run.
    It's the same computer, the same test user account, the same share, same GPOs and AppSense policies.
    Scenario 1 is run from elevated account logged into local machine
    Scenario 2 is run from non-elevated account with "Run as different user" context using the elevated account
    I know I'm sounding like a broken record but it doesn't make sense AppSense or GPO or even folder permission would cause an issue when the folder is being created using the same account in both situations.

  • How to search in Pages for any number or any character, using wildcards

    Is it possible in Pages to use wildcards to search for any instance of any number? For example, I want to find all occurrences of any one or two digits followed by a colon, such as 8: or 37:
    If I can't use wildcards, is there any other way to search, other than tediously searching for every instance of 1, every instance of 2, etc.?
    Thanks!
    Sue

    Hello
    Here is an enhanced version.
    --[SCRIPT highlight_ digitspluscolon]
    Enregistrer le script en tant que Script : highlight_ digitspluscolon.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Pages:
    Il vous faudra peut-être créer le dossier Pages et peut-être même le dossier Applications.
    Ouvrir un document traitement de textes Pages
    aller au menu Scripts , choisir Pages puis choisir highlight_ digitspluscolon
    Dans les éléments de texte, l'arrière plan des groupes de chiffres
    suivis d'un caractère deux points sera mis en rouge.
    --=====
    L'aide du Finder explique:
    L'Utilitaire AppleScript permet d'activer le Menu des scripts :
    Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case "Afficher le menu des scripts dans la barre de menus".
    --=====
    Save the script as a Script: highlight_ digitspluscolon.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:
    Maybe you would have to create the folder Pages and even the folder Applications by yourself.
    Open a Pages word processor document.
    go to the Scripts Menu, choose Pages, then choose "highlight_ digitspluscolon"
    In the text objects, the background of groups of digits
    with a trailing colon will be set to red.
    --=====
    The Finder's Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the "Show Script Menu in menu bar" checkbox.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2010/07/17 -- enhanced to treat also text boxes and shapes
    --=====
    on run
    local en_liste, le_dernier, un_groupe, le_premier, recul
    local les_boites, une_boite, les_formes, une_forme
    Try to treat the main text layer
    tell application "Pages"
    try
    set le_document to name of document 1
    tell document 1 to set le_texte to body text
    on error
    set le_texte to ""
    end try
    end tell -- Pages
    if le_texte > "" then
    set en_liste to my decoupe(le_texte, ":")
    set le_dernier to 0
    tell application "Pages" to tell document le_document
    repeat with i from 1 to count of en_liste
    set un_groupe to item i of en_liste
    set le_dernier to le_dernier + 1 + (count of un_groupe)
    set recul to 0
    repeat with j from 1 to 10
    if character -j of un_groupe is in "0123456789" then
    set recul to -j
    else
    exit repeat
    end if
    end repeat -- with j
    if recul < 0 then
    set le_premier to le_dernier + recul
    set character background color of characters le_premier thru le_dernier to {65535, 0, 0}
    end if -- recul < 0
    end repeat -- with i
    end tell -- Pages…
    end if -- le_texte > ""
    Try to treat text boxes
    try
    tell application "Pages" to tell document le_document to set les_boites to every graphic whose class is text box
    on error
    set les_boites to {}
    end try
    if les_boites is not {} then
    repeat with une_boite in les_boites
    tell application "Pages" to tell document 1
    tell une_boite to set le_texte to object text
    end tell -- Pages…
    my highlight(le_document, une_boite, le_texte)
    end repeat
    end if -- with f
    Try to treat shapes
    try
    tell application "Pages" to tell document 1 to set les_formes to every graphic whose class is shape
    on error
    set les_formes to {}
    end try
    if les_formes is not {} then
    repeat with f from 1 to count of les_formes
    I know that using whose is more efficient than using an index but, in Pages '09, whose doesn't apply to shapes. *)
    tell application "Pages" to tell document 1
    set une_forme to item f of les_formes
    tell une_forme to set le_texte to object text
    end tell -- Pages
    my highlight(le_document, une_forme, le_texte)
    end repeat -- with f
    end if
    end run
    --=====
    on highlight(un_document, un_contenant, son_Texte)
    local en_liste, le_dernier, un_groupe, recul, le_premier
    set en_liste to my decoupe(son_Texte, ":")
    set le_dernier to 0
    tell application "Pages" to tell document un_document to tell un_contenant to tell object text
    repeat with i from 1 to count of en_liste
    set un_groupe to item i of en_liste
    set le_dernier to le_dernier + 1 + (count of un_groupe)
    set recul to 0
    try (*
    Useful if a shape was erroneously pasted in a text box. *)
    repeat with j from 1 to 10
    if character -j of un_groupe is in "0123456789" then
    set recul to -j
    else
    exit repeat
    end if
    end repeat
    end try
    if recul < 0 then
    set le_premier to le_dernier + recul
    set character background color of characters le_premier thru le_dernier to {65535, 0, 0}
    end if
    end repeat
    end tell -- Pages
    end highlight
    --=====
    on decoupe(t, d)
    local oTIDs, l
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to oTIDs
    return l
    end decoupe
    --=====
    --[/SCRIPT]
    It scans the main text layer in Word Processor documents.
    It scans text boxes and shape in Word Processor and Layout documents.
    Is it useful to scan :
    headers, footers, tables ?
    Yvan KOENIG (VALLAURIS, France) samedi 17 juillet 2010 21:07:04

  • Putaway Block in Storage Bin for any specific Material Code

    Hi Experts,
    We have a problem, we have allowed mix storage, addition to stock in the storage type, our requirement is this, that we want to block one bin aa-01-01 for some specific material code xxxxx, but we want to allow putaway other material codes to that bin.
    How can we achieve this. Can we use LS07 or some other solution. Please suggest at the earliest.
    Regards
    Ishu

    Hi,
    In standard system, you can block one specific bin for the specific material with Putaway strategy "Fixed bin" by maintaining this bin in material master. It is unclear that you set "allowed mix storage" and again required material specific putaway in bin.
    You can change "Mixed storage" indicator to blank. Which explains "___"  Mixed storage is not allowed
           All storage units in a storage bin must contain the same material and batch (one quant).
    If you don't want to change any of current setting you'll need to use the user exit and maintain custom table where you can maintain specific bin for the material for the warehouse. After determination of the bin to putaway in the standard code you can check if it is conflicting to the entry in your custom table.
    Hope this'll help.
    Regards,
    Sudhir

  • Request for any document to configure Performance Appraisal

    Hi, expert. i am working on ECC 6.0 for Performance of Appraisal. If any one have any document for this configuring of Appraisal, pl do send to me.
    It is an urgent request.your points are assured. Thanks and regards Punith
    Edited by: Zsolt Markus on Jan 30, 2008 12:13 PM

    for concepts
    https://websmp107.sap-ag.de/~form/sapnet?_SHORTKEY=01200252310000079831&
    useful blogs
    /people/community.user/blog/2007/01/18/objective-setting-appraisals-document-datamodel
    /people/sap.user72/blog/2007/02/20/objective-setting-appraisals-the-web-environment
    /people/sap.user72/blog/2007/02/20/objective-setting-appraisals-the-web-environment

  • How to do query Optimization ,plz share any documents with real examples

    Hi All,
    could any one please provide me some informations, how can i do query optimization in oracle using Third party tool sql developer .
    i am working oracle 10g version,please share with me if any documents or ppt like that.
    Thanks
    Krupa

    879534 wrote:
    Hi All,
    could any one please provide me some informations, how can i do query optimization in oracle using Third party tool sql developer .SQL Developer is Oracle's development tool, not a third party tool.
    Questions about using SQL Developer should go in the SQL Developer forum:
    SQL Developer
    I'll move the question there for you.

  • Search in file for exact phrase with special symbols [windows 8.1]

    When I search, for example, for 'name.txt' in file content it seems that it finds all files with 'name' and 'txt' in any order.
    Windows 7 seems to have options related to this, like 'use natural language' and 'find partial matches'. But I see nothing in windows 8.
    Please let me know if it's possible to search for exact phrase with special symbols.
    Thanks.

    When I search, for example, for 'name.txt' in file content it seems that it finds all files with 'name' and 'txt' in any order.
    You need to either use the Search tools or learn the Advanced Query Syntax (AQS) that they imply.  Actually you need to do both because the tools only help with the keyword prefix and not with the following syntax that is required to do the specific
    search that you want to do.
    So, for example, you knew that you wanted to find  name.txt  only in file (or directory?) names so you would use the  Other Properties > Name  tool  to be sure that your query had that prefix  Name:name.txt  
    In fact, that was a surprise for me just now because I thought the default syntax for Name with no other specification would be "contains" (which would be Name:~=name.txt) but apparently it defaults to  Name:~<name.txt  which means
    "begins with"  name.txt.  In fact, from an efficiency point of view that is probably a logical default.  But from a usability point of view it is terrible because it means that when users really want  Name:name.txt  to mean either
    "contains" or "ends with" they won't have a clue what to do to make those differences.
    Ref:
    http://windows.microsoft.com/en-us/windows7/Advanced-tips-for-searching-in-Windows
    FYI
    Robert Aldwinckle

Maybe you are looking for

  • How to delete the coverages for an ACTIVE service contract ?

    Hi ,      I have created coverages for few service lines for a service contract in R12. The contract is in ACTIVE status. If it was in ENTERED state, I could use OKS_COVERAGES_PUB.DELETE_COVERAGE to delete the coverages. But this contract is in  ACTI

  • XPath and XQuery

    Hi all, What's the difference between the XPath and XQuery, can XPath has better performance than XQuery? Regards, Jane

  • Trying to decide between i7 and quad core - was told that i7 will overheat?

    Hi, Did some searching in old threads on this here and online - seemed inconclusive so thought I'd ask again since the Core i7s have been out a while now. I've been trying to decide between buying a quad core and one of the recent MPB 15" i7s (specif

  • Error when compiling SearchBean.jav

    IN the scheduler portlet installation steps using the latest JPDK 3.0.9.1, when compiling SearchBean.java i get the following error : D:\OiAS\Apache\Apache\htdocs\schedulerportlet>javac ConnectionParams.java D:\OiAS\Apache\Apache\htdocs\schedulerport

  • Unable to open Lab-view - getting pop-up "unable to open resourse files"

    Hi I have had Lab-view 7.1 running on my PC  for months.  On loading up this morning I got the pop-up "unable to open resourse files". Presumably this is a fatal error and I need to uninstall then reinstall.  The rest of my PC applications are workin