Solved

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

Posted on 2012-03-15
1
252 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

If you create your solutions on SharePoint sooner or later you will come upon a request to set  permissions of the item depending on some of the item's meta-data - the author, people assigned as approvers, divisions, categories etc. The most natu…
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

630 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