Skip to main content

Posts

Showing posts with the label PowerShell

Get files / search files from Recycle Bin - SharePoint 2010

Couple of days back, I got a query. A organization has lots of document libraries & lists. And by mistake a user deleted a file from the document library. The administrator of the site collection is sure that the document is in the recycle bin, but cant find it. Recycle bin has thousands of items in it. The administrator knows the name of the file and he wants to restore it back to the original location. Microsoft doesn't provide search capabilities inside Recycle Bin. How will you find the specified file? How will you restore it back to the original place? Here is an answer... using PowerShell. Follow these steps... Step1. Run the below script to find out about the file in site collection recycle bin. (Get-SPSite "http://SERVERNAME:PORT/").RecycleBin | ?{$_.Title -match "DeletedFile"} If a matching file is found, Powershell will display information about the file. You will also be able to find who deleted it. Step 2. Now take the ID of th...

Site Migration using PowerShell - SharePoint 2010

      The content migration APIs provide a simple but flexible solution for migrating content between SharePoint Foundation Web sites. You can export the content from a SharePoint site, along with any dependencies (for example, security, roles, versioning, and other metadata), into single or multiple XML-formatted files called content migration packages. On import to the destination Web site, the packaged data is extracted and interpreted. You can also save the packages to a file server before migrating to a different server.   The object model is designed to work with data ranging from an entire Web site to an item in a list or library. You can select the level of metadata to include with migrated content, as well as choose whether to do a full migration or only an incremental change.   Following are some common scenarios for using the content migration APIs: Publishing content from a development server to a staging server and from a staging server to ...