Solved

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

Posted on 2012-03-15
1
225 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

I used to be SharePoint evangelist in our company, so my Outlook always full of questions about how to do this, or where I can find that. One day I found such an email with the following question: "how to attach 3-State workflow (one of the workflow…
For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

895 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