<?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>DiamondSteel-Blog &#187; PowerShell</title>
	<atom:link href="http://blog.diamondsteel.ru/category/powershell/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.diamondsteel.ru</link>
	<description>Очередной блог на WordPress  </description>
	<lastBuildDate>Sun, 29 Jan 2012 14:55:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PowerShell :: Отключение Autorun.inf. Скажем вирусам нет!</title>
		<link>http://blog.diamondsteel.ru/powershell-otklyuchenie-autorun-inf-skazhem-virusam-net.html</link>
		<comments>http://blog.diamondsteel.ru/powershell-otklyuchenie-autorun-inf-skazhem-virusam-net.html#comments</comments>
		<pubDate>Tue, 01 Dec 2009 18:02:17 +0000</pubDate>
		<dc:creator>DiamondSteel</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[MicroSoft]]></category>
		<category><![CDATA[Script]]></category>

		<guid isPermaLink="false">http://blog.diamondsteel.ru/?p=315</guid>
		<description><![CDATA[Пример использования: Отключить Autorun.inf Включить Autorun.inf]]></description>
			<content:encoded><![CDATA[<pre class="brush: plain; title: ; notranslate">
function Disable-AutoRun{
    $item = Get-Item &quot;REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping\AutoRun.inf&quot; -ErrorAction SilentlyContinue
    if(-not $item){
        $item = New-Item &quot;REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping\AutoRun.inf&quot;
    }
    Set-ItemProperty $item.PSPath &quot;(default)&quot; &quot;@SYS:DoesNotExist&quot;
}

function Enable-AutoRun{
    Remove-Item &quot;REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping\AutoRun.inf&quot; -Force
}
</pre>
<p>Пример использования:</p>
<p>Отключить Autorun.inf</p>
<pre class="brush: plain; title: ; notranslate">
Disable-AutoRun
</pre>
<p>Включить Autorun.inf</p>
<pre class="brush: plain; title: ; notranslate">
Enable-AutoRun
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.diamondsteel.ru/powershell-otklyuchenie-autorun-inf-skazhem-virusam-net.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell :: Получить из EventLog записи об ошибках за отпределённую дату</title>
		<link>http://blog.diamondsteel.ru/powershell-poluchit-iz-eventlog-zapisi-ob-oshibkax-za-otpredelyonnuyu-datu.html</link>
		<comments>http://blog.diamondsteel.ru/powershell-poluchit-iz-eventlog-zapisi-ob-oshibkax-za-otpredelyonnuyu-datu.html#comments</comments>
		<pubDate>Tue, 01 Dec 2009 12:26:01 +0000</pubDate>
		<dc:creator>DiamondSteel</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[MicroSoft]]></category>
		<category><![CDATA[Script]]></category>

		<guid isPermaLink="false">http://blog.diamondsteel.ru/?p=312</guid>
		<description><![CDATA[Пример использования:]]></description>
			<content:encoded><![CDATA[<pre class="brush: plain; title: ; notranslate">
function GetErrorOfComputer ($data, $strComuterName){
	if(!$data){
		# Если в функцию не передали дату то находим дату предыдущего дня.
		# Получаем текущую дату.
		$a = Get-Date
		# Получаем вчерашнюю дату.
		$yesterday = $a.addDays(-1).ToShortDateString().ToString()
		$data = $yesterday
	}
	if(!$strComuterName){
		# Если в функцию не передали имя или ip адрес удалённого компьютера то смотрим локально.
		$strComuterName=&quot;127.0.0.1&quot;
	}

	# Указываем какой EventLog будем смотреть.
	$strLog =&quot;system&quot;

	# Находим все записи Error за указанную дату в Системном логе.
	Get-EventLog $strLog -EntryType Error -ComputerName $strComuterName |
		Where-Object { (get-date $_.TimeGenerated -Format d).ToString() -eq $data } |
		Format-List MachineName, EventID, TimeGenerated, EntryType, Source, Message
}
</pre>
<p>Пример использования:</p>
<pre class="brush: plain; title: ; notranslate">
GetErrorOfComputer 30.11.2009 1c8
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.diamondsteel.ru/powershell-poluchit-iz-eventlog-zapisi-ob-oshibkax-za-otpredelyonnuyu-datu.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

