<?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>devtrends.com &#187; Microsoft O/S</title>
	<atom:link href="http://www.devtrends.com/index.php/category/microsoft-os/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.devtrends.com</link>
	<description>developing trends in information technology</description>
	<lastBuildDate>Tue, 06 Sep 2011 19:27:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Configuring SAMBA Shares in Ubuntu</title>
		<link>http://www.devtrends.com/index.php/configuring-samba-shares-in-ubuntu/</link>
		<comments>http://www.devtrends.com/index.php/configuring-samba-shares-in-ubuntu/#comments</comments>
		<pubDate>Sun, 27 Feb 2011 23:30:21 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Microsoft O/S]]></category>
		<category><![CDATA[SMB]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Linux Windows Shares]]></category>
		<category><![CDATA[SAMBA]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=705</guid>
		<description><![CDATA[I needed to upgrade my file server to support larger disks (1TB SATA) and at the same time I wanted to upgrade from Windows 2000 Server. Prior to my purchasing...]]></description>
			<content:encoded><![CDATA[<p>I needed to upgrade my file server to support larger disks (1TB SATA) and at the same time I wanted to upgrade from Windows 2000 Server. Prior to my purchasing a TechNet subscription, I only had one viable option, to use Linux. I would say that the order of events (Linux then TechNet) was beneficial as I had to actually learn to use Linux. This started a whole interest in Linux/Unix (and Mac) that is still growing today.</p>
<p>As you may know, to make a Linux server replace a Windows file server you&#8217;ll need a common file sharing protocol between both server and client. Well, SAMBA is the answer. In reality I think that SAMBA is the only answer.</p>
<p><strong>Installing SAMBA</strong></p>
<p>To be honest, I just rebuilt my Linux machine this month and have already forgotten whether SAMBA came preinstalled on Ubuntu Server 9.10 or not. Even if it is already install, it doesn&#8217;t hurt to try installing it again:</p>
<blockquote><p>aaron@server:/# sudo apt-get install samba</p></blockquote>
<p>Among other files, the three files you will use the most in configuring SAMBA are the config file, /etc/samba/smb.conf, and the init script for the daemon, /etc/init.d/samba, and the SAMBA password tool, /usr/bin/smbpasswd.</p>
<p><strong>Configuring Users and Groups for SAMBA</strong></p>
<p>The first step is creating the users and groups that will be accessing the SAMBA share. In this example, we will use local Linux accounts and groups, then activate the user account in SAMBA. The group will be used to assign permissions to the directory in the Linux file system.</p>
<p>Because my set up is small, I have only a few accounts and one group that I use for SAMBA shares. The group has all SAMBA users in it and is named &#8220;dtusers&#8221;. Let&#8217;s work with my configuration as the example.</p>
<p>First, if you dare, switch to the root account (or best practice is to use sudo for every command):</p>
<blockquote><p>root@server:/# sudo su</p></blockquote>
<p>To create a new system group, use the following:</p>
<blockquote><p>root@server:/# groupadd -r dtusers</p></blockquote>
<p>Now that we have the group created, we should create some users as well. As we create the users, we will assign the group we just created as a supplemental group.</p>
<blockquote><p>root@server:/# useradd -G dtusers -p P@ssW0rd aaron</p></blockquote>
<p>Use the above command as many times as needed for your users. &#8220;aaron&#8221; is the username, by the way. Additional thought, &#8220;P@ssW0rd&#8221; is not a secure password, and even though SAMBA is configured to synchronize passwords (see &#8220;unix password sync&#8221; setting in the smb.conf file), we want to ensure a password is set prior to SAMBA configuration.</p>
<p>Finally, we need to enable these accounts using the SAMBA smbpasswd password tool.</p>
<blockquote><p>root@server:/# smbpasswd -a aaron</p></blockquote>
<p>When you are prompted for a password, use the same password as you did when you created the user. Use the above command as many times as needed for your users.</p>
<p><strong>Configuring Directories for SAMBA Sharing</strong></p>
<p>The next step is figuring out which directories you want to share through SAMBA. In my case, I created all of my shares under /datastore/. For the example, lets copy my configuration.</p>
<p>Create the /datastore/ root directory. Then create a directory named aaron, a directory named music, a directory named pictures and a directory named downloads.</p>
<blockquote><p>root@server:/# mkdir /datastore<br />
root@server:/# cd /datastore<br />
root@server:/datastore# mkdir aaron<br />
root@server:/datastore# mkdir music<br />
root@server:/datastore# mkdir pictures<br />
root@server:/datastore# mkdir downloads</p></blockquote>
<p>Now that we have our directories created, we need to ensure owners and  permissions are set correctly for each of the directories.</p>
<p>First, we need to change the user and group owners. I recommend root as the main user for any &#8220;shared&#8221; directories:</p>
<blockquote><p>root@server:/datastore# chown aaron:dtusers aaron<br />
root@server:/datastore# chown root:dtusers music<br />
root@server:/datastore# chown root:dtusers pictures<br />
root@server:/datastore# chown root:dtusers downloads</p></blockquote>
<p>Last, we need to change the permissions. I recommend 775 (see Unix Permissions at the bottom of this  article for more info on 775) for any of the &#8220;shared&#8221; directories and  750 or 700 for the user specific directories.</p>
<blockquote><p>root@server:/datastore# chmod 700 aaron<br />
root@server:/datastore# chmod 775 music<br />
root@server:/datastore# chmod 775 pictures<br />
root@server:/datastore# chmod 775 downloads</p></blockquote>
<p>Now, have a look at your directories to make sure they have the appropriate permissions:</p>
<p><a href="http://www.devtrends.com/wp-content/uploads/2011/02/SAMBA_permissions_example.jpg"><img class="alignnone size-full wp-image-711" title="SAMBA_permissions_example" src="http://www.devtrends.com/wp-content/uploads/2011/02/SAMBA_permissions_example.jpg" alt="" width="479" height="138" /></a></p>
<p><strong>Configuring SAMBA</strong></p>
<p>The final step in configuring SAMBA is, well, configuring SAMBA. The SAMBA configuration file, smb.conf, that comes with the SAMBA install is rather large. We&#8217;ll go through it and change only some of the settings and add some of our own.</p>
<p>Using your favorite text editor (mine is actually vi, but if you are new to Linux, you&#8217;ll like nano better) and open the SAMBA configuration file:</p>
<blockquote><p>root@server:/# vi /etc/samba/smb.conf</p></blockquote>
<p>Scroll through the configuration file and review the various options. Once you have looked around, start changing variables. First if you have a DNS domain defined, I would change the following:</p>
<blockquote><p>workgroup = dt.local</p></blockquote>
<p>Next, scroll to the bottom of the configuration file and add your SAMBA share definitions. In this example, I have also configured a &#8220;create mask&#8221; which forces certain permission types for all new files, &#8220;directory mask&#8221; which forces certain permission types for all new directories, and &#8220;force group&#8221; to ensure the group is always my dtusers group:</p>
<blockquote><p>[aaron]<br />
path = /datastore/aaron<br />
valid users = aaron<br />
writable = yes<br />
browseable = yes<br />
read only = no<br />
create mask = 0700<br />
directory mask = 0700<br />
guest ok = no<br />
force group = dtusers</p>
<p>[music]<br />
path = /datastore/music<br />
valid users = @dtusers<br />
writable = yes<br />
browseable = yes<br />
read only = no<br />
create mask = 0775<br />
directory mask = 0775<br />
guest ok = no<br />
force group = dtusers</p>
<p>[pictures]<br />
path = /datastore/pictures<br />
valid users = @dtusers<br />
writable = yes<br />
browseable = yes<br />
read only = no<br />
create mask = 0775<br />
directory mask = 0775<br />
guest ok = no<br />
force group = dtusers</p>
<p>[downloads]<br />
path = /datastore/downloads<br />
valid users = @dtusers<br />
writable = yes<br />
browseable = yes<br />
read only = no<br />
create mask = 0775<br />
directory mask = 0775<br />
guest ok = no<br />
force group = dtusers</p></blockquote>
<p>You&#8217;ll notice that the [aaron] share contains &#8220;valid users&#8221; of only aaron, while the other &#8220;shared&#8221; shares contain &#8220;valid users&#8221; of @dtusers. The @ sign defines a group. If you have more than one group or users, separate them with a space.</p>
<p>Save the configuration file and then restart the SAMBA service:</p>
<blockquote><p>root@server:/# /etc/init.d/samba restart</p></blockquote>
<p><strong>Using SAMBA</strong></p>
<p>Now that you have SAMBA configured with some shares, give it a whirl from your Windows machine. If the user that you sign into on your Windows machine is the same, with the same password, as the Linux/SAMBA user you will not be prompted to authenticate.</p>
<p>Click Start &gt; Run and then type in the UNC path to your Linux server. If you have a DNS host (A) record for your server it could be \\server\share_name, otherwise just use the IP address, \\192.168.0.1\share_name.</p>
<p>That&#8217;s it. Enjoy Linux!</p>
<p><strong>Unix Permissions</strong></p>
<p>764 defines the permissions for User (the 7)/Group (the 6)/Everyone (the 4). As another example, if you wanted only the User to have full permissions, assign 700, which is User (the 7)/Group (the 0)/Everyone (the 0).</p>
<p>The number represents the collective of permission types: 4 is Read, 2 is Write, 1 is Execute. So a 7 would be 4 + 2 + 1, which means that when assigned to the User, it will have all three permission types, or full control. A zero means no permission types, and therefore no permissions.</p>
<p><strong>Links</strong></p>
<p><a href="http://www.samba.org/" target="_blank">http://www.samba.org/</a><br />
<a href="http://support.quickbooks.intuit.com/support/Articles/HOW12300" target="_blank">http://support.quickbooks.intuit.com/support/Articles/HOW12300</a></p>
<p>-Aaron</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/configuring-samba-shares-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 7 GodMode? It&#8217;s not your typical Doom mode!</title>
		<link>http://www.devtrends.com/index.php/windows-7-godmode-not-really/</link>
		<comments>http://www.devtrends.com/index.php/windows-7-godmode-not-really/#comments</comments>
		<pubDate>Sun, 27 Feb 2011 03:17:55 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[DevilMode]]></category>
		<category><![CDATA[GodMode]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=698</guid>
		<description><![CDATA[While working with a coworker, I noticed he had a &#8220;fancy&#8221; icon on his Desktop called GodMode. I thought, what the heck is he doing with an icon like that??...]]></description>
			<content:encoded><![CDATA[<p>While working with a coworker, I noticed he had a &#8220;fancy&#8221; icon on his Desktop called GodMode. I thought, what the heck is he doing with an icon like that?? Well, turns out, there is a way to make a shortcut to your Control Panel by simply creating a folder containing the CLSID for the Control Panel:</p>
<p>GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}</p>
<p>-or- if you feel like being different:</p>
<p>DevilMode.{ED7BA470-8E54-465E-825C-99712043E01C}</p>
<p><a href="http://www.microsoftnow.com/2010/01/windows-7-godmode-not-really.html" target="_blank">http://www.microsoftnow.com/2010/01/windows-7-godmode-not-really.html</a></p>
<p>-Aaron</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/windows-7-godmode-not-really/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Looking to Spark a Dream?</title>
		<link>http://www.devtrends.com/index.php/looking-to-spark-a-dream/</link>
		<comments>http://www.devtrends.com/index.php/looking-to-spark-a-dream/#comments</comments>
		<pubDate>Sat, 26 Feb 2011 17:29:07 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Microsoft O/S]]></category>
		<category><![CDATA[Programming and Software Development]]></category>
		<category><![CDATA[FREE]]></category>
		<category><![CDATA[Student]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=574</guid>
		<description><![CDATA[Microsoft DreamSpark While looking around for Microsoft Visual Basic 2008 Express Edition, I came across a site at Microsoft.com that states its sole purpose is: &#8220;It’s about giving students Microsoft...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.devtrends.com/wp-content/uploads/2011/02/dreamspark.jpg"><img class="size-medium wp-image-653 alignnone" title="dreamspark" src="http://www.devtrends.com/wp-content/uploads/2011/02/dreamspark-300x102.jpg" alt="" width="300" height="102" /></a></p>
<p><a href="https://www.dreamspark.com/default.aspx" target="_blank">Microsoft DreamSpark</a></p>
<p>While looking around for Microsoft Visual Basic 2008 Express Edition, I came across a site at Microsoft.com that states its sole purpose is: &#8220;It’s about giving students Microsoft professional tools at no charge.&#8221;</p>
<p>Wow. I&#8217;ve been a student for many years, taking one class here and there at local community colleges and have never heard of this offering.</p>
<p>If you have a TechNet subscription, then some of these products are already available to you, such as the Server Operating Systems; however, even my TechNet (standard for $199/yr) doesn&#8217;t provide tools like Microsoft Visual Studio 2010 Professional or Microsoft Robotics Developer Studio 2008 R3 or even Microsoft Windows Embedded Standard 7!!</p>
<p>So sign up if you have a student email address at your college/university and start programming in Visual Studio 2010 Professional!</p>
<p><strong>As a final benefit, you get a free Microsoft exam voucher. That alone is worth the sign up.</strong></p>
<p>-Aaron</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/looking-to-spark-a-dream/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Centralized Desktop and Favorites with a Centralized My Documents?</title>
		<link>http://www.devtrends.com/index.php/centralized-desktop-and-favorites-with-a-centralized-my-documents/</link>
		<comments>http://www.devtrends.com/index.php/centralized-desktop-and-favorites-with-a-centralized-my-documents/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 02:25:37 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Windows Server 2003]]></category>
		<category><![CDATA[Windows XP]]></category>
		<category><![CDATA[centralized desktop]]></category>
		<category><![CDATA[centralized favorites]]></category>
		<category><![CDATA[migrate desktop]]></category>
		<category><![CDATA[migrate favorites]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=592</guid>
		<description><![CDATA[What about Desktop and Favorites migration? Wouldn’t it be nice if there was a GPO that made the migration of your user’s Desktop and Favorites as easy as the migration...]]></description>
			<content:encoded><![CDATA[<p>What about Desktop and Favorites migration? Wouldn’t it be nice if there was a GPO that made the migration of your user’s Desktop and Favorites as easy as the migration of their My Documents? I think it would be nice. Since there isn’t, I created a script that would do the migration. This script should be run following a successful My Documents migration as the goal would be to put the files in the same location as the My Documents files.</p>
<p>When I first started the project, I was hoping that my script would run prior to showing the desktop. This is important because if it runs while the user has access to the desktop, that user may start using files that would prevent the script from running correctly (file locks). I had no luck; if anyone has an idea on how to do this, let me know. Otherwise, I created a .NET application that covers the entire screen on the primary monitor (if more than 1 monitor, then the second one is still visible).</p>
<p><strong>BlankScreen</strong></p>
<p>The BlankScreen application is written in VisualStudio .NET 2008 using .NET Framework 2.0 if I remember correctly. There are some changes you may want to make on this application to tailor it for your environment. The first change would be to put your logo on the application form. The second change, and really the more important change, is to change the ProcessPath variable to point to the UNC path of where you plan on putting the desktop.vbs file. This application just runs the VBScript.</p>
<p><a href="http://www.devtrends.com/wp-content/uploads/2010/07/BlankScreen.jpg"><img class="alignnone size-medium wp-image-593" title="BlankScreen" src="http://www.devtrends.com/wp-content/uploads/2010/07/BlankScreen-300x236.jpg" alt="" width="300" height="236" /></a></p>
<p>So you might be thinking, why would you have an application that is capable of much more advanced programming run a VBScript? Well, I wrote the script first and didn’t feel like porting it to VB.NET. If you feel like spending the time, go for it.</p>
<p><strong>desktop.vbs</strong></p>
<p>Enough chatter about the other stuff, on to the real product of this blog post, the VBScript.</p>
<p>The VBScript has four basic functions that it completes one after the other based on the success of the previous function. Step 1 is to get the username of the logged in user. Step 2 is to create the folders in the user’s My Documents location and copy the files into that new folders (nothing is moved). Step 3 is to update the registry for the Desktop and Favorites locations to the newly created folders. Step 4 renames the old folders in the C:\Documents and Settings\[user]\ folder to DesktopOLD and FavoritesOLD. I feared losing user files, so I did not make the script perform anything that couldn’t be reversed.</p>
<p>Just as you had to change a string variable in the BlankScreen application for your specific server, you also have to change the location of your user’s folder on the network. In my case it was \\fileserver\users\.</p>
<p><a href="http://www.devtrends.com/wp-content/uploads/2010/07/desktop_vbs.jpg"><img class="alignnone size-medium wp-image-594" title="desktop_vbs" src="http://www.devtrends.com/wp-content/uploads/2010/07/desktop_vbs-300x257.jpg" alt="" width="300" height="257" /></a></p>
<p>The migration will change the registry keys:</p>
<pre>HKCR\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, Favorites
HKCR\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, Desktop
HKCR\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders, Favorites
HKCR\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders, Desktop</pre>
<p>The new locations will look something like this:</p>
<p>Desktop: \\[server]\[share]\[username]\Desktop-[username]<br />
Favorites: \\[server]\[share]\[username]\Favorites-[username]<br />
e.g. \\fileserver\users\aaron\Desktop-aaron\ would be my desktop folder.</p>
<p><strong>Conclusion</strong></p>
<p>Implementing this solution is fairly easy. First modify the VB.NET application and compile it. Place the .exe file in a shared location that your login script for users has permissions. Place the VBScript file in a similar location, as you specified in the VB.NET application, and modify the serverpath variable and email variables. Test with your user account in your login script batch file using something similar to below:</p>
<pre>if %USERNAME% == yourusername (
 rem lets make sure the user has a my documents folder prior to trying to migrate their desktop
 if exist "\\[server]\Users\%USERNAME%" (
  if exist "C:\Documents and Settings\%USERNAME%\Desktop" (
   rem lets make sure they have the 2.0 Framework installed.
   if exist "C:\Windows\Microsoft.Net\Framework\v2.0*" (
    start "Desktop Migration" "\\[server]\[share]\blankscreen.exe"
   )
  )
 )
)</pre>
<p>As a disclaimer, the application AND script are provided without any warranty and is only for educational / informational purposes. If you choose to use it in your environment, production or not, the outcome is your responsibility.</p>
<p><strong>desktop.vbs Code</strong></p>
<pre>On Error Resume Next

'alert user of what is happening...
MsgBox "Please click OK to begin the backup process for your Desktop and Internet Explorer Favorites.  This process could take a few minutes, please be patient and Do NOT Cancel anything, otherwise data could be lost!" &amp; vbCrLf &amp; vbCrLf &amp; "If you have Administrator privileges, your computer will restart after all of your files have been copied!"

'get the current user
user = getUser()
'set the server location, the following \ is required!
serverpath = "\\[server]\Users\"
'if you have a helpdesk solution with email capability:
useemailnotify = 0
smtpfrom = "email@domain.com"
smtpto = "email@domain.com"
smtpserver = "smtp.domain.com"

'create folders
m_cf = createFolderscopyFiles(user)
If m_cf &lt;&gt; 1 Then
	'update the registry and reboot
	m_ur = updateRegistry(user)
	If m_ur &lt;&gt; 1 Then
		'rename the old folders so it does not use them anymore!
		m_rof = renameOldFolders(user)
		'reboot
		Set WSHShell = WScript.CreateObject("WScript.Shell")
		WshShell.Run "C:\WINDOWS\system32\shutdown.exe -r -t 0"
	End If
End If

Function getUser()
	'get the current user environment variable.
	Set oShell = CreateObject( "WScript.Shell" )
	user = oShell.ExpandEnvironmentStrings("%UserName%")

	If Err.Number &lt;&gt; 0 Then
		'we have failure!
		getUser = 1
		Err.Clear
	Else
		getUser = user
	End If
End Function

Function createFolderscopyFiles(user)
	Set objFSO = CreateObject("Scripting.FileSystemObject")

	'lets only do the folder create and file copy if that folder doesn't already exist. Otherwise, its just gonna set the registry and reboot.
	If Not objFSO.FolderExists(serverpath &amp; user &amp; "\Desktop-" &amp; user) Then
		'Create the new Desktop and the Favorites folder.
		objFSO.CreateFolder(serverpath &amp; user &amp; "\Desktop-" &amp; user)
		objFSO.CreateFolder(serverpath &amp; user &amp; "\Favorites-" &amp; user)

		Set oSHApp = CreateObject("Shell.Application")

		'Copy the Desktop files
		Set fromDFolder = oSHApp.Namespace("C:\Documents and Settings\" &amp; user &amp; "\Desktop")
		Set toDFolder = oSHApp.Namespace(serverpath &amp; user &amp; "\Desktop-" &amp; user)
		toDFolder.CopyHere fromDFolder.Items, 16+512

		'Copy the Favorites files
		Set fromFFolder = oSHApp.Namespace("C:\Documents and Settings\" &amp; user &amp; "\Favorites")
		Set toFFolder = oSHApp.Namespace(serverpath &amp; user &amp; "\Favorites-" &amp; user)
		toFFolder.CopyHere fromFFolder.Items, 16+512
	End If

	If Err.Number &lt;&gt; 0 Then
		'we have failure!
		SendEmail user,"failed at createFolderscopyFiles",Err.Description
		createFolderscopyFiles = 1
		Err.Clear
	Else
		createFolderscopyFiles = 0
	End If
End Function

Function updateRegistry(user)
	'lets work on the registry now
	Const HKEY_CURRENT_USER = &amp;H80000001
	Const HKEY_LOCAL_MACHINE = &amp;H80000002

	'update the registry for Desktop and Favorites (User Shell Folders)
	'set Favorites
	Set oFReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &amp; "." &amp; "\root\default:StdRegProv")
	strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders"
	strValueName = "Favorites"
	strValue = serverpath &amp; user &amp; "\Favorites-" &amp; user
	oFReg.SetExpandedStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
	'set Desktop
	Set oDReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &amp; "." &amp; "\root\default:StdRegProv")
	strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders"
	strValueName = "Desktop"
	strValue = serverpath &amp; user &amp; "\Desktop-" &amp; user
	oDReg.SetExpandedStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

	'update the registry for Desktop and Favorites (Shell Folders)
	'set Favorites
	Set otFReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &amp; "." &amp; "\root\default:StdRegProv")
	strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
	strValueName = "Favorites"
	strValue = serverpath &amp; user &amp; "\Favorites-" &amp; user
	otFReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
	'set Desktop
	Set otDReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &amp; "." &amp; "\root\default:StdRegProv")
	strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
	strValueName = "Desktop"
	strValue = serverpath &amp; user &amp; "\Desktop-" &amp; user
	otDReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

	If Err.Number &lt;&gt; 0 Then
		'we have failure!
		SendEmail user,"failed at updating registry",Err.Description
		updateRegistry = 1
		Err.Clear
	Else
		updateRegistry = 0
	End If
End Function

Function renameOldFolders(user)
	Set objFSO = CreateObject("Scripting.FileSystemObject")
	objFSO.MoveFolder "C:\Documents and Settings\" &amp; user &amp; "\Desktop", "C:\Documents and Settings\" &amp; user &amp; "\DesktopOLD"
	objFSO.MoveFolder "C:\Documents and Settings\" &amp; user &amp; "\Favorites", "C:\Documents and Settings\" &amp; user &amp; "\FavoritesOLD"

	If Err.Number &lt;&gt; 0 Then
		'we have failure!
		SendEmail user,"failed at renaming old folders",Err.Description
		renameOldFolders = 1
		Err.Clear
	Else
		renameOldFolders = 0
	End If
End Function

Sub SendEmail(user,contnt,contntB)
	'if the setting is to send an email, then do it, otherwise...nada.
	If useemailnotify = 1 Then
		'send an email!!
		Set objEmail = CreateObject("CDO.Message")
		objEmail.From = smtpfrom
		objEmail.To = smtpto
		objEmail.Subject = "Desktop and Favorites Migration Issue for " &amp; user
		objEmail.Textbody = "User had a Desktop files migration error." &amp; vbCrLf &amp; vbCrLf &amp; contnt &amp; vbCrLf &amp; vbCrLf &amp; contntB
		objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
		objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpserver
		objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
		objEmail.Configuration.Fields.Update
		objEmail.Send

		If Err.Number &lt;&gt; 0 Then
			'we have failure!
			MsgBox "Your Desktop migration didn't go very well."
			Err.Clear
		Else
			'YAY!
		End If
	End If
End Sub
</pre>
<p><strong>Downloads</strong></p>
<p><a href="http://www.devtrends.com/downloads/BlankScreen.zip" target="_self">BlankScreen.zip</a> &#8211; VB.NET application</p>
<p><a href="http://www.devtrends.com/downloads/desktop.zip" target="_self">desktop.zip</a> &#8211; VBScript</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/centralized-desktop-and-favorites-with-a-centralized-my-documents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lockdown a Centralized My Documents</title>
		<link>http://www.devtrends.com/index.php/lockdown-a-centralized-my-documents/</link>
		<comments>http://www.devtrends.com/index.php/lockdown-a-centralized-my-documents/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 04:31:34 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows Server 2003]]></category>
		<category><![CDATA[My Documents redirection]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=588</guid>
		<description><![CDATA[Recently a coworker and I were tasked with migrating the My Documents folder of all users to a central server. The obvious comes to mind for migrating users data; data...]]></description>
			<content:encoded><![CDATA[<p>Recently a coworker and I were tasked with migrating the My Documents folder of all users to a central server. The obvious comes to mind for migrating users data; data backup. However, the true reason we were migrating our users files was to simplify workstation management, particularly when we needed to replace a user’s workstation. If the files are stored on the server, there is no need for us to copy data from one workstation to another. You might be thinking, what about the Desktop and Favorites? I’ll have an article on that topic soon.</p>
<p>So, why write this article? Well, we wanted to make sure that user data was not accessible by anyone in the organization except that user and the backup process. This required custom permissions for the user folder, permissions that are not typical.</p>
<p>We used the GPO settings for My Documents redirection, setting the My Documents location to %HOMEPATH%. Obviously this required that the home path must be set for each and every user in Active Directory. The common way to accomplish this is to modify the users and set the home path to the desired server path. This would create the folder automatically for each user and assign full permissions to the user. It also sets Administrators with full permission. Bah.</p>
<p><strong>PowerShell is, well, powerful</strong></p>
<p>The solution that we came up with was to write a PowerShell script that would accomplish the same task as adding a home path in Active Directory. The only difference is that the script sets the folder permissions that we wanted.</p>
<p>The script accomplishes three tasks based on only providing it an Active Directory account, such as domain\user. The first task is to create the user folder on the server defined in the script. The second sets the permissions on that folder, removing Administrators and then adding SYSTEM and the user as Full Control. It also adds the user as the Owner of the folder. Third, it updates Active Directory, modifying the user’s home path to the newly created folder on the server.</p>
<p><strong>The Script</strong></p>
<p>Before I share the script, it comes with a disclaimer. Use at your own risk, the script is merely for informational purposes. You are responsible for your own server and the files and folders on it, and therefore I am not responsible if this script causes any harm.</p>
<pre style="white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;">
##################################################################################
#
#
#  Script name: SetHomeFolder.ps1
#  Author:      Aaron and John
#
#
##################################################################################

param ([string]$User, [switch]$help)

function GetHelp()
{
$HelpText = @"

DESCRIPTION:
NAME: SetHomeFolder.ps1
Creates folder and sets permissions for the specified user.
Creates folder if it does not exist. Removes "Administrators" default permission.

PARAMETERS:
-User            User to create folder for and who should have access (Required)
-help            Prints the HelpFile (Optional)

SYNTAX:
./SetHomeFolder.ps1 -User Domain\UserName

Creates \\[server]\Users\[UserName] and sets new permissions for that folder.

"@
$HelpText

[system.enum]::getnames([System.Security.AccessControl.FileSystemRights])
}

function CreateFolder ([string]$Path)
{
#check if the folder Exists
Write-Host "$Path..." -Foregroundcolor Green

if (Test-Path $Path) {
Write-Host "...Already Exists" -ForeGroundColor Yellow
} else {
Write-Host "...Created"
New-Item -Path $Path -type directory | Out-Null
}
}

function SetAcl ([string]$Path, [string]$User, [string]$Permission)
{
#this trap prevents ugly errors on the screen when attempting to update the ACL for the user.
trap [Exception]
{
write-host "  ERROR: $($_.Exception.Message)" -ForeGroundColor Magenta
continue
}

Write-Host "Setting Permissions..." -ForeGroundColor Green

#get ACL on folder and assign as object
$GetACL = Get-Acl $Path

#set up the access rules
$Allinherit = [system.security.accesscontrol.InheritanceFlags]"ContainerInherit, ObjectInherit"
$Allpropagation = [system.security.accesscontrol.PropagationFlags]"None"
$AccessRule = New-Object system.security.AccessControl.FileSystemAccessRule($User, $Permission, $AllInherit, $Allpropagation, "Allow")
$SystemAccessRule = New-Object system.security.AccessControl.FileSystemAccessRule("SYSTEM", "FullControl", $AllInherit, $Allpropagation, "Allow")
$AdminAccessRule = New-Object system.security.AccessControl.FileSystemAccessRule("Administrators", "ReadAndExecute", $AllInherit, $Allpropagation, "Allow")

#check if Access for Administrators already exists - and REMOVE
Write-Host "...Removing Permission For: Administrators" -ForeGroundColor DarkGray
$GetACL.RemoveAccessRuleAll($AdminAccessRule) | Out-Null
#end of Administrators permissions

#check if Access for User Already Exists - and ADD
if ($GetACL.Access | Where { $_.IdentityReference -eq $User}) {
Write-Host "...Modifying Permissions For: $User" -ForeGroundColor Yellow

$AccessModification = New-Object system.security.AccessControl.AccessControlModification
$AccessModification.value__ = 2
$Modification = $False
#modify the ACL rule
$GetACL.ModifyAccessRule($AccessModification, $AccessRule, [ref]$Modification) | Out-Null
} else {
Write-Host "...Adding Permission: $Permission For: $User"
# add the ACL rule
$GetACL.AddAccessRule($AccessRule)
}
#end of User permissions

#check if Access for SYSTEM already exists - and ADD
if ($GetACL.Access | Where { $_.IdentityReference -eq "SYSTEM"}) {
Write-Host "...Modifying Permissions For: SYSTEM" -ForeGroundColor Yellow

$SystemAccessModification = New-Object system.security.AccessControl.AccessControlModification
$SystemAccessModification.value__ = 2
$SystemModification = $False
# modify the ACL rule
$GetACL.ModifyAccessRule($SystemAccessModification, $SystemAccessRule, [ref]$SystemModification) | Out-Null
} else {
Write-Host "...Adding Permission: FullControl For: SYSTEM"
#add the ACL rule
$GetACL.AddAccessRule($SystemAccessRule)
}
#end of SYSTEM permissions

#set the owner of the folder to the specified user
$GetACL.SetOwner((new-object System.Security.Principal.NTAccount("$User")))

#this command performs the actual update using the objects as defined above
Set-Acl -aclobject $GetACL -Path $Path
}

function Get-ADUser( [string]$samid=$env:username)
{
#find the user object in active directory and returns the user object to the calling line
$searcher=New-Object DirectoryServices.DirectorySearcher
$searcher.Filter="(&amp;(objectcategory=person)(objectclass=user)(sAMAccountname=$samid))"
$aduser=$searcher.FindOne()

if ($aduser -ne $null )
{
$aduser.getdirectoryentry()
}
}

if ($help)
{
#the user requested help, so let us display that help.
GetHelp
}

#set some global variables per our environment.
$Permission = "FullControl"
$username = $User.substring($User.indexof("\") + 1)
$Path = "\\[server]\Users\$username"

#LET'S BEGIN (sub Main()) - Process folder creation and security changes
if ($Path -AND $User -AND $Permission)
{
#1. create the folder
CreateFolder $Path

#2. set the ACL permissions and ownership for that folder
SetAcl $Path $User $Permission

#3. update active directory with the new path location
Write-Host "Updating Active Directory Home Folder..."
$aduser = Get-ADUser $username
$aduser.homeDirectory = "$Path"
$aduser.homeDrive = "P:"
$aduser.SetInfo()
Write-Host "...$username Updated with: $Path" -ForeGroundColor Green
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/lockdown-a-centralized-my-documents/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Deploying Applications with the Possibility of a Slow Connection (Robocopy)</title>
		<link>http://www.devtrends.com/index.php/deploying-applications-with-the-possibility-of-a-slow-connection/</link>
		<comments>http://www.devtrends.com/index.php/deploying-applications-with-the-possibility-of-a-slow-connection/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 19:43:49 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Batch Files]]></category>
		<category><![CDATA[Microsoft O/S]]></category>
		<category><![CDATA[zFeatured]]></category>
		<category><![CDATA[robocopy]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=523</guid>
		<description><![CDATA[Regardless of which software deployment suite you use in your organization, there is no way to avoid transferring the majority of the installation files to the local machine, whether that...]]></description>
			<content:encoded><![CDATA[<p>Regardless of which software deployment suite you use in your organization, there is no way to avoid transferring the majority of the installation files to the local machine, whether that is a file copy or a load into memory / temporary location. For small application deployments, running them directly from a share location on a server isn’t necessarily a bad idea, even if the user is connected remotely. However, on the other side of the spectrum, installing Microsoft Office from a server share, while connected remotely, is a bad idea.</p>
<p>So what is the solution? How about staging the files on the local hard drive prior to starting the installation? Your first thought might be a batch file or command script that uses xcopy – at least that was my first thought. However, xcopy assumes that your connection will not drop and that it is fairly fast. What happens when the user is remote and while copying the files the user disconnects from the Internet and Virtual Private Network (VPN)? The file copy process has to start over…</p>
<p>With robocopy, a Microsoft product, you can configure it to copy with resume capabilities. In addition, if you show the installation process to your users (different discussion), each file in the copy process displays its current transferred status (0-100%).</p>
<p><a href="http://www.devtrends.com/wp-content/uploads/2010/02/robocopy1.jpg"><img class="alignnone size-medium wp-image-524" title="robocopy1" src="http://www.devtrends.com/wp-content/uploads/2010/02/robocopy1-300x151.jpg" alt="" width="300" height="151" /></a></p>
<p><strong>Getting RoboCopy</strong></p>
<p>Robocopy is available for free from Microsoft as part of the Microsoft Windows Server 2003 <a href="http://go.microsoft.com/fwlink/?LinkId=72969" target="_blank">Resource Kit Tools</a>. The command line options are somewhat daunting, something you’d expect to see from the “grep &#8211;help” command in Linux. In this article we only use a small amount of the power that is Robocopy. For those that dislike command line tools, but still need the functionality of Robocopy, have a look at the GUI tools available for Robocopy.</p>
<ul>
<li><a href="http://technet.microsoft.com/en-us/magazine/2006.11.utilityspotlight.aspx" target="_blank">Utility Spotlight Robocopy GUI</a></li>
<li><a href="http://technet.microsoft.com/en-us/magazine/2009.04.utilityspotlight.aspx" target="_blank">Utility Spotlight RichCopy</a></li>
</ul>
<p><strong>Simple Deployment Script (Adobe Reader)</strong></p>
<p>Below is an example for deploying Adobe Reader to clients utilizing the Robocopy tool.</p>
<pre style="padding-left: 30px;">@ECHO OFF</pre>
<pre style="padding-left: 30px;">rem Create log folder, just in case it does not exist
md C:\installer
md C:\installer\logs
md C:\installer\AdobeReader9.3.0</pre>
<pre style="padding-left: 30px;">rem Bring down the files to the local drive
"\\installer\dist$\robocopy.exe" "\\installer\dist$\AdobeReader" "c:\installer\AdobeReader9.3.0" *.* /E /Z</pre>
<pre style="padding-left: 30px;">rem begin installation
msiexec.exe /i c:\installer\AdobeReader9.3.0\AcroRead.msi TRANSFORMS=c:\installer\AdobeReader9.3.0\AcroRead.mst /qn /l*v C:\installer\logs\AdobeReader9.3.0.log</pre>
<p><strong>Robocopy Command Line Options</strong></p>
<pre>C:\&gt;robocopy /?

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows     ::     Version XP010
-------------------------------------------------------------------------------

  Started : Fri Feb 05 10:30:35 2010

              Usage :: ROBOCOPY source destination [file [file]...] [options]

             source :: Source Directory (drive:\path or \\server\share\path).
        destination :: Destination Dir  (drive:\path or \\server\share\path).
               file :: File(s) to copy  (names/wildcards: default is "*.*").

::
:: Copy options :
::
                 /S :: copy Subdirectories, but not empty ones.
                 /E :: copy subdirectories, including Empty ones.
             /LEV:n :: only copy the top n LEVels of the source directory tree.

                 /Z :: copy files in restartable mode.
                 /B :: copy files in Backup mode.
                /ZB :: use restartable mode; if access denied use Backup mode.

  /COPY:copyflag[s] :: what to COPY (default is /COPY:DAT).
                       (copyflags : D=Data, A=Attributes, T=Timestamps).
                       (S=Security=NTFS ACLs, O=Owner info, U=aUditing info).

               /SEC :: copy files with SECurity (equivalent to /COPY:DATS).
           /COPYALL :: COPY ALL file info (equivalent to /COPY:DATSOU).
            /NOCOPY :: COPY NO file info (useful with /PURGE).

             /PURGE :: delete dest files/dirs that no longer exist in source.
               /MIR :: MIRror a directory tree (equivalent to /E plus /PURGE).

               /MOV :: MOVe files (delete from source after copying).
              /MOVE :: MOVE files AND dirs (delete from source after copying).

       /A+:[RASHNT] :: add the given Attributes to copied files.
       /A-:[RASHNT] :: remove the given Attributes from copied files.

            /CREATE :: CREATE directory tree and zero-length files only.
               /FAT :: create destination files using 8.3 FAT file names only.
               /FFT :: assume FAT File Times (2-second granularity).
               /256 :: turn off very long path (&gt; 256 characters) support.

             /MON:n :: MONitor source; run again when more than n changes seen.
             /MOT:m :: MOnitor source; run again in m minutes Time, if changed.

      /RH:hhmm-hhmm :: Run Hours - times when new copies may be started.
                /PF :: check run hours on a Per File (not per pass) basis.

             /IPG:n :: Inter-Packet Gap (ms), to free bandwidth on slow lines.

::
:: File Selection Options :
::
                 /A :: copy only files with the Archive attribute set.
                 /M :: copy only files with the Archive attribute and reset it.
    /IA:[RASHCNETO] :: Include only files with any of the given Attributes set.
    /XA:[RASHCNETO] :: eXclude files with any of the given Attributes set.

 /XF file [file]... :: eXclude Files matching given names/paths/wildcards.
 /XD dirs [dirs]... :: eXclude Directories matching given names/paths.

                /XC :: eXclude Changed files.
                /XN :: eXclude Newer files.
                /XO :: eXclude Older files.
                /XX :: eXclude eXtra files and directories.
                /XL :: eXclude Lonely files and directories.
                /IS :: Include Same files.
                /IT :: Include Tweaked files.

             /MAX:n :: MAXimum file size - exclude files bigger than n bytes.
             /MIN:n :: MINimum file size - exclude files smaller than n bytes.

          /MAXAGE:n :: MAXimum file AGE - exclude files older than n days/date.
          /MINAGE:n :: MINimum file AGE - exclude files newer than n days/date.
          /MAXLAD:n :: MAXimum Last Access Date - exclude files unused since n.
          /MINLAD:n :: MINimum Last Access Date - exclude files used since n.
                       (If n &lt; 1900 then n = n days, else n = YYYYMMDD date).

                /XJ :: eXclude Junction points. (normally included by default).

::
:: Retry Options :
::
               /R:n :: number of Retries on failed copies: default 1 million.
               /W:n :: Wait time between retries: default is 30 seconds.

               /REG :: Save /R:n and /W:n in the Registry as default settings.

               /TBD :: wait for sharenames To Be Defined (retry error 67).

::
:: Logging Options :
::
                 /L :: List only - don't copy, timestamp or delete any files.
                 /X :: report all eXtra files, not just those selected.
                 /V :: produce Verbose output, showing skipped files.
                /TS :: include source file Time Stamps in the output.
                /FP :: include Full Pathname of files in the output.

                /NS :: No Size - don't log file sizes.
                /NC :: No Class - don't log file classes.
               /NFL :: No File List - don't log file names.
               /NDL :: No Directory List - don't log directory names.

                /NP :: No Progress - don't display % copied.
               /ETA :: show Estimated Time of Arrival of copied files.

          /LOG:file :: output status to LOG file (overwrite existing log).
         /LOG+:file :: output status to LOG file (append to existing log).

               /TEE :: output to console window, as well as the log file.

               /NJH :: No Job Header.
               /NJS :: No Job Summary.

::
:: Job Options :
::
       /JOB:jobname :: take parameters from the named JOB file.
      /SAVE:jobname :: SAVE parameters to the named job file
              /QUIT :: QUIT after processing command line (to view parameters).

              /NOSD :: NO Source Directory is specified.
              /NODD :: NO Destination Directory is specified.
                /IF :: Include the following Files.</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/deploying-applications-with-the-possibility-of-a-slow-connection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bart&#8217;s Preinstalled Environment (BartPE) Windows LiveCD</title>
		<link>http://www.devtrends.com/index.php/barts-preinstalled-environment-bartpe-windows-livecd/</link>
		<comments>http://www.devtrends.com/index.php/barts-preinstalled-environment-bartpe-windows-livecd/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 16:30:39 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Windows XP]]></category>
		<category><![CDATA[LiveCD]]></category>
		<category><![CDATA[Rescue]]></category>
		<category><![CDATA[Windows PE]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=518</guid>
		<description><![CDATA[As much as I love the old school Disk Operating System (DOS) environment, the benefits of working with DOS, even for firmware updating, is fading away. Who has a floppy...]]></description>
			<content:encoded><![CDATA[<p>As much as I love the old school Disk Operating System (DOS) environment, the benefits of working with DOS, even for firmware updating, is fading away. Who has a floppy drive any more? Well I do, I purchased one with my Dell laptop and even though it is the slide in type (pull out the CD/DVD drive), it has a USB connector on the side of it. However, when it came time to create a bootable floppy, I couldn&#8217;t find any disks laying around. So, create a bootable DOS CD &#8211; still has limitations if you try to emulate a floppy.</p>
<p>Regardless, the 1.44MB limitation is irritating at minimum. Working with 1.44MB floppies today is almost as bad as working with old DOS programs in Windows 95 that can&#8217;t figure out how to use extended memory (above 640KB). It seems that many firmware updates are larger than a floppy, and if you try to fit it along with the bootable files, MSDOS.SYS et cetera, you&#8217;ll be quite unsuccessful. So, screw DOS boot disks &#8211; let&#8217;s make a Windows LiveCD!</p>
<p><strong>BartPE</strong></p>
<p>To ensure that everyone knows, Bart Lagerweij is the master mind, I am merely shareing my experiences with his exceptional work.</p>
<p>Go ahead and review <a href="http://www.nu2.nu/pebuilder/" target="_blank">Bart&#8217;s PE page</a>. Download and install the latest PEBuilder application from that link. You should also review the licensing notice.</p>
<p>In this example we are going to create a Windows XP PE LiveCD. To get started you will need a Windows XP Professional non-OEM CD, which Bart&#8217;s pebuilder application will use to create the bootable LiveCD, and a blank CD for the final product.</p>
<p><em>Note: unless you have two CD drives, I would recommend copying the contents of your Windows XP cd to your hard drive.</em></p>
<p><a href="http://www.devtrends.com/wp-content/uploads/2010/02/PE-Builder-1.jpg"><img class="alignnone size-medium wp-image-519" title="PE Builder 1" src="http://www.devtrends.com/wp-content/uploads/2010/02/PE-Builder-1-300x252.jpg" alt="" width="300" height="252" /></a></p>
<p>Open Bart&#8217;s PE Builder and set the source to the location where the Windows XP files reside. Under media output, choose &#8220;Burn to CD/DVD&#8221;. Click on the Builder menu and choose &#8220;Build ISO/CD (F5)&#8221;.</p>
<p><a href="http://www.devtrends.com/wp-content/uploads/2010/02/PE-Builder-2.jpg"><img class="alignnone size-medium wp-image-520" title="PE Builder 2" src="http://www.devtrends.com/wp-content/uploads/2010/02/PE-Builder-2-300x252.jpg" alt="" width="300" height="252" /></a></p>
<p>Assuming you receive no errors during the build and burn process, you should now have a bootable Windows XP LiveCD.</p>
<p>-Aaron Gilbert</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/barts-preinstalled-environment-bartpe-windows-livecd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Microsoft SteadyState as a Kiosk</title>
		<link>http://www.devtrends.com/index.php/using-microsoft-steadystate-for-a-kiosk/</link>
		<comments>http://www.devtrends.com/index.php/using-microsoft-steadystate-for-a-kiosk/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 17:04:11 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Kiosk]]></category>
		<category><![CDATA[Windows XP]]></category>
		<category><![CDATA[SteadyState]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=170</guid>
		<description><![CDATA[Making a publicly accessed computer safe can be a challenging project, especially if you are concerned about what web sites are allowed. Although there are quite a few methods for...]]></description>
			<content:encoded><![CDATA[<p>Making a publicly accessed computer safe can be a challenging project, especially if you are concerned about what web sites are allowed. Although there are quite a few methods for making a kiosk, such as pre-engineered hardware and software, there is always a cheaper method of accomplishing the same task. I am not here to argue that one is better than the other, only to share my experiences with creating a kiosk using products and knowledge I already had around.</p>
<p>There are a few pieces to the puzzle for any kiosk:</p>
<p>1. computer hardware, preferably equipment that can be physically locked down.<br />
2. user interface restriction software, including Internet access restriction.<br />
3. operating system state lock down.</p>
<p><strong>Piece 1</strong></p>
<p>For piece 1, I have used machines such as a Dell Optiplex and an Intel-based Apple Mac Mini. The Mini was a much better because of the size of the case and limited drives (one CD). For some public areas, I would recommend a physical enclosure for the computer case to prevent any physical access.</p>
<p><strong>Piece 2 and 3</strong></p>
<p>In some cases, the Microsoft <a title="SteadyState" href="http://www.microsoft.com/windows/products/winfamily/sharedaccess/default.mspx" target="_blank">SteadyState</a> product can handle 2 and 3. Prior to SteadyState, step 3 would require an additional product such as <a title="DeepFreeze" href="http://www.faronics.com/html/deepfreeze.asp" target="_blank">DeepFreeze</a> to &#8220;lock&#8221; the operating system state. You might be thinking, can SteadyState stand up to the 13 year old hacker that is going to break into your Kiosk? Unfortunately, I do not have the answer &#8211; however, a quick Google search might help you determine that because DeepFreeze is more popular there are more articles towards cracking it versus SteadyState.</p>
<p>Besides the disk &#8220;freezing&#8221;, SteadyState locks down the operating system using Windows policy configuration. Obviously if the computer is joined to a domain, the group policy objects (GPO) will override similar SteadyState configuration.</p>
<p><strong>More on Piece 3</strong></p>
<p>Controlling web access has been a problem in enterprises for years and a Kiosk is no exception. From a legal standpoint, you can&#8217;t fire outside users of a Kiosk if they do something inappropriate. This means that control of Internet has to be even more restricted, which can be quite difficult.</p>
<p>I would recommend the combination of two applications: (a) using a product such as NetNanny to lock down inappropriate categories; and (b) build a custom web browser such as shown in my article, <a href="http://www.devtrends.com/index.php/creating-a-custom-web-browser/" target="_self">creating your own custom web browser</a> using Microsoft Visual Studio Express 2008. The custom web browser will allow you to control functionality of Internet Explorer programmatically, such as a minimal interface, predefined control bar, et cetera.</p>
<p>As a final note, SteadyState allows the administrator to lock Internet Explorer down to specific web URLs. To save space on domain name restriction, (there is a character limit), use the following format to get the entire domain, *devtrends.com.</p>
<p><a href="http://www.developingtrends.net/wp-content/uploads/2009/11/lockdown.jpg"><img class="alignnone size-medium wp-image-481" title="lockdown" src="http://www.devtrends.com/wp-content/uploads/2009/11/lockdown-300x218.jpg" alt="lockdown" width="300" height="218" /></a></p>
<p>Have fun and do your research before you put a Kiosk out for everyone to use! As with all of my other posts, I am not responsible for your failures and guarantee nothing. Article is for educational purposes only.</p>
<p>-Aaron Gilbert</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/using-microsoft-steadystate-for-a-kiosk/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Echo Without Carriage Return or Line Feed (CR LF)?</title>
		<link>http://www.devtrends.com/index.php/echo-without-carriage-return-or-line-feed-cr-lf/</link>
		<comments>http://www.devtrends.com/index.php/echo-without-carriage-return-or-line-feed-cr-lf/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 04:46:48 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Batch Files]]></category>
		<category><![CDATA[DOS]]></category>
		<category><![CDATA[crlf]]></category>
		<category><![CDATA[echo]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=397</guid>
		<description><![CDATA[Recently, I wanted to make a terminal application automatically use the current signed-in Windows user name as the terminal session user name. When I first started on the task, I...]]></description>
			<content:encoded><![CDATA[<p>Recently, I wanted to make a terminal application automatically use the current signed-in Windows user name as the terminal session user name. When I first started on the task, I thought this will be easy; what acclaimed terminal program with heavily definable session settings is not capable of such? Well shoot &#8211; I was mistaken. However, I have never given up on the impossible in the past, and quite frankly this task was definitely not impossible in comparison to other tasks or projects…</p>
<p>As a quick overview to help you understand the problem, each session configuration is kept in individual files located in the \scripts\ folder within the application folder. The session files were not a standard format, such as an INI or XML, and appeared as though the application developer(s) used some proprietary data component for saving session configuration to the hard drive. While reviewing the session files with <a href="http://www.ultraedit.com/" target="_blank">UltraEdit</a>, I noticed that the data values were in standard text format amongst a fog of extended ASCII characters.</p>
<p>Ah ha! Concatenation is the solution…will it be batch file or .NET application?</p>
<p><a href="http://www.developingtrends.net/wp-content/uploads/2009/10/ilovedos.jpg"><img class="alignnone size-medium wp-image-400" title="ilovedos" src="http://www.devtrends.com/wp-content/uploads/2009/10/ilovedos-300x151.jpg" alt="ilovedos" width="300" height="151" /></a></p>
<p><strong>Gluing the Pieces Together</strong></p>
<p>Runner up, the batch file. I took the session configuration file and cut it right down the middle (where the user name value was), saving one half as session.p1 and the other half as session.p2. The next trick was to glue these files back together with the current Windows user name in between. I grew up using DOS so I thought that this would be easy; I could just echo %USERNAME% to a file, such as:</p>
<pre style="padding-left: 30px;">echo %USERNAME% &gt; session.nam</pre>
<p>Unfortunately, the echo command puts a CR/LF at the end of the file, even though %USERNAME% contains no such characters. Logic would state that since echo is typically used for screen output, it assumes that you want a line feed after your statement. Well, a line feed is going to break my batch file concatenation solution; I can’t have line feeds in a proprietary configuration file!</p>
<p><strong>Solution</strong></p>
<p>After much research, I pieced together a batch file line that echo’s a statement without line feeds! This is a golden nugget for anyone that is trying to solve this problem and it worked quite well in my batch file concatenation solution!</p>
<pre style="padding-left: 30px;">for %%a in (%USERNAME%) do (
echo/|set /p ="%%a"
) &gt; session.nam</pre>
<p>Obviously, you can replace %USERNAME% with any environment variable or text that you want – no quotes required.</p>
<p>Remember that where there is a will to do so, there is a way to accomplish any task.</p>
<p>Aaron Gilbert</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/echo-without-carriage-return-or-line-feed-cr-lf/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Windows 7 Student Edition Bootable Installation DVD</title>
		<link>http://www.devtrends.com/index.php/windows-7-student-edition-bootable-installation-dvd/</link>
		<comments>http://www.devtrends.com/index.php/windows-7-student-edition-bootable-installation-dvd/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 06:09:15 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Bootable Windows 7]]></category>
		<category><![CDATA[Windows 7 Student]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=389</guid>
		<description><![CDATA[Although the student deal for Windows 7 is at an exceptional price when compared to purchasing it from other retailers, it seems to follow the “you get what you pay...]]></description>
			<content:encoded><![CDATA[<p>Although the student deal for Windows 7 is at an exceptional price when compared to purchasing it from other retailers, it seems to follow the “you get what you pay for” saying when it comes to creating a bootable DVD for installation. I am uncertain of the reasoning behind not providing a nicely packaged ISO file, but then again, you did purchase Windows 7 for $29 instead of $219+ … in other words, no complaining!</p>
<p><a href="http://windows7.digitalriver.com/store/mswpus/en_US/DisplayHomePage" target="_blank">Windows 7 US Online Store – Student Registration</a></p>
<p><a href="http://www.developingtrends.net/wp-content/uploads/2009/10/downloading.jpg"><img class="alignnone size-medium wp-image-390" title="downloading" src="http://www.devtrends.com/wp-content/uploads/2009/10/downloading-300x177.jpg" alt="downloading" width="300" height="177" /></a></p>
<p>On to the first step…</p>
<p><strong>Acquiring oscdimg</strong></p>
<p>Creating an ISO from the downloaded student Windows 7 package requires the oscdimg.exe tool that is included with the Windows Automated Installation Kit (AIK). Although there is the AIK for Windows 7, the one for Vista will work fine.</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=C7D4BC6D-15F3-4284-9123-679830D629F2&amp;displaylang=en" target="_blank">Windows AIK (Vista)</a> &#8211; works with XP too</p>
<p>If you want to extract the file on your own from Microsoft’s web site, you will need to burn a DVD of the Windows AIK .img file. I am unfamiliar with any Microsoft provided tools, unless you have Windows 7, that are capable of burning an .img file…makes you wonder why Microsoft didn’t just use an ISO. I used <a href="http://www.imgburn.com/" target="_blank">ImgBurn </a>to burn the AIK to DVD. Once you have the AIK installed, the oscdimg.exe tool will be located in C:\Program Files\Windows AIK\Tools\PETools\.</p>
<p><strong>Extracting the student Windows 7 installation files</strong></p>
<p>After successfully downloading Windows 7, the first stage installer (such as Win7-P-Retail-en-us-x64.exe, setup1.box and setup2.box) will extract the files to the same location as themselves. All of the files should be uncompressed from the “box” and placed in \expandedSetup. After extraction, you should move the folder \expandedSetup to your C:\.</p>
<p>Note: you may receive the following error while extracting: “We are unable to create or save new files in the folder in which this application was downloaded. Please check the folder properties to make sure that you have security permission on the folder to write files and that the folder is not read-only.” Don’t worry about it, continue with this article regardless.</p>
<p><a href="http://www.developingtrends.net/wp-content/uploads/2009/10/unloading-the-box.jpg"><img class="alignnone size-medium wp-image-391" title="unloading the box" src="http://www.devtrends.com/wp-content/uploads/2009/10/unloading-the-box-300x109.jpg" alt="unloading the box" width="300" height="109" /></a></p>
<p><strong>Creating the ISO</strong></p>
<p>Using the oscdimg tool from an elevated command prompt, see my article, run the following command. Make sure you have the appropriate disk space available.</p>
<pre style="white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;">oscdimg -bC:\expandedSetup\boot\etfsboot.com -h -u2 -m -lWIN7_DVD C:\expandedSetup\ C:\7.iso</pre>
<p><a href="http://www.developingtrends.net/wp-content/uploads/2009/10/done.jpg"><img class="alignnone size-medium wp-image-392" title="done" src="http://www.devtrends.com/wp-content/uploads/2009/10/done-300x156.jpg" alt="done" width="300" height="156" /></a></p>
<p>If you want to understand what the command line options do, review <a href="http://technet.microsoft.com/en-us/library/cc749036(WS.10).aspx" target="_blank">Microsoft’s Oscdimg Command-Line Options</a> page.</p>
<p><strong>Burn the ISO</strong></p>
<p>The final step is to burn the ISO to a blank DVD-R disc. You can use your program of choice &#8211; mine is <a href="http://cdburnerxp.se/" target="_blank">CDBurnerXP</a>.</p>
<p>That’s it…you now have a Windows 7 bootable DVD.</p>
<p>Aaron Gilbert</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/windows-7-student-edition-bootable-installation-dvd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

