 




<?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>The VBScript Network and Systems Administrator&#039;s Cafe &#187; working with objects</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/tag/working-with-objects/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator</link>
	<description></description>
	<lastBuildDate>Tue, 11 Oct 2011 18:36:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Retrieving the account IIS is using as the anonymous user account with VBScript</title>
		<link>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/retrieving-the-account-iis-is-using-as-the-anonymous-user-account-with-vbscript/</link>
		<comments>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/retrieving-the-account-iis-is-using-as-the-anonymous-user-account-with-vbscript/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 08:00:58 +0000</pubDate>
		<dc:creator>Jerry Lees</dc:creator>
				<category><![CDATA[iis]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Systems Administration]]></category>
		<category><![CDATA[systems management]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[VBScript Functions]]></category>
		<category><![CDATA[web sites]]></category>
		<category><![CDATA[web tools]]></category>
		<category><![CDATA[working with objects]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/retrieving-the-account-iis-is-using-as-the-anonymous-user-account-with-vbscript/</guid>
		<description><![CDATA[I recently posted a script that retrieved the anonymous user password for a server in IIS. This script I posted, Using the IIS ADSI object to retrieve the anonymous user password for a server via VBScript, came in quite handy in a pinch, but not knowing the anonymous user account the password goes with can [...]]]></description>
				<content:encoded><![CDATA[<p>I recently posted a script that retrieved the anonymous user password for a server in IIS. This script I posted, <a href="../using-the-iis-adsi-object-to-retrieve-the-anonymous-user-password-for-a-server-via-vbscript">Using the IIS ADSI object to retrieve the anonymous user password for a server via VBScript</a>, came in quite handy in a pinch, but not knowing the anonymous user account the password goes with can also be a pain.Luckily I had that piece of information in the script as well!</p>
<p>So, I’ve wrapped that part of the script into a function for your use as well. Below is a snippet from the script to display the user account.</p>
<p><span style="color: #0000ff">Function Get_IUSR_Username(ServerName)<br />
Dim IIsObject</span></p>
<p>Set IIsObject = GetObject (&#8220;IIS://&#8221; &amp; ServerName &amp; &#8220;/w3svc&#8221;)<br />
on Error resume Next<br />
Get_IUSR_Username = IIsObject.Get(&#8220;AnonymousUserName&#8221;)<br />
On Error GoTo 0<br />
End Function</p>
<p>Enjoy!</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/retrieving-the-account-iis-is-using-as-the-anonymous-user-account-with-vbscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the IIS ADSI object to retrieve the anonymous user password for a server via VBScript</title>
		<link>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/using-the-iis-adsi-object-to-retrieve-the-anonymous-user-password-for-a-server-via-vbscript/</link>
		<comments>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/using-the-iis-adsi-object-to-retrieve-the-anonymous-user-password-for-a-server-via-vbscript/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 15:53:56 +0000</pubDate>
		<dc:creator>Jerry Lees</dc:creator>
				<category><![CDATA[iis]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Systems Administration]]></category>
		<category><![CDATA[Toolkit]]></category>
		<category><![CDATA[VBScipt]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[VBScript Functions]]></category>
		<category><![CDATA[working with objects]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/using-the-iis-adsi-object-to-retrieve-the-anonymous-user-password-for-a-server-via-vbscript/</guid>
		<description><![CDATA[I recently had to change the anonymous user account for a change request for a site in IIS, but unfortunately the change did not work and we had to roll it back. However, I didn’t have and wouldn’t have known the account’s password since IIS and windows changes it periodically. So, out came the scripting [...]]]></description>
				<content:encoded><![CDATA[<p>I recently had to change the anonymous user account for a change request for a site in IIS, but unfortunately the change did not work and we had to roll it back. However, I didn’t have and wouldn’t have known the account’s password since IIS and windows changes it periodically.</p>
<p>So, out came the scripting tool belt and I found that I had a script written previously that let me get the anonymous user account and password through the IIS ADSI object.</p>
<p>Below is a snippet from the script to display the password.</p>
<p><span style="color: #0000ff">Function Get_IUSR_Password(ServerName)<br />
   Dim IIsObject<br />
   <br />
   Set IIsObject = GetObject (&#8220;IIS://&#8221; &amp; ServerName &amp; &#8220;/w3svc&#8221;)<br />
   on Error resume Next<br />
   Get_IUSR_Password = IIsObject.Get(&#8220;AnonymousUserPass&#8221;)<br />
   On Error GoTo 0<br />
End Function </span></p>
<p>Enjoy!</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/using-the-iis-adsi-object-to-retrieve-the-anonymous-user-password-for-a-server-via-vbscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clean up your toys when your done: Fighting memory leaks in your scripts</title>
		<link>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/clean-up-your-toys-when-your-done-fighting-memory-leaks-in-your-scripts/</link>
		<comments>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/clean-up-your-toys-when-your-done-fighting-memory-leaks-in-your-scripts/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 16:10:46 +0000</pubDate>
		<dc:creator>Jerry Lees</dc:creator>
				<category><![CDATA[memory leaks]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[working with objects]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/clean-up-your-toys-when-your-done-fighting-memory-leaks-in-your-scripts/</guid>
		<description><![CDATA[One on the things you always want to do when you create objects in your scripts, especially objects from third party companies is, is to always remember to destroy the objects when you are done with them. At the very least, before you exit the script. Object creation and not destroy the objects can be [...]]]></description>
				<content:encoded><![CDATA[<p>One on the things you always want to do when you create objects in your scripts, especially objects from third party companies is, is to always remember to destroy the objects when you are done with them. At the very least, before you exit the script.</p>
<p>Object creation and not destroy the objects can be one source of memory leaks. In order to destroy an object should use the object&#8217;s <em><font color="#0000ff">.dispose</font></em> method. If it does not have a dispose method, you set simply it to a special value of <font color="#0000ff"><em>nothing. </em></font><font color="#000000">This will destroy the object and free up it&#8217;s memory. An example of using nothing is shown below:</font></p>
<p><font color="#0000ff">Dim ObjTest<br />
Set ObjTest = GetObject(&#8220;winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2&#8243;)<br />
ObjTest = nothing</font></p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/clean-up-your-toys-when-your-done-fighting-memory-leaks-in-your-scripts/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>VBScript Statements: Explanation of the Set Statement</title>
		<link>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/vbscript-statements-explanation-of-the-set-statement/</link>
		<comments>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/vbscript-statements-explanation-of-the-set-statement/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 22:00:48 +0000</pubDate>
		<dc:creator>Jerry Lees</dc:creator>
				<category><![CDATA[Objects]]></category>
		<category><![CDATA[set]]></category>
		<category><![CDATA[set command]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[VBScript Objects]]></category>
		<category><![CDATA[VBScript Statements]]></category>
		<category><![CDATA[working with objects]]></category>
		<category><![CDATA[working with variables]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/vbscript-statements-explanation-of-the-set-statement/</guid>
		<description><![CDATA[The set statement is used to assign any value to any type of variable. For the most part this command is optional. However, it needs to be used when you are assigning an object reference to a variable, such as when you use a variable to hold the return of a CreateObject function for later reference [...]]]></description>
				<content:encoded><![CDATA[<p>The set statement is used to assign any value to any type of variable. For the most part this command is optional. However, it needs to be used when you are assigning an object reference to a variable, such as when you use a variable to hold the return of a CreateObject function for later reference in your code.</p>
<p>An example of the set command would look like:</p>
<p><font color="#0000ff">Option explicit<br />
Dim objDictionary<br />
Set objDictionary = CreateObject(”Scripting.Dictionary”)</font></p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/vbscript-statements-explanation-of-the-set-statement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VBScript Statements: Explanation of the With &#8230; End With Statement</title>
		<link>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/vbscript-statements-explanation-of-the-with-end-with-statement/</link>
		<comments>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/vbscript-statements-explanation-of-the-with-end-with-statement/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 15:10:38 +0000</pubDate>
		<dc:creator>Jerry Lees</dc:creator>
				<category><![CDATA[end with]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[VBScript Statements]]></category>
		<category><![CDATA[with]]></category>
		<category><![CDATA[with end with]]></category>
		<category><![CDATA[working with objects]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/vbscript-statements-explanation-of-the-with-end-with-statement/</guid>
		<description><![CDATA[The With &#8230; End With statement allows you to execute a section of code on a specific object or class that calls methods or set properties on the object from within VBScript without referencing the object directly in the code written. It is a way of simplifying your code, and very useful in large scripts. [...]]]></description>
				<content:encoded><![CDATA[<p>The <strong>With &#8230; End With</strong> statement allows you to execute a section of code on a specific object or class that calls methods or set properties on the object from within VBScript without referencing the object directly in the code written.</p>
<p>It is a way of simplifying your code, and very useful in large scripts.<br />
For example:</p>
<h6>(please note, these examples are snippets of code and will not work by themselves in an editor)</h6>
<p><span style="color: #0000ff">with objSomething<br />
     .FirstName = &#8220;Jerry&#8221;<br />
     .LastName = &#8220;Lees&#8221;<br />
     .URL = &#8220;</span><a href="http://www.gamersigs.net/"><span style="color: #0000ff">http://www.gamersigs.net</span></a><span style="color: #0000ff">&#8221;<br />
     .XBoxLiveTag = &#8220;CrashSerious&#8221;<br />
     .Email = &#8220;Not-a-chance-spammers&#8221;<br />
End with</span></p>
<p><span style="color: #0000ff"><span style="color: #000000">This would be equivalent to the following standard code:</span></span></p>
<p><span style="color: #0000ff"><span style="color: #0000ff">     objSomething.FirstName = &#8220;Jerry&#8221;<br />
     objSomething.LastName = &#8220;Lees&#8221;<br />
     objSomething.URL = &#8220;</span><a href="http://www.gamersigs.net/"><span style="color: #0000ff">http://www.gamersigs.net</span></a><span style="color: #0000ff">&#8221;<br />
     objSomething.XBoxLiveTag = &#8220;JLees&#8221;<br />
     objSomething.Email = &#8220;Not-a-chance-spammers&#8221;<br />
</span></span></p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/vbscript-statements-explanation-of-the-with-end-with-statement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
