<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBS/WMI: ClearEventLog - проблемка очистки Security]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=6151&amp;type=atom" />
	<updated>2011-08-26T14:24:34Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=6151</id>
		<entry>
			<title type="html"><![CDATA[VBS/WMI: ClearEventLog - проблемка очистки Security]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50887#p50887" />
			<content type="html"><![CDATA[<p>Коллеги, приветствую !<br />Столкнулся с проблемкой...<br />Затираю следы DCOM&#039;овские своего присутствия на удалённых машинках путём хотя бы очищения NTEventLog&#039;а, журнальчики &#039;Application&#039; и &#039;System&#039; чистятся беспроблемно, а вот &#039;Security&#039; выдаёт результатом нигде не описанную 5 (пятёрку) , код следующий<br /></p><div class="codebox"><pre><code>strComputer = &quot;.&quot;
Set objWMIService = GetObject(&quot;winmgmts:&quot; _
 &amp; &quot;{impersonationLevel=impersonate,(Backup)}!\\&quot; &amp; _
 strComputer &amp; &quot;\root\cimv2&quot;)
Set colLogFiles = objWMIService.ExecQuery _
 (&quot;SELECT * FROM Win32_NTEventLogFile WHERE LogFileName=&#039;Security&#039;&quot;)
For Each objLogfile in colLogFiles
 intReturn=objLogFile.ClearEventLog()
Next
Msgbox intReturn</code></pre></div><p>Собственно код <a href="http://technet.microsoft.com/en-us/library/ee176696.aspx">отсюда</a><br /><a href="http://msdn.microsoft.com/en-us/library/aa389229(v=vs.85).aspx">Результатами могут быть только 0,8 или 21</a><br />А у меня 5 <img src="//forum.script-coding.com/img/smilies/hmm.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[Евген]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25253</uri>
			</author>
			<updated>2011-08-26T14:24:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50887#p50887</id>
		</entry>
</feed>
