Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2012-03-15
1
Medium Priority
?
260 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 1500 total points
ID: 37728166
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

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
When using a search centre, I'm going to show you how to configure Sharepoint's search to only return results from the current site collection. Very useful when using Office 365 with multiple site collections.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

916 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