<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>vbscriptblog.com &#187; files</title>
	<atom:link href="http://vbscriptblog.com/category/vbscript/active-directory/files/feed/" rel="self" type="application/rss+xml" />
	<link>http://vbscriptblog.com</link>
	<description>Scripting for Windows Sysadmins</description>
	<lastBuildDate>Wed, 11 Apr 2012 07:23:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Active Directory: VBscript to count the number of files on homedirectory for groupmembers</title>
		<link>http://vbscriptblog.com/vbscript/active-directory/files/active-directory-vbscript-to-count-the-number-of-files-on-homedirectory-for-groupmembers/</link>
		<comments>http://vbscriptblog.com/vbscript/active-directory/files/active-directory-vbscript-to-count-the-number-of-files-on-homedirectory-for-groupmembers/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 12:33:40 +0000</pubDate>
		<dc:creator>dirk adamsky</dc:creator>
				<category><![CDATA[files]]></category>
		<category><![CDATA[homedirectory]]></category>
		<category><![CDATA[homeshare]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[vbs]]></category>
		<category><![CDATA[vbscript]]></category>

		<guid isPermaLink="false">http://deludi.nl/blog/?p=113</guid>
		<description><![CDATA[This script is for reporting purposes. It enumerates the members of a specified group and calculates the number of files that each user has on his/her homedirectory. It is especially useful when run from the scheduler. Follow the next steps to run the script (no admin rights needed): open your favorite text editor copy and [...]]]></description>
			<content:encoded><![CDATA[<p>This script is for reporting purposes.<br />
It enumerates the members of a specified group and calculates the number of files that each user has on his/her homedirectory. It is especially useful when run from the scheduler.</p>
<p>Follow the next steps to run the script  (no admin rights needed):</p>
<ul>
<li>open your favorite text editor</li>
<li>copy and paste the script into the editor</li>
<li>change the distinguished name of the group to your specific situation</li>
<li>save the script (for example c:tempgroupfilesonhomedirectory.vbs)</li>
<li>open a command prompt</li>
<li>go to &#8220;c:temp&#8221;</li>
<li>give &#8220;cscript groupfilesonhomedirectory.vbs&#8221; (without quotes) and enter</li>
</ul>
<p>The script:</p>
<pre class="brush: vb; title: ; notranslate">
' Name : groupfilesonhomedirectory.vbs
' Description : script to count the number of files on homedirectory for groupmembers
' Author : dirk adamsky - deludi bv
' Version : 1.00
' Date : 26-01-2010

Set objGroup = GetObject(&quot;LDAP://CN=test,OU=test,DC=test,DC=org&quot;)
For Each M in objGroup.Members
	If M.homeDirectory &lt;&gt; &quot;&quot; Then
		FileCnt = 0
		ReturnFileCountUsingFSO M.homeDirectory, FileCnt
		WScript.echo M.cn &amp; &quot; ; &quot; &amp; M.homeDirectory &amp; &quot; ; &quot; &amp; FileCnt &amp; &quot; files on home directory&quot;
	End If
Next
Set objGroup = Nothing

Function ReturnFileCountUsingFSO(strPath, FileCnt)
	On Error Resume Next
	Set FSO = CreateObject(&quot;scripting.filesystemobject&quot;)
	Set fld = FSO.GetFolder(strPath)
	FileCnt = FileCnt + fld.Files.Count
	For Each f In fld.SubFolders
		ReturnFileCountUsingFSO f.path, FileCnt
	Next
	Set f = Nothing
	Set fld = Nothing
	Set FSO = Nothing
End Function
</pre>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvbscriptblog.com%2Fvbscript%2Factive-directory%2Ffiles%2Factive-directory-vbscript-to-count-the-number-of-files-on-homedirectory-for-groupmembers%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:85px; height:21px;"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://vbscriptblog.com/vbscript/active-directory/files/active-directory-vbscript-to-count-the-number-of-files-on-homedirectory-for-groupmembers/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://vbscriptblog.com/vbscript/active-directory/files/active-directory-vbscript-to-count-the-number-of-files-on-homedirectory-for-groupmembers/"  data-text="Active Directory: VBscript to count the number of files on homedirectory for groupmembers" data-count="horizontal" data-via="dirkadamsky"></a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://vbscriptblog.com/vbscript/active-directory/files/active-directory-vbscript-to-count-the-number-of-files-on-homedirectory-for-groupmembers/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://vbscriptblog.com/vbscript/active-directory/files/active-directory-vbscript-to-count-the-number-of-files-on-homedirectory-for-groupmembers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

