<?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>Cosu &#187; Powershell</title>
	<atom:link href="http://cosu.ro/blog/tag/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://cosu.ro/blog</link>
	<description>"I'm even greater than I thought I was", Bender Bending Rodríguez , Futurama, S05E01</description>
	<lastBuildDate>Wed, 12 Oct 2011 13:35:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Free PowerShell book</title>
		<link>http://cosu.ro/blog/2009/07/25/free-powershell-book/</link>
		<comments>http://cosu.ro/blog/2009/07/25/free-powershell-book/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 19:59:50 +0000</pubDate>
		<dc:creator>Cosu</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://cosu.ro/blog/?p=918</guid>
		<description><![CDATA[If you&#8217;re just learning PowerShell or you&#8217;re already a top scriptwizard &#8220;Mastering Powershell&#8221; might prove to be a useful resource. Besides the usual scripting basics like variables, functions, pipes and so on the later chapters show some usage of the scripting language for some more concrete problems like XML manipulation or user account management. Just [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re just learning PowerShell or you&#8217;re already a top scriptwizard &#8220;<a href="http://powershell.com/cs/blogs/ebook/">Mastering Powershell</a>&#8221; might prove to be a useful resource. </p>
<p>Besides the usual scripting basics like variables, functions, pipes and so on the later chapters show some usage of the scripting language for some more concrete problems like XML manipulation or user account management. Just give it a try, it&#8217;s free!</p>
]]></content:encoded>
			<wfw:commentRss>http://cosu.ro/blog/2009/07/25/free-powershell-book/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Prezentare Windows Powershell</title>
		<link>http://cosu.ro/blog/2009/05/17/prezentare-windows-powershell/</link>
		<comments>http://cosu.ro/blog/2009/05/17/prezentare-windows-powershell/#comments</comments>
		<pubDate>Sun, 17 May 2009 09:09:34 +0000</pubDate>
		<dc:creator>Cosu</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Politehnica]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://cosu.ro/blog/?p=888</guid>
		<description><![CDATA[Avand in vedere &#8220;succesul&#8221; prezentarii de Powershell de saptamana trecuta am decis sa public prezentarea si codul demo. Have fun! Windows Powershell Windows Powershell Demo Code Windows Power Shell Publish at Scribd or explore others: Study Guides, Notes, School Work powershell]]></description>
			<content:encoded><![CDATA[<p>Avand in vedere &#8220;succesul&#8221; prezentarii de Powershell de saptamana trecuta am decis sa public prezentarea si codul demo. Have fun!</p>
<p><a href="http://cosu.ro/docs/WindowsPowershell.pdf">Windows Powershell</a><br />
<a href="http://cosu.ro/docs/PowershellDemo.zip">Windows Powershell Demo Code</a></p>
<p><a title="View Windows Power Shell on Scribd" href="http://www.scribd.com/doc/15564995/Windows-Power-Shell" style="margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;">Windows Power Shell</a> <object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="doc_255877501358855" name="doc_255877501358855" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" align="middle"	height="500" width="100%" ><param name="movie"	value="http://d.scribd.com/ScribdViewer.swf?document_id=15564995&#038;access_key=key-3dxxg99pvb3fuunrdwe&#038;page=1&#038;version=1&#038;viewMode="></param><param name="quality" value="high"></param><param name="play" value="true"></param><param name="loop" value="true"></param><param name="scale" value="showall"></param><param name="wmode" value="opaque"></param><param name="devicefont" value="false"></param><param name="bgcolor" value="#ffffff"></param><param name="menu" value="true"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><param name="salign" value=""><embed src="http://d.scribd.com/ScribdViewer.swf?document_id=15564995&#038;access_key=key-3dxxg99pvb3fuunrdwe&#038;page=1&#038;version=1&#038;viewMode=" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" scale="showall" wmode="opaque" devicefont="false" bgcolor="#ffffff" name="doc_255877501358855_object" menu="true" allowfullscreen="true" allowscriptaccess="always" salign="" type="application/x-shockwave-flash" align="middle"  height="500" width="100%"></embed></param></object>
<div style="margin: 6px auto 3px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block;">    <a href="http://www.scribd.com/upload" style="text-decoration: underline;">Publish at Scribd</a> or <a href="http://www.scribd.com/browse" style="text-decoration: underline;">explore</a> others:            <a href="http://www.scribd.com/explore/School-Work/Study-Guides-Notes-Quizzes" style="text-decoration: underline;">Study Guides, Notes,</a>              <a href="http://www.scribd.com/explore/School-Work/" style="text-decoration: underline;">School Work</a>                  <a href="http://www.scribd.com/tag/powershell" style="text-decoration: underline;">powershell</a>      	</div>
]]></content:encoded>
			<wfw:commentRss>http://cosu.ro/blog/2009/05/17/prezentare-windows-powershell/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Microsoft Academic Tour and Innovation Briefing</title>
		<link>http://cosu.ro/blog/2009/04/29/microsoft-academic-tour-and-innovation-briefing/</link>
		<comments>http://cosu.ro/blog/2009/04/29/microsoft-academic-tour-and-innovation-briefing/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 20:46:29 +0000</pubDate>
		<dc:creator>Cosu</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Politehnica]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://cosu.ro/blog/?p=878</guid>
		<description><![CDATA[Joi 7 Mai ora 14.00 in sala EC105 din Facultatea de Automatica si Calculatoare are loc Microsoft Academic Tour. Hot Topics: Windows 7 RC1 si Internet Explorer 8. Joi 14 Mai ora 14.00 in sala EC105 din Facultatea de Automatica si Calculatoare are loc Microsoft Innovation Briefing. Hot Topics: Windows Azure si Windows Powershell. Prezentarea [...]]]></description>
			<content:encoded><![CDATA[<p>Joi 7 Mai ora 14.00 in sala EC105 din Facultatea de Automatica si Calculatoare are loc Microsoft Academic Tour. Hot Topics: Windows 7 RC1 si Internet Explorer 8.<br />
Joi 14 Mai ora 14.00 in sala EC105 din Facultatea de Automatica si Calculatoare are loc Microsoft Innovation Briefing. Hot Topics: Windows Azure si Windows Powershell.</p>
<p>Prezentarea de Powershell e tinuta de subsemnatul. Daca te simti cu bashul pe caciula vino sa vezi ca se poate si altfel!</p>
<p>Pentru inregistrare :<br />
<a href="http://studentclub.ro/evenimente/DetaliiEveniment.aspx?ID=655">http://studentclub.ro/evenimente/DetaliiEveniment.aspx?ID=655<br />
</a>si<br />
<a href="http://studentclub.ro/evenimente/DetaliiEveniment.aspx?ID=656">http://studentclub.ro/evenimente/DetaliiEveniment.aspx?ID=656<br />
</a></p>
<p>PS: mai mult ca sigur ca pe 7 mai o sa vedem windows 7 RC1 in limba romana! Tocmai m-am inrolat in programul de beta testing!</p>
]]></content:encoded>
			<wfw:commentRss>http://cosu.ro/blog/2009/04/29/microsoft-academic-tour-and-innovation-briefing/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PowerShell Server</title>
		<link>http://cosu.ro/blog/2009/01/27/powershell-server/</link>
		<comments>http://cosu.ro/blog/2009/01/27/powershell-server/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 23:36:33 +0000</pubDate>
		<dc:creator>Cosu</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://cosu.ro/blog/2009/01/27/powershell-server/</guid>
		<description><![CDATA[Meseriasii de la /n (aia care dadeau stickere moca) au un produs tare fain. Ii zice powershell server si jucaria iti transforma masina windows din o statie unde poti face chestii doar via GUI in una bucata statie accesibila remote via ssh. SSH vine de la Secure shell. Ei bine daca secure e clar ce [...]]]></description>
			<content:encoded><![CDATA[<p>Meseriasii de la /n (aia care dadeau stickere moca) au un produs tare fain. Ii zice powershell server si jucaria iti transforma masina windows din o statie unde poti face chestii doar via GUI in una bucata statie accesibila remote via ssh. SSH vine de la Secure shell. Ei bine daca secure e clar ce ne da, shell aici e inlocuit cu PowerShell. In felul asta se poate controla o masina windows doar cu putty! (yes Powershel rocks! )</p>
<p>Desigur exista un mic downside &#8230; pretul</p>
<p><a title="http://www.nsoftware.com/powershell/server/" href="http://www.nsoftware.com/powershell/server/">http://www.nsoftware.com/powershell/server/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cosu.ro/blog/2009/01/27/powershell-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Powershell 2 CTP3</title>
		<link>http://cosu.ro/blog/2008/12/25/powershell-2-ctp3/</link>
		<comments>http://cosu.ro/blog/2008/12/25/powershell-2-ctp3/#comments</comments>
		<pubDate>Thu, 25 Dec 2008 17:52:16 +0000</pubDate>
		<dc:creator>Cosu</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://cosu.ro/blog/2008/12/25/powershell-2-ctp3/</guid>
		<description><![CDATA[Ocupati cu cumparaturile de sezon si cu facutul de sarmale si carnati putini au observat ca echipa de produs de la Powershell s-a tinut de cuvant si a lansat la apa o versiune noua de powershell 2 : CTP3 (ctp=community technology preview). Facilitatile noi&#160; sunt destul de consistente: imbunatariri majore in ceea ce priveste remotingul, [...]]]></description>
			<content:encoded><![CDATA[<p>Ocupati cu cumparaturile de sezon si cu facutul de sarmale si carnati putini au observat ca echipa de produs de la Powershell s-a tinut de cuvant si a lansat la apa o versiune noua de powershell 2 : CTP3 (ctp=community technology preview). </p>
<p>Facilitatile noi&nbsp; sunt destul de consistente: </p>
<ul>
<li>imbunatariri majore in ceea ce priveste remotingul, peste 60 de cmdlets noi legate de : adaugarea,stergerea,mutarea unui computer, manevrarea logurilor,etc, </li>
<li>avem un editor grafic putin imbunatatit si redenumit (in CTP2 ii spuneam Graphical Powershell acum il refeream ca ISE &#8211; integrated script editor) si acum cu suport pentru debuging (da se poate face debugining si fara echo!)</li>
<li>API-ul de chemare a powershellului in o bucata de cod c# a fost putin schimbat si s-ar putea ca unii dezvoltatori sa strambe din nas</li>
</ul>
<p>Imbunatatirile si adaugirile sunt mult mai multe si o sa ma luminez si eu pe masura ce se updateaza pagina de pe scriptcenter. Pana atunci <a href="http://go.microsoft.com/fwlink/?LinkID=131969" target="_blank">download</a> and enjoy! </p>
<p>PS: daca vreti functionalitatile de remote (care de fapt reprezinta cireasa CTP-ului asta e nevoie de o componenta suplimentara: <a href="http://go.microsoft.com/fwlink/?LinkID=131971" target="_blank">WinRM 2.0 CTP3</a>)</p>
<p>Ca tot veni vorba de powershell am dat recent peste un laborator online unde se poate experimenta cu powershell fara sa fie nevoie sa fie instalat pe pc-ul personal: <a href="https://www.microsoft.com/resources/virtuallabs/step3-technet.aspx?LabId=4d63f51f-b398-4eef-9353-ca1c40a4375d&amp;BToken=reg" target="_blank">aici</a></p>
<p>La multi ani si un an nou mai prosper si cu cat mai multe bucurii! Santate included!</p>
]]></content:encoded>
			<wfw:commentRss>http://cosu.ro/blog/2008/12/25/powershell-2-ctp3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quickie: Get free disk space with Powershell and wmi</title>
		<link>http://cosu.ro/blog/2008/11/26/quickieget-free-disk-space-with-powershell-and-wmi/</link>
		<comments>http://cosu.ro/blog/2008/11/26/quickieget-free-disk-space-with-powershell-and-wmi/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 11:19:17 +0000</pubDate>
		<dc:creator>Cosu</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://cosu.ro/blog/?p=779</guid>
		<description><![CDATA[Quick and dirty gc work.txt &#124;foreach{ $val=(gwmi -computername $_ -Query "SELECT FreeSpace FROM Win32_LogicalDisk WHERE DeviceID = 'C:'").FreeSpace / 1Gb; echo "$_ $val" }]]></description>
			<content:encoded><![CDATA[<p>Quick and dirty</p>
<pre name="code" class="csharp">
gc work.txt |foreach{
$val=(gwmi -computername $_ -Query "SELECT FreeSpace FROM Win32_LogicalDisk WHERE DeviceID = 'C:'").FreeSpace / 1Gb;
echo "$_ $val"
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://cosu.ro/blog/2008/11/26/quickieget-free-disk-space-with-powershell-and-wmi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quckie: Group Policy Refresh on Demand</title>
		<link>http://cosu.ro/blog/2008/11/17/quckie-group-policy-refresh-on-demand/</link>
		<comments>http://cosu.ro/blog/2008/11/17/quckie-group-policy-refresh-on-demand/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 10:45:30 +0000</pubDate>
		<dc:creator>Cosu</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://cosu.ro/blog/2008/11/17/quckie-group-policy-refresh-on-demand/</guid>
		<description><![CDATA[Tooluri necesare: 1) Powershell 2) Scula asta. Exista si un cmdlet care face direct chestia asta dar nu merge in powershell 2.0. Pana cand apare ne descurcam cu exeul. 3) Numele workstationurilor in format csv $comp = Import-Csv .\workstations.csv &#124;select computername&#124;select computername foreach ($i in $comp) {.\Rgprefresh.exe /m:$comp}]]></description>
			<content:encoded><![CDATA[<p>Tooluri necesare: </p>
<p>1) Powershell </p>
<p>2) Scula <a href="http://www.gpoguy.com/FreeTools/FreeToolsLibrary/tabid/67/agentType/View/PropertyID/83/Default.aspx" target="_blank">asta</a>. Exista si un cmdlet care face direct chestia asta dar nu merge in powershell 2.0. Pana cand apare ne descurcam cu exeul. </p>
<p>3) Numele workstationurilor in format csv </p>
<pre class="csharp" name="code">$comp = Import-Csv .\workstations.csv |select computername|select computername
foreach ($i in $comp) {.\Rgprefresh.exe /m:$comp}</pre>
]]></content:encoded>
			<wfw:commentRss>http://cosu.ro/blog/2008/11/17/quckie-group-policy-refresh-on-demand/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell WakeOnLan v0.2</title>
		<link>http://cosu.ro/blog/2008/11/12/powershell-wakeonlan-v02/</link>
		<comments>http://cosu.ro/blog/2008/11/12/powershell-wakeonlan-v02/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 12:03:34 +0000</pubDate>
		<dc:creator>Cosu</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://cosu.ro/blog/2008/11/12/powershell-wakeonlan-v02/</guid>
		<description><![CDATA[Scriptul de ieri l-am extins si i-am adaugat functii de remote shutdown si restart. Ca bonus am adaugat si epic fail si putina validare. #wakeonlan $computer function WakeOnLan($computer) { $select=$select &#124;where-object {$_.computername -eq $computer} &#124;Select-Object mac if ($select.mac -eq $null) { echo &#34;workstation not found.epic fail. use all to wake'em all&#34; } else { $select.mac [...]]]></description>
			<content:encoded><![CDATA[<p>Scriptul de <a href="http://cosu.ro/blog/2008/11/11/powershell-wake-on-lan-v01/" target="_blank">ieri</a> l-am extins si i-am adaugat functii de remote shutdown si restart. Ca bonus am adaugat si epic fail si putina validare.</p>
<pre name="code" class="c#">#wakeonlan $computer
function WakeOnLan($computer)
{
	$select=$select |where-object {$_.computername -eq $computer} |Select-Object mac
	if ($select.mac -eq $null)
	{
		echo &quot;workstation not found.epic fail. use all to wake'em all&quot;
	}
	else
	{
		$select.mac  -match &quot;(..)(..)(..)(..)(..)(..)&quot; | out-null
		$mac= [byte[]]($matches[1..6] |% {[int]&quot;0x$_&quot;})
		$UDPclient = new-Object System.Net.Sockets.UdpClient
		$UDPclient.Connect(([System.Net.IPAddress]::Broadcast),4000)
		$packet = [byte[]](,0xFF * 102)
		6..101 |% { $packet[$_] = $mac[($_%6)]}
		$UDPclient.Send($packet, $packet.Length)
		echo &quot;workstation $computer is booting up...&quot;
	}
}

#wakeonlan all the computers
function WakeOnLanAll
{
	$computers=$select | Select-Object computername
	foreach ($computer in $computers)
	{
		$target = $computer.computername
		WakeOnLan($target)
		#delay to be powergrid friendly
		Start-Sleep -seconds 5
	}
}
#shutdown $computer
function ShutDown($computer)
{
if ($computer.ToLower() -eq &quot;all&quot;)
	{
	$select=$select|Select-Object computername
	foreach ($computername in $select)
		{
			$target=$computername.computername
			get-wmiobject win32_operatingsystem -computer $target | foreach {$_.shutdown()}
		}
	}
else {
		$select=$select |where-object {$_.computername -eq $computer} |Select-Object computername
		if ($select.computername -eq $null)
		{
			echo &quot;workstation $computer not found.epic fail. use all to kill'em all&quot;
		}
		else
		{
			get-wmiobject win32_operatingsystem -computer $computer | foreach {$_.Shutdown()}
		}
	}
}
####reboot $computer
function Reboot($computer)
{
#reboot all
if ($computer.ToLower() -eq &quot;all&quot;)
	{
	$select=$select|Select-Object computername
	foreach ($computername in $select)
		{
			$target=$computername.computername
			get-wmiobject win32_operatingsystem -computer $target | foreach {$_.reboot()}
		}
	}
else {
	$select=$select |where-object {$_.computername -eq $computer} |Select-Object computername
	#check input
	if ($select.computername -eq $null)
	{
		echo &quot;workstation $computer not found.epic fail. use all to kill'em all&quot;
	}
	#reboot
	else
		{
			get-wmiobject win32_operatingsystem -computer $computer | foreach {$_.reboot()}
			#delay to be powergrid friendly
			Start-Sleep -seconds 5
		}
	}
}

###################
$option=read-host &quot;Enter option&quot;
$select=Import-Csv workstations.csv
switch ($option)
{
	&quot;wol&quot; {
			$computer=read-host &quot;Enter Workstation to wake...&quot;
			if ($computer -eq &quot;all&quot;)
			{
				WakeOnLanAll
			}
	else {
			WakeOnLan($computer)
			ping -4 -n 25 $computer
		}
	}
	&quot;reboot&quot; {
			$computer=read-host &quot;Enter Workstation to reboot...&quot;
			Reboot($computer)
	}
	&quot;shutdown&quot; {
			$computer=read-host &quot;Enter Workstation to kill...&quot;
			Shutdown($computer)
	}
	default {echo &quot;error!options are : wol, reboot, shutdown&quot;}
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://cosu.ro/blog/2008/11/12/powershell-wakeonlan-v02/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PowerShell Wake on Lan v0.1</title>
		<link>http://cosu.ro/blog/2008/11/11/powershell-wake-on-lan-v01/</link>
		<comments>http://cosu.ro/blog/2008/11/11/powershell-wake-on-lan-v01/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 12:33:08 +0000</pubDate>
		<dc:creator>Cosu</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://cosu.ro/blog/?p=739</guid>
		<description><![CDATA[Wake on lan e o functie disponibila pe orice placa de baza mai noua de 1900 toamna ce te lasa sa pornesti de la distanta un calculator. Principiul de functionare e cam asa: trimiti pe retea un pachet &#8220;special&#8221; ce contine MAC-ul statiei ce ce vrei sa o pornesti. Daca e configurata corect si e [...]]]></description>
			<content:encoded><![CDATA[<p>Wake on lan e o functie disponibila pe orice placa de baza mai noua de 1900 toamna ce te lasa sa pornesti de la distanta un calculator. Principiul de functionare e cam asa: trimiti pe retea un pachet &#8220;special&#8221; ce contine MAC-ul statiei ce ce vrei sa o pornesti. Daca e configurata corect si e sub tensiune statia porneste si putem sa o administram de la distanta.<br />
Fabricarea magic packetului e luata de la <a href="http://thepowershellguy.com/blogs/posh/default.aspx">powershellguy</a></p>
<p>Pentru a rula scriptul e nevoie de un fisier csv ce contine doua informatii : nume statie si mac<br />
exemplu</p>
<pre>computername,mac
workstation01,001e37FF3e1b
workstation02,001e37FF3e8c</pre>
<p>Scriptul cere de la user numele statiei si o porneste. Enjoy!</p>
<pre name="code"  class="c#">$computer=read-host "Enter Workstation to wake..."

$select=Import-Csv workstations.csv |where-object {$_.computername -eq $computer} |Select-Object mac
if ($select.mac -eq $null)
{
	echo "workstation not found.fail"
}
else
{

$select.mac  -match "(..)(..)(..)(..)(..)(..)" | out-null
$mac= [byte[]]($matches[1..6] |% {[int]"0x$_"})  

$UDPclient = new-Object System.Net.Sockets.UdpClient
$UDPclient.Connect(([System.Net.IPAddress]::Broadcast),4000)
$packet = [byte[]](,0xFF * 102)
6..101 |% { $packet[$_] = $mac[($_%6)]}
$UDPclient.Send($packet, $packet.Length)
echo "workstation $computer is booting up..."
ping -n 25 $computer
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://cosu.ro/blog/2008/11/11/powershell-wake-on-lan-v01/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

