<?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; shares</title>
	<atom:link href="http://vbscriptblog.com/category/vbscript/wmi/shares/feed/" rel="self" type="application/rss+xml" />
	<link>http://vbscriptblog.com</link>
	<description>Scripting for Windows Sysadmins</description>
	<lastBuildDate>Mon, 16 Jan 2012 09:41:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>WMI: VBscript to show the network shares of a computer</title>
		<link>http://vbscriptblog.com/vbscript/wmi/shares/wmi-vbscript-to-show-the-network-shares-of-a-computer/</link>
		<comments>http://vbscriptblog.com/vbscript/wmi/shares/wmi-vbscript-to-show-the-network-shares-of-a-computer/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 14:45:47 +0000</pubDate>
		<dc:creator>dirk adamsky</dc:creator>
				<category><![CDATA[shares]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[cscript]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[network shares]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[share]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[vbs]]></category>
		<category><![CDATA[vbscript]]></category>
		<category><![CDATA[wmi]]></category>

		<guid isPermaLink="false">http://deludi.nl/blog/?p=280</guid>
		<description><![CDATA[Okido, here&#8217;s another starter script. This script shows all network shares on your computer. Default computer is the local machine. When the dot is replaced by another machine name the script works against that machine. With some additions the script can be used for a simple inventory of the pc&#8217;s in your network. There are [...]]]></description>
			<content:encoded><![CDATA[<p>Okido, here&#8217;s another starter script.<br />
This script shows all network shares on your computer.<br />
Default computer is the local machine.<br />
When the dot is replaced by another machine name the script works  against that machine.<br />
With some additions the script can be used for a simple inventory of the  pc&#8217;s in your network.</p>
<p>There are some conditions that must be met:</p>
<ol>
<li> the script must be run with administrative credentials</li>
<li>the firewall of the remote machine needs the following ports opened  for WMI: TCP 135, TCP 4168 and<br />
UDP 9256</li>
</ol>
<p>Follow the next steps to make and run the script (admin rights  needed):</p>
<ul>
<li>open your favorite text editor (mine is notepad++)</li>
<li>copy and paste the script into the editor (delete the line numbers)</li>
<li>save the script (for example c:tempenumerateshares.vbs)</li>
<li>open a command prompt</li>
<li>go to &#8220;c:temp&#8221;</li>
<li>give &#8220;cscript enumerateshares.vbs&#8221; (without quotes) and enter</li>
</ul>
<p>The script:</p>
<pre class="brush: vb; title: ; notranslate">
' Name : enumerateshares.vbs
' Description : script to show the model of a computer
' Author : dirk adamsky - deludi bv
' Version : 1.00
' Date : 09-02-2010
' Level : beginner

strComputer = &quot;.&quot;
Set objWMIService = GetObject(&quot;winmgmts:{impersonationLevel=impersonate}!\&quot; &amp; strComputer &amp; &quot;rootcimv2&quot;)
Set colShares = objWMIService.ExecQuery(&quot;Select * from Win32_Share&quot;)
Wscript.Echo &quot;name ; path ; caption&quot;
For each objShare in colShares
    Wscript.Echo objShare.Name &amp; &quot; ; &quot; &amp; objShare.Path &amp; &quot; ; &quot; &amp; objShare.Caption
Next
Set colShares = Nothing
Set objWMIService = Nothing
</pre>
<p>As said earlier: when you have questions/problems please give a  reply.</p>
<p>Best regards,</p>
<p>Dirk Adamsky &#8211; Deludi BV</p>
<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%2Fwmi%2Fshares%2Fwmi-vbscript-to-show-the-network-shares-of-a-computer%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" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></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/wmi/shares/wmi-vbscript-to-show-the-network-shares-of-a-computer/"></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/wmi/shares/wmi-vbscript-to-show-the-network-shares-of-a-computer/"  data-text="WMI: VBscript to show the network shares of a computer" data-count="horizontal" data-via="dirkadamsky">Tweet</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/wmi/shares/wmi-vbscript-to-show-the-network-shares-of-a-computer/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://vbscriptblog.com/vbscript/wmi/shares/wmi-vbscript-to-show-the-network-shares-of-a-computer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

