<?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/"
		>
<channel>
	<title>Comments on: Set Folder Permissions using a PowerShell script</title>
	<atom:link href="http://www.powershell.nu/2009/02/13/set-folder-permissions-using-a-powershell-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.powershell.nu/2009/02/13/set-folder-permissions-using-a-powershell-script/</link>
	<description></description>
	<lastBuildDate>Sat, 04 Sep 2010 15:41:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Munib</title>
		<link>http://www.powershell.nu/2009/02/13/set-folder-permissions-using-a-powershell-script/comment-page-1/#comment-4441</link>
		<dc:creator>Munib</dc:creator>
		<pubDate>Tue, 10 Aug 2010 13:00:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershell.nu/?p=430#comment-4441</guid>
		<description>Hi,

I am new to poweshell scripting, i wanted to set the permissionss of local users/group remotely on some machines.

Just wanted to know whether the remore/target machine requires .net framwork for this script to work.

Thanks...Munib</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I am new to poweshell scripting, i wanted to set the permissionss of local users/group remotely on some machines.</p>
<p>Just wanted to know whether the remore/target machine requires .net framwork for this script to work.</p>
<p>Thanks&#8230;Munib</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Asrhaf</title>
		<link>http://www.powershell.nu/2009/02/13/set-folder-permissions-using-a-powershell-script/comment-page-1/#comment-3974</link>
		<dc:creator>Asrhaf</dc:creator>
		<pubDate>Wed, 20 Jan 2010 18:08:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershell.nu/?p=430#comment-3974</guid>
		<description>Awesome. It works fine for remote computer too.</description>
		<content:encoded><![CDATA[<p>Awesome. It works fine for remote computer too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wacky Quince</title>
		<link>http://www.powershell.nu/2009/02/13/set-folder-permissions-using-a-powershell-script/comment-page-1/#comment-3972</link>
		<dc:creator>Wacky Quince</dc:creator>
		<pubDate>Mon, 11 Jan 2010 18:01:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershell.nu/?p=430#comment-3972</guid>
		<description>useful script. thank you</description>
		<content:encoded><![CDATA[<p>useful script. thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Resonant Hydrogen</title>
		<link>http://www.powershell.nu/2009/02/13/set-folder-permissions-using-a-powershell-script/comment-page-1/#comment-3971</link>
		<dc:creator>Resonant Hydrogen</dc:creator>
		<pubDate>Mon, 11 Jan 2010 18:01:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershell.nu/?p=430#comment-3971</guid>
		<description>Sweet simple working one buddy !! Thanks !!</description>
		<content:encoded><![CDATA[<p>Sweet simple working one buddy !! Thanks !!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: edthefixer</title>
		<link>http://www.powershell.nu/2009/02/13/set-folder-permissions-using-a-powershell-script/comment-page-1/#comment-3126</link>
		<dc:creator>edthefixer</dc:creator>
		<pubDate>Fri, 29 May 2009 13:52:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershell.nu/?p=430#comment-3126</guid>
		<description>I guess this posting you have in your blog answers my previous question:

http://www.powershell.nu/2009/04/27/part-116-adding-homefolder-through-powershell/

(I found it after I wrote this ....)

Anyway, I am having anissue with your Get-AD.ps1 file ...</description>
		<content:encoded><![CDATA[<p>I guess this posting you have in your blog answers my previous question:</p>
<p><a href="http://www.powershell.nu/2009/04/27/part-116-adding-homefolder-through-powershell/" rel="nofollow">http://www.powershell.nu/2009/04/27/part-116-adding-homefolder-through-powershell/</a></p>
<p>(I found it after I wrote this &#8230;.)</p>
<p>Anyway, I am having anissue with your Get-AD.ps1 file &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: edthefixer</title>
		<link>http://www.powershell.nu/2009/02/13/set-folder-permissions-using-a-powershell-script/comment-page-1/#comment-3090</link>
		<dc:creator>edthefixer</dc:creator>
		<pubDate>Thu, 28 May 2009 19:46:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershell.nu/?p=430#comment-3090</guid>
		<description>Niklas,

I just started working with PowerShell .... I can&#039;t believe i waited this long and kept doing things with VBScript! anyway ..... I tested your script and works nicely, good job.

I have several questions:

a) If i wanted to run the script remotely to create individual folders based on a user&#039;s list the script is reading (I extracted it from AD) to create individual user folders within an existing or non-existing share on a remote server, what would it be the best way? in the past using VBScript this what I have done:

Option Explicit
Dim intRow, objExcel, objSheet, strPathExcel
Dim strHomeFolder, strHome, strUser
Dim objFSO, objShell, intRunError 

strHome = “\\ServerName\ShareName\” 
strPathExcel = &quot;C:\ExcelFile.xlsx&quot; 
intRow = 3 &#039; Row 1 contains headings 
&#039; Open the Excel spreadsheet
Set objFSO = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set objExcel = CreateObject(&quot;Excel.Application&quot;)
Set objSheet = objExcel.Workbooks.Open(strPathExcel) 
&#039; Create a shell for cmd and CACLS
Set objShell = CreateObject(&quot;Wscript.Shell&quot;) 

&#039; Here is the loop that cycles through the cells
Do Until (objExcel.Cells(intRow,1).Value) = &quot;&quot;
strUser = objExcel.Cells(intRow, 1).Value
Call HomeDir &#039; I decided to use a subroutine
intRow = intRow + 1
Loop
objExcel.Quit &#039; Clears up Excel 

Sub HomeDir()
strHomeFolder = strHome &amp; strUser
If strHomeFolder  &quot;&quot; Then
If Not objFSO.FolderExists(strHomeFolder) Then
On Error Resume Next
objFSO.CreateFolder strHomeFolder
     If Err.Number  0 Then
     On Error GoTo 0
     Wscript.Echo &quot;Cannot create: &quot; &amp; strHomeFolder
 End If
On Error GoTo 0
End If
     If objFSO.FolderExists(strHomeFolder) Then

     &#039; Assign user permission to home folder.
     intRunError = objShell.Run(&quot;%COMSPEC% /c Echo Y&#124; cacls &quot;_
     &amp; strHomeFolder &amp; &quot; /e /c /g Administrators:f &quot;_
     &amp; strUser &amp; &quot;:F&quot;, 2, True)
        If intRunError  0 Then
        Wscript.Echo &quot;Error assigning permissions for user &quot; &amp; strUser &amp; &quot; to home folder &quot; &amp;
strHomeFolder
        End If
    End If
End If
End Sub
objExcel.Quit 
WScript.Quit
 
The previous script works and I do want to emulate the same with your script.

b) is there a better way to do this such as pulling the data directly from AD? using som type of AD query or Wmi calling?</description>
		<content:encoded><![CDATA[<p>Niklas,</p>
<p>I just started working with PowerShell &#8230;. I can&#8217;t believe i waited this long and kept doing things with VBScript! anyway &#8230;.. I tested your script and works nicely, good job.</p>
<p>I have several questions:</p>
<p>a) If i wanted to run the script remotely to create individual folders based on a user&#8217;s list the script is reading (I extracted it from AD) to create individual user folders within an existing or non-existing share on a remote server, what would it be the best way? in the past using VBScript this what I have done:</p>
<p>Option Explicit<br />
Dim intRow, objExcel, objSheet, strPathExcel<br />
Dim strHomeFolder, strHome, strUser<br />
Dim objFSO, objShell, intRunError </p>
<p>strHome = “\\ServerName\ShareName\”<br />
strPathExcel = &#8220;C:\ExcelFile.xlsx&#8221;<br />
intRow = 3 &#8216; Row 1 contains headings<br />
&#8216; Open the Excel spreadsheet<br />
Set objFSO = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br />
Set objExcel = CreateObject(&#8220;Excel.Application&#8221;)<br />
Set objSheet = objExcel.Workbooks.Open(strPathExcel)<br />
&#8216; Create a shell for cmd and CACLS<br />
Set objShell = CreateObject(&#8220;Wscript.Shell&#8221;) </p>
<p>&#8216; Here is the loop that cycles through the cells<br />
Do Until (objExcel.Cells(intRow,1).Value) = &#8220;&#8221;<br />
strUser = objExcel.Cells(intRow, 1).Value<br />
Call HomeDir &#8216; I decided to use a subroutine<br />
intRow = intRow + 1<br />
Loop<br />
objExcel.Quit &#8216; Clears up Excel </p>
<p>Sub HomeDir()<br />
strHomeFolder = strHome &amp; strUser<br />
If strHomeFolder  &#8220;&#8221; Then<br />
If Not objFSO.FolderExists(strHomeFolder) Then<br />
On Error Resume Next<br />
objFSO.CreateFolder strHomeFolder<br />
     If Err.Number  0 Then<br />
     On Error GoTo 0<br />
     Wscript.Echo &#8220;Cannot create: &#8221; &amp; strHomeFolder<br />
 End If<br />
On Error GoTo 0<br />
End If<br />
     If objFSO.FolderExists(strHomeFolder) Then</p>
<p>     &#8216; Assign user permission to home folder.<br />
     intRunError = objShell.Run(&#8220;%COMSPEC% /c Echo Y| cacls &#8220;_<br />
     &amp; strHomeFolder &amp; &#8221; /e /c /g Administrators:f &#8220;_<br />
     &amp; strUser &amp; &#8220;:F&#8221;, 2, True)<br />
        If intRunError  0 Then<br />
        Wscript.Echo &#8220;Error assigning permissions for user &#8221; &amp; strUser &amp; &#8221; to home folder &#8221; &amp;<br />
strHomeFolder<br />
        End If<br />
    End If<br />
End If<br />
End Sub<br />
objExcel.Quit<br />
WScript.Quit</p>
<p>The previous script works and I do want to emulate the same with your script.</p>
<p>b) is there a better way to do this such as pulling the data directly from AD? using som type of AD query or Wmi calling?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niklas Goude</title>
		<link>http://www.powershell.nu/2009/02/13/set-folder-permissions-using-a-powershell-script/comment-page-1/#comment-2660</link>
		<dc:creator>Niklas Goude</dc:creator>
		<pubDate>Mon, 18 May 2009 19:40:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershell.nu/?p=430#comment-2660</guid>
		<description>I&#039;m glad you liked it!

I found a great post on Copying ACL:s written by Jeffrey Snover.
It&#039;s worth a look.

http://blogs.msdn.com/powershell/archive/2009/05/11/copy-acl.aspx

Regards Niklas</description>
		<content:encoded><![CDATA[<p>I&#8217;m glad you liked it!</p>
<p>I found a great post on Copying ACL:s written by Jeffrey Snover.<br />
It&#8217;s worth a look.</p>
<p><a href="http://blogs.msdn.com/powershell/archive/2009/05/11/copy-acl.aspx" rel="nofollow">http://blogs.msdn.com/powershell/archive/2009/05/11/copy-acl.aspx</a></p>
<p>Regards Niklas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://www.powershell.nu/2009/02/13/set-folder-permissions-using-a-powershell-script/comment-page-1/#comment-2538</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Fri, 15 May 2009 18:42:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershell.nu/?p=430#comment-2538</guid>
		<description>Please disregard my last post.  I see that your script already does this.  I was attempting to modify the permissions for the users group.  But, since the users group is actually &#039;BUILTIN\Users&#039;, the $_.IdentityReference was never equal to $Access.  So, it was jumping to $GetACL.AddAccessRule($AccessRule).  Once I figued this out, it works like a charm.  Thanks for the great script!</description>
		<content:encoded><![CDATA[<p>Please disregard my last post.  I see that your script already does this.  I was attempting to modify the permissions for the users group.  But, since the users group is actually &#8216;BUILTIN\Users&#8217;, the $_.IdentityReference was never equal to $Access.  So, it was jumping to $GetACL.AddAccessRule($AccessRule).  Once I figued this out, it works like a charm.  Thanks for the great script!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://www.powershell.nu/2009/02/13/set-folder-permissions-using-a-powershell-script/comment-page-1/#comment-2533</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Fri, 15 May 2009 17:17:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershell.nu/?p=430#comment-2533</guid>
		<description>Niklas,
Very nice script.  Do you know if there is a way to modify the script to set a maximum security level?  For example, if I have a user with FullControl, and I want to modify the user&#039;s permissions to (only) ReadandExecute.</description>
		<content:encoded><![CDATA[<p>Niklas,<br />
Very nice script.  Do you know if there is a way to modify the script to set a maximum security level?  For example, if I have a user with FullControl, and I want to modify the user&#8217;s permissions to (only) ReadandExecute.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Effoggids</title>
		<link>http://www.powershell.nu/2009/02/13/set-folder-permissions-using-a-powershell-script/comment-page-1/#comment-1540</link>
		<dc:creator>Effoggids</dc:creator>
		<pubDate>Thu, 16 Apr 2009 04:30:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershell.nu/?p=430#comment-1540</guid>
		<description>hm. strange ))</description>
		<content:encoded><![CDATA[<p>hm. strange ))</p>
]]></content:encoded>
	</item>
</channel>
</rss>
