<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Tips when scripting users in SBS 2008</title>
	<atom:link href="http://blog.powershell.no/2009/01/07/tips-when-scripting-users-in-sbs-2008/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.powershell.no/2009/01/07/tips-when-scripting-users-in-sbs-2008/</link>
	<description>On Windows PowerShell and other admin-related topics</description>
	<lastBuildDate>Thu, 09 Sep 2010 21:23:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Jan Egil Ring</title>
		<link>http://blog.powershell.no/2009/01/07/tips-when-scripting-users-in-sbs-2008/#comment-47</link>
		<dc:creator>Jan Egil Ring</dc:creator>
		<pubDate>Wed, 07 Oct 2009 20:16:23 +0000</pubDate>
		<guid isPermaLink="false">http://janegilring.wordpress.com/2009/01/07/tips-when-scripting-users-in-sbs-2008/#comment-47</guid>
		<description>Rodeca, good point! Glad I could help.</description>
		<content:encoded><![CDATA[<p>Rodeca, good point! Glad I could help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rodeca</title>
		<link>http://blog.powershell.no/2009/01/07/tips-when-scripting-users-in-sbs-2008/#comment-46</link>
		<dc:creator>Rodeca</dc:creator>
		<pubDate>Wed, 07 Oct 2009 10:03:16 +0000</pubDate>
		<guid isPermaLink="false">http://janegilring.wordpress.com/2009/01/07/tips-when-scripting-users-in-sbs-2008/#comment-46</guid>
		<description>Great, thanks

I&#039;ll keep using (for a while, at least) my VBS + Excel (hacked at MS scriptcenter), but you told me what I was looking for: set &quot;my&quot; users as if they were added using that wizard.

Rodeca
P.S. Besides your &quot;laziness&quot; reason, there is another one: avoid mistakes &amp; errata</description>
		<content:encoded><![CDATA[<p>Great, thanks</p>
<p>I&#8217;ll keep using (for a while, at least) my VBS + Excel (hacked at MS scriptcenter), but you told me what I was looking for: set &#8220;my&#8221; users as if they were added using that wizard.</p>
<p>Rodeca<br />
P.S. Besides your &#8220;laziness&#8221; reason, there is another one: avoid mistakes &amp; errata</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yves</title>
		<link>http://blog.powershell.no/2009/01/07/tips-when-scripting-users-in-sbs-2008/#comment-8</link>
		<dc:creator>Yves</dc:creator>
		<pubDate>Thu, 02 Apr 2009 09:20:33 +0000</pubDate>
		<guid isPermaLink="false">http://janegilring.wordpress.com/2009/01/07/tips-when-scripting-users-in-sbs-2008/#comment-8</guid>
		<description>I&#039;ll try that out, thank you very much.

Regards,

Yves</description>
		<content:encoded><![CDATA[<p>I&#8217;ll try that out, thank you very much.</p>
<p>Regards,</p>
<p>Yves</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Egil Ring</title>
		<link>http://blog.powershell.no/2009/01/07/tips-when-scripting-users-in-sbs-2008/#comment-6</link>
		<dc:creator>Jan Egil Ring</dc:creator>
		<pubDate>Tue, 31 Mar 2009 19:15:21 +0000</pubDate>
		<guid isPermaLink="false">http://janegilring.wordpress.com/2009/01/07/tips-when-scripting-users-in-sbs-2008/#comment-6</guid>
		<description>Hi Yves!

I`m glad the sample helped you.

Here is another sample which also creates the homefolders:
import-csv &quot;C:\import.csv&quot; &#124; foreach-object { $username = $_.samaccountname;New-QADUser -FirstName $_.givenname -LastName $_.sn -ParentContainer $_.ParentContainer -SamAccountName $_.samaccountname -Name $_.name -displayname $_.displayname -userprincipalname $_.userprincipalname -Company $_.company -Department $_.department -PhoneNumber $_.telephonenumber &#124; Set-QADUser -UserPassword Passord1 -ObjectAttributes @{homeDrive= &#039;F:&#039; ;homeDirectory= &quot;\\domain.local\Data\Users\$username&quot; ;scriptPath=&#039;netlogon.cmd&#039;}&#124;Enable-QADUser;New-Item -Path \\domain.local\Data\Users\$username -type directory}

For setting NTFS security on the homefolders I`ve used Eric McCarty`s set-FileSystemSecurity function available on his blog: http://ewmccarty.spaces.live.com/blog/cns!CE2AE9EFF99E6598!131.entry

Hint: Install PowerShell Community Extensions (PSCX) SCX 1.1.1 from http://www.codeplex.com/PowerShellCX
and install it.

Then grant the &quot;SeRestore&quot; privilege to the PowerShell process (needed for the set-FileSystemSecurity function to be able to set permissions):

PS &gt; $SeRestore = new-object Pscx.Interop.TokenPrivilege &quot;SeRestorePrivilege&quot;, $true

Then, grant it to the current process&#039;s token (powershell.exe):

PS &gt; Set-Privilege $SeRestore

Then run set-FileSystemSecurity C:\homefolders domain.local</description>
		<content:encoded><![CDATA[<p>Hi Yves!</p>
<p>I`m glad the sample helped you.</p>
<p>Here is another sample which also creates the homefolders:<br />
import-csv &#8220;C:\import.csv&#8221; | foreach-object { $username = $_.samaccountname;New-QADUser -FirstName $_.givenname -LastName $_.sn -ParentContainer $_.ParentContainer -SamAccountName $_.samaccountname -Name $_.name -displayname $_.displayname -userprincipalname $_.userprincipalname -Company $_.company -Department $_.department -PhoneNumber $_.telephonenumber | Set-QADUser -UserPassword Passord1 -ObjectAttributes @{homeDrive= &#8216;F:&#8217; ;homeDirectory= &#8220;\\domain.local\Data\Users\$username&#8221; ;scriptPath=&#8217;netlogon.cmd&#8217;}|Enable-QADUser;New-Item -Path \\domain.local\Data\Users\$username -type directory}</p>
<p>For setting NTFS security on the homefolders I`ve used Eric McCarty`s set-FileSystemSecurity function available on his blog: <a href="http://ewmccarty.spaces.live.com/blog/cns" rel="nofollow">http://ewmccarty.spaces.live.com/blog/cns</a>!CE2AE9EFF99E6598!131.entry</p>
<p>Hint: Install PowerShell Community Extensions (PSCX) SCX 1.1.1 from <a href="http://www.codeplex.com/PowerShellCX" rel="nofollow">http://www.codeplex.com/PowerShellCX</a><br />
and install it.</p>
<p>Then grant the &#8220;SeRestore&#8221; privilege to the PowerShell process (needed for the set-FileSystemSecurity function to be able to set permissions):</p>
<p>PS &gt; $SeRestore = new-object Pscx.Interop.TokenPrivilege &#8220;SeRestorePrivilege&#8221;, $true</p>
<p>Then, grant it to the current process&#8217;s token (powershell.exe):</p>
<p>PS &gt; Set-Privilege $SeRestore</p>
<p>Then run set-FileSystemSecurity C:\homefolders domain.local</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yves</title>
		<link>http://blog.powershell.no/2009/01/07/tips-when-scripting-users-in-sbs-2008/#comment-5</link>
		<dc:creator>Yves</dc:creator>
		<pubDate>Fri, 27 Mar 2009 14:14:45 +0000</pubDate>
		<guid isPermaLink="false">http://janegilring.wordpress.com/2009/01/07/tips-when-scripting-users-in-sbs-2008/#comment-5</guid>
		<description>Jan,

your powershell sample helped me out alot. I had some problems with setting the homedirectory and drive. Now it all works fine. In my older 2000 environment I had an automated script that also created the user folders, how do you do that after importing the users? Anyway, thanks alot for sharing this info.

Regards,

Yves</description>
		<content:encoded><![CDATA[<p>Jan,</p>
<p>your powershell sample helped me out alot. I had some problems with setting the homedirectory and drive. Now it all works fine. In my older 2000 environment I had an automated script that also created the user folders, how do you do that after importing the users? Anyway, thanks alot for sharing this info.</p>
<p>Regards,</p>
<p>Yves</p>
]]></content:encoded>
	</item>
</channel>
</rss>
