<?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>Bahramov's Personal Blog &#187; WMI</title>
	<atom:link href="http://www.bahramov.com/tag/wmi/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bahramov.com</link>
	<description>Computers, databases, networks and virtualization</description>
	<lastBuildDate>Fri, 24 Jun 2011 12:05:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Script for remote reboot/shutdown, power off and more.</title>
		<link>http://www.bahramov.com/2009/06/30/script-for-remote-rebootshutdown-power-off-and-more/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://www.bahramov.com/2009/06/30/script-for-remote-rebootshutdown-power-off-and-more/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 11:13:26 +0000</pubDate>
		<dc:creator>Zaur Bahramov</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[VB]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://www.bahramov.com/?p=326</guid>
		<description><![CDATA[Script for remote reboot/shutdown, power off, etc.Â You must have proper rights on a remote computerÂ  for this script to work.

&#039; Script for remote reboot/shutdown, power off, etc.
&#039; You must have proper rights on a remote computer
&#039; for this script to work

Dim StationName
Dim OpSysSet
Dim Flags
Dim Reserved
StationName = InputBox(&#34;Insert the Name of the Station to be Shutdown.&#34;)
Set [...]]]></description>
			<content:encoded><![CDATA[<p>Script for remote reboot/shutdown, power off, etc.Â You must have proper rights on a remote computerÂ  for this script to work.</p>
<p><span id="more-326"></span>
<pre class="brush: vb.net">&#039; Script for remote reboot/shutdown, power off, etc.
&#039; You must have proper rights on a remote computer
&#039; for this script to work

Dim StationName
Dim OpSysSet
Dim Flags
Dim Reserved
StationName = InputBox(&quot;Insert the Name of the Station to be Shutdown.&quot;)
Set OpSysSet = GetObject(&quot;winmgmts:{impersonationLevel=impersonate,(RemoteShutdown)}//&quot; &amp; StationName).ExecQuery(&quot;select * from Win32_OperatingSystem where Primary=true&quot;)
&#039; Flags Action
&#039;Â  0Â Â Â  Logoff
&#039;Â  1Â Â Â  Shutdown
&#039;Â  2Â Â Â  Reboot
&#039;Â  4Â Â Â  Force
&#039;Â  8Â Â Â  Power Off
&#039; 16Â Â Â  Force If Hung
Flags = 8
Reserved = 0
For Each OpSys In OpSysSet
Â Â  OpSys.Win32Shutdown Flags,Reserved
Next</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bahramov.com/2009/06/30/script-for-remote-rebootshutdown-power-off-and-more/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script to manage Event Log files</title>
		<link>http://www.bahramov.com/2009/06/30/script-to-manage-event-log-files/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://www.bahramov.com/2009/06/30/script-to-manage-event-log-files/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 10:28:33 +0000</pubDate>
		<dc:creator>Zaur Bahramov</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[VB]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://www.bahramov.com/?p=314</guid>
		<description><![CDATA[This script will check the size of the Event Log files and if any of these files will have the size greater than defined value it will back it up and then clean it.


strComputer = &#34;.&#34;
Set objWMIService = GetObject(&#34;winmgmts:&#34; _
Â Â Â  &#38; &#34;{impersonationLevel=impersonate, (Backup, Security)}!\\&#34; _
Â Â Â Â Â Â Â  &#38; strComputer &#38; &#34;\root\cimv2&#34;)
Set colLogFiles = objWMIService.ExecQuery _
Â Â Â  (&#34;Select * [...]]]></description>
			<content:encoded><![CDATA[<p>This script will check the size of the Event Log files and if any of these files will have the size greater than defined value it will back it up and then clean it.</p>
<p><span id="more-314"></span></p>
<p><span></span>
<pre class="brush: vb.net">strComputer = &quot;.&quot;
Set objWMIService = GetObject(&quot;winmgmts:&quot; _
Â Â Â  &amp; &quot;{impersonationLevel=impersonate, (Backup, Security)}!\\&quot; _
Â Â Â Â Â Â Â  &amp; strComputer &amp; &quot;\root\cimv2&quot;)
Set colLogFiles = objWMIService.ExecQuery _
Â Â Â  (&quot;Select * from Win32_NTEventLogFile&quot;)
For Each objLogfile in colLogFiles
Â Â Â  If objLogFile.FileSize &gt; 100000 Then
Â Â Â Â Â Â  strBackupLog = objLogFile.BackupEventLog _
Â Â Â Â Â Â Â Â Â Â  (&quot;c:\scripts\&quot; &amp; objLogFile.LogFileName &amp; &quot;.evt&quot;)
Â Â Â Â Â Â  objLogFile.ClearEventLog()
Â Â Â  End If
Next</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bahramov.com/2009/06/30/script-to-manage-event-log-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some links for Windows scriptingâ€¦ (Microsoft)</title>
		<link>http://www.bahramov.com/2009/03/20/some-links-for-windows-scripting-microsoft/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://www.bahramov.com/2009/03/20/some-links-for-windows-scripting-microsoft/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 14:31:33 +0000</pubDate>
		<dc:creator>Zaur Bahramov</dc:creator>
				<category><![CDATA[Microsoft Guides]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://www.bahramov.com/?p=107</guid>
		<description><![CDATA[Scripting tools and utilities

Scriptomatic 2.0
Do-It-Yourself Script Center Kit
WMI Code Creator
ADSI Scriptomatic
Tweakomatic
Log Parser 2.2
Portable Script Center
HTA Helpomatic
Scriptomatic 1.0


Script center
Learn to Script
The Script Center Script Repository
The Windows PowerShell Toolbox

Documentation
â€¢ Sesame Script
Every Sesame Script article through June 2007 in one downloadable Help file.
â€¢ Hey, Scripting Guy!
Almost 500 Hey, Scripting Guy! articles, fully searchable.
â€¢ Windows PowerShell Help File
Fully-searchable help [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.microsoft.com/technet/scriptcenter/createit.mspx" target="_blank">Scripting tools and utilities</a></p>
<ul>
<li><a href="http://www.microsoft.com/technet/scriptcenter/tools/scripto2.mspx">Scriptomatic 2.0</a></li>
<li><a href="http://www.microsoft.com/technet/scriptcenter/tools/diy.mspx">Do-It-Yourself Script Center Kit</a></li>
<li><a href="http://www.microsoft.com/downloads/info.aspx?na=22&amp;p=6&amp;SrcDisplayLang=en&amp;SrcCategoryId=&amp;SrcFamilyId=&amp;u=%2fdownloads%2fdetails.aspx%3fFamilyID%3d2cc30a64-ea15-4661-8da4-55bbc145c30e%26DisplayLang%3den">WMI Code Creator</a></li>
<li><a href="http://www.microsoft.com/technet/scriptcenter/tools/admatic.mspx">ADSI Scriptomatic</a></li>
<li><a href="http://www.microsoft.com/technet/scriptcenter/tools/twkmatic.mspx">Tweakomatic</a></li>
<li><a href="http://www.microsoft.com/technet/scriptcenter/tools/logparser/default.mspx">Log Parser 2.2</a></li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=b4cb2678-dafb-4e30-b2da-b8814fe2da5a&amp;DisplayLang=en">Portable Script Center</a></li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=231D8143-F21B-4707-B583-AE7B9152E6D9&amp;displaylang=en">HTA Helpomatic</a></li>
<li><a href="http://www.microsoft.com/technet/scriptcenter/tools/wmimatic.mspx">Scriptomatic 1.0</a></li>
</ul>
<p><span id="more-107"></span></p>
<ul><a href="http://www.microsoft.com/technet/scriptcenter/default.mspx" target="_blank">Script center</a><br />
<a href="Learn to Script#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" target="_blank">Learn to Script</a><br />
<a href="http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true" target="_blank">The Script Center Script Repository</a><br />
<a href="http://www.microsoft.com/technet/scriptcenter/topics/winpsh/toolbox.mspx" target="_blank">The Windows PowerShell Toolbox</a></p>
<h6></h6>
<h6>Documentation</h6>
<p>â€¢ <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=FF973FBE-9382-4E4C-80DE-E7DE14FD83E6&amp;displaylang=en">Sesame Script</a><br />
Every <a href="http://www.microsoft.com/technet/scriptcenter/resources/begin/archive.mspx">Sesame Script</a> article through June 2007 in one downloadable Help file.</p>
<p>â€¢ <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=5f5e0bda-923a-4744-8289-afb73f6a5ed8&amp;displaylang=en">Hey, Scripting Guy!</a><br />
Almost 500 <a href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/hsgarch.mspx">Hey, Scripting Guy!</a> articles, fully searchable.</p>
<p>â€¢ <a href="http://www.microsoft.com/technet/scriptcenter/topics/winpsh/pschm.mspx">Windows PowerShell Help File</a><br />
Fully-searchable help for Windows PowerShell.</p>
<p>â€¢ <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=9C80B0DF-B9B4-4FCB-B513-02F8F40049E8&amp;displaylang=en">VBScript Quick Reference</a><br />
Short and to-the-point cheat sheet for working with VBScript.</p>
<p>â€¢ <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=DF8ED469-9007-401C-85E7-46649A32D0E0&amp;displaylang=en">Windows PowerShell Quick Reference</a><br />
The basics of Windows PowerShell at your fingertips.</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.bahramov.com/2009/03/20/some-links-for-windows-scripting-microsoft/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

