Solved

sharepoint monitor the nr of items in a list or document library.

Posted on 2012-03-15
1
214 Views
Last Modified: 2012-04-26
Hi,

I want to create a script so i can monitor the evolutions of number of items in sharepoint 2007 document libraries. (powershell, vbs, ...)

=> i want to insert this in an sql table, or use kaseya monitoring.

=> the lists are very large and i want to have a consitent evolutions of the nr of items in the list. for performance and provisioning.

Can anyone help me out?

thanks a lot
0
Comment
Question by:capsugel
1 Comment
 
LVL 14

Accepted Solution

by:
KoenVosters earned 500 total points
Comment Utility
Best way would be to create a custom timer job that goes through your lists every day/week during the night, as going through the lists will slow down your environment. The last part of code I had to write from memory so double check it in your compiler :)

http://www.andrewconnell.com/blog/articles/CreatingCustomSharePointTimerJobs.aspx

This code will give you the count information

//Use SPSite constructor with URL for main site to return a site collection
SPSite siteCollection = new SPSite(siteUrl);

//Return the target web site based on site name
SPWeb site = siteCollection.AllWebs[siteName];

//Return a collection of list items based on the Items property
//for the specific named list

foreach (SPList list in site.Lists)
{
int itemCount = list.Items.Count; //save this to your SQL database with the listname
}
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now