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 : Get Recycle Bin Item Count
Ketak Bhalsing
May 20
2016
Code
3
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
#check to see if the PowerShell Snapin is added
if
( (Get-PSSnapin -Name
"Microsoft.SharePoint.PowerShell"
-ErrorAction SilentlyContinue) -eq $
null
)
{
Add-PsSnapin
"Microsoft.SharePoint.PowerShell"
}
$siteUrl = Read-Host
"Enter the url of the Site Collection :"
$SPSite = Get-sPSite $siteUrl
#Contains both First Stage & Second Stage Recycle bin Items
$SPRecycleBinItemCollection = $SPSite.RecycleBin;
write-host
"Processing Site: "
$SPSite.RootWeb.Title
"`n"
write-host
"Total No. of Items in Recycle bin: "
$SPRecycleBinItemCollection.Count
PowerShell
SharePoint
Recycle Bin