TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
PowerShell : Delete Site Collection From Recycle Bin
Ketak Bhalsing
May 03
2016
Code
2.2
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
[System.Reflection.Assembly]::LoadWithPartialName(
"Microsoft.SharePoint"
);
$url =
"http://yourWebApplicationURL"
$site =
new
-
object
microsoft.sharepoint.spsite($url);
for
($i=0;$i -lt $site.allwebs.count;$i++)
{
write-host $site.allwebs[$i].url
"...deleting"
$site.allwebs[$i].recyclebin.count
"item(s)."
;
$site.allwebs[$i].recyclebin.deleteall();
}
write-host $site.url
"...deleting"
;
$site.recyclebin.deleteall();
$site.dispose();
PowerShell
SharePoint
Recycle Bin