<?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>PowerShell.nu &#187; Windows 7</title>
	<atom:link href="http://www.powershell.nu/category/windows-7/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.powershell.nu</link>
	<description></description>
	<lastBuildDate>Wed, 14 Jul 2010 22:17:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Joining a Windows 7 Client to a Domain through PowerShell</title>
		<link>http://www.powershell.nu/2009/06/05/joining-a-windows-7-client-to-a-domain-through-powershell/</link>
		<comments>http://www.powershell.nu/2009/06/05/joining-a-windows-7-client-to-a-domain-through-powershell/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 17:02:49 +0000</pubDate>
		<dc:creator>Niklas Goude</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.powershell.nu/?p=754</guid>
		<description><![CDATA[Time to join a Windows 7 client to a domain. Now that the Test Domain is up and running ( Check Previous Posts ), we can start joining clients to the domain. Since it&#8217;s a freshly installed Windows 7 client, we dont have to bother about userprofiles and so on.. we&#8217;ll save that for later [...]]]></description>
			<content:encoded><![CDATA[<p>Time to join a Windows 7 client to a domain. Now that the Test Domain is up and running ( <a href="http://www.powershell.nu/2009/04/11/part-00-migrate-from-windows-server-2003-to-windows-server-2008-r2-and-windows-7-using-powershell/">Check Previous Posts</a> ), we can start joining clients to the domain.</p>
<p />
Since it&#8217;s a freshly installed Windows 7 client, we dont have to bother about userprofiles and so on.. we&#8217;ll save that for later <img src='http://www.powershell.nu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p />
Joining the domain is done through WMI. Just create a new Object containing the Win32_ComputerSystem WMI object and call the JoinDOmainOrWorkGroup() method.</p>
<p />
<pre>
<strong>
function JoinDomain ([string]$Domain, [string]$User, [string]$Password ) {

	$DomainUser = $Domain + "\" + $User
	$OU = $null

	$ComputerSystem = gwmi Win32_ComputerSystem

	$ComputerSystem.JoinDomainOrWorkGroup(
		$Domain,
		$Password,
		$DomainUser,
		$OU,
		3
	)
}
</strong>
</pre>
<p />
Here&#8217;s an example on running the function.</p>
<p />
<pre>
<strong>
PS > JoinDomain PowerShell.nu migaccount Password1
</strong>
</pre>
<p />
And voila! the client shuts down and on Startup, It&#8217;ll have joined the new domain.</p>
<p />
]]></content:encoded>
			<wfw:commentRss>http://www.powershell.nu/2009/06/05/joining-a-windows-7-client-to-a-domain-through-powershell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Write-StickyNote</title>
		<link>http://www.powershell.nu/2009/06/05/write-stickynote/</link>
		<comments>http://www.powershell.nu/2009/06/05/write-stickynote/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 16:30:03 +0000</pubDate>
		<dc:creator>Niklas Goude</dc:creator>
				<category><![CDATA[COM Object]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.powershell.nu/?p=741</guid>
		<description><![CDATA[Here&#8217;s a fun script that uses the new &#8220;Sticky Notes&#8221; in WIndows 7. The script is based on a simple function that uses the SendKeys() method through the Wscript.Shell COM object. This is a nice example on how you can handle COM objects through PowerShell. I&#8217;ve also included an if statement that checks if StickyNotes [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a fun script that uses the new &#8220;Sticky Notes&#8221; in WIndows 7.</p>
<p />
The script is based on a simple function that uses the SendKeys() method through the Wscript.Shell COM object. This is a nice example on how you can handle COM objects through PowerShell.</p>
<p />
I&#8217;ve also included an if statement that checks if StickyNotes is active. If that&#8217;s the case, the text will be started in a new StickyNotes.. note..</p>
<p />
Anyway, here&#8217;s the function.</p>
<pre>
<strong>
function Write-StickyNote ([string]$Text) {

	if (gps | Where { $_.ProcessName -match "stikynot" }) {

		$StickyNote = $True
	}

	$Wscript = New-Object -Com Wscript.Shell
	[void]$Wscript.Run("stikynot.exe")
	start-sleep 1

	if ($StickyNote -eq $True) {

		$Wscript.SendKeys("^n")
	}

	$Wscript.SendKeys($Text)
}
</strong>
</pre>
<p>And here&#8217;s an example on running the function.</p>
<p />
<pre>
<strong>
PS > .\Write-StickyNote.ps1 "Hello from PowerShell.nu"
</strong>
</pre>
<p />
<a href="http://www.powershell.nu/wp-content/uploads/2009/06/stickynotes01.jpg"><img src="http://www.powershell.nu/wp-content/uploads/2009/06/stickynotes01.jpg" alt="stickynotes01" title="stickynotes01" width="201" height="183" class="alignnone size-full wp-image-742" /></a></p>
<p />
<a href="http://www.powershell.nu/wp-content/uploads/2009/06/write-stickynote.ps1">Click here to download the Script</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.powershell.nu/2009/06/05/write-stickynote/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
