<?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>recursively set owner permissions Archives - the Sysadmin Channel</title>
	<atom:link href="https://thesysadminchannel.com/tag/recursively-set-owner-permissions/feed/" rel="self" type="application/rss+xml" />
	<link>https://thesysadminchannel.com/tag/recursively-set-owner-permissions/</link>
	<description>Documenting My Life as a System Administrator</description>
	<lastBuildDate>Thu, 28 Jun 2018 04:45:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
<site xmlns="com-wordpress:feed-additions:1">144174110</site>	<item>
		<title>Get NTFS Access Permissions using NTFSSecurity Module</title>
		<link>https://thesysadminchannel.com/get-ntfs-access-permissions-using-ntfssecurity-module/</link>
					<comments>https://thesysadminchannel.com/get-ntfs-access-permissions-using-ntfssecurity-module/#comments</comments>
		
		<dc:creator><![CDATA[Paul Contreras]]></dc:creator>
		<pubDate>Thu, 28 Jun 2018 04:45:47 +0000</pubDate>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[adding ntfs permissions powershell]]></category>
		<category><![CDATA[get owner permissions powershell]]></category>
		<category><![CDATA[NTFSSecurity Module]]></category>
		<category><![CDATA[Powershell set permissions]]></category>
		<category><![CDATA[recursively set owner permissions]]></category>
		<category><![CDATA[server administration]]></category>
		<category><![CDATA[set ntfs permissions powershell]]></category>
		<guid isPermaLink="false">https://thesysadminchannel.com/?p=674</guid>

					<description><![CDATA[<p>I have to say Get NTFS Access Permissions and the NTFSSecurity Module is probably one of the best things since sliced bread. Natively, Powershell doesn&#8217;t offer a very good solution for checking NTFS permissions so author Raimund Andrée came up&#8230; <a href="https://thesysadminchannel.com/get-ntfs-access-permissions-using-ntfssecurity-module/" class="more-link">Continue Reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://thesysadminchannel.com/get-ntfs-access-permissions-using-ntfssecurity-module/">Get NTFS Access Permissions using NTFSSecurity Module</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I have to say Get NTFS Access Permissions and the NTFSSecurity Module is probably one of the best things since sliced bread.  Natively, Powershell doesn&#8217;t offer a very good solution for checking NTFS permissions so author <a href="https://social.technet.microsoft.com/profile/raimund%20andr%C3%A9e/" rel="noopener" target="_blank">Raimund Andrée</a> came up with the NTFSSecurity Module to allow for easy security transactions within your environment.</p>
<h2>How to Download and Use the NTFSSecurity Module</h2>
<p>In order to use this incredible and powerful module head on over to the TechNet repository and <a href="https://gallery.technet.microsoft.com/scriptcenter/1abd77a5-9c0b-4a2b-acef-90dbb2b84e85" rel="noopener" target="_blank">download the NTFSSecurity Module</a>.  Once you have the module downloaded and extracted to a location on your computer:</p>
<ul>
<li>Copy the NTFSSecurity folder to <strong>C:\Windows\System32\WindowsPowerShell\v1.0\Modules</strong> </li>
</ul>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2018/06/Import-Module-to-Modules-Directory.png" target="_blank"><img fetchpriority="high" decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2018/06/Import-Module-to-Modules-Directory.png" alt="Import-Module to Modules Directory" width="714" height="265" class="aligncenter size-full wp-image-685" /></a></p>
<p>&nbsp;</p>
<ul>
<li>Open Powershell and type in the following:</li>
</ul>
<pre class="brush: powershell; title: ; notranslate">
#Importing the NTFSSecurity Module
Import-Module NTFSSecurity

#Getting all the commands associated with the NTFSSecurity module
Get-Command -Module NTFSSecurity
</pre>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2018/06/Get-Command-Module-NTFSSecurity.png" target="_blank"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2018/06/Get-Command-Module-NTFSSecurity.png" alt="Get-Command -Module NTFSSecurity" width="861" height="551" class="aligncenter size-full wp-image-691" srcset="https://thesysadminchannel.com/wp-content/uploads/2018/06/Get-Command-Module-NTFSSecurity.png 861w, https://thesysadminchannel.com/wp-content/uploads/2018/06/Get-Command-Module-NTFSSecurity-768x491.png 768w" sizes="(max-width: 861px) 100vw, 861px" /></a></p>
<p>&nbsp;</p>
<ul>
<li>Check file or folder permissions by doing the following:</li>
<li>I like to check effective permissions because it shows if the user has access to a folder even if it&#8217;s not explicitly added by the username.</li>
</ul>
<pre class="brush: powershell; title: ; notranslate">

$Path = 'E:\Linux ISOs\'
Get-ChildItem -Path $Path -Recurse -Directory | Get-NTFSEffectiveAccess -Account 'AD\pcontreras' | select Account, AccessControlType, AccessRights, FullName

</pre>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2018/06/Get-NTFSEffectiveAccess-Account-Username.png" target="_blank"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2018/06/Get-NTFSEffectiveAccess-Account-Username.png" alt="Get-NTFSEffectiveAccess -Account Username" width="971" height="451" class="aligncenter size-full wp-image-697" srcset="https://thesysadminchannel.com/wp-content/uploads/2018/06/Get-NTFSEffectiveAccess-Account-Username.png 971w, https://thesysadminchannel.com/wp-content/uploads/2018/06/Get-NTFSEffectiveAccess-Account-Username-768x357.png 768w" sizes="(max-width: 971px) 100vw, 971px" /></a></p>
<h2>Change Directory Owner Recursively In Powershell</h2>
<p>Say the permissions structure was fubar&#8217;d beyond belief and we wanted to start fixing it by taking over owner permissions and working our way down the file system.  With the <strong>Set-NTFSOwner</strong> cmdlet we could definitely do that with ease.  Here&#8217;s how!</p>
<pre class="brush: powershell; title: ; notranslate">

$Path = 'E:\Linux ISOs\'

#We'll start off by getting current owner permissions to see what's going on.
Get-ChildItem -Path $Path -Recurse -Directory | Get-NTFSOwner

Item                 Owner
----                 -----
E:\Linux ISOs\CentOS AD\pcontreras
E:\Linux ISOs\Redhat AD\pcontreras


#Next we'll change the owner permissions to the built-in Administrators of the machine.
Get-ChildItem -Path $Path -Recurse -Directory | Set-NTFSOwner -Account Administrators

#Checking to see if the new owner permissions were set properly.
Get-ChildItem -Path $Path -Recurse -Directory | Get-NTFSOwner

Item                 Owner
----                 -----
E:\Linux ISOs\CentOS BUILTIN\Administrators
E:\Linux ISOs\Redhat BUILTIN\Administrators


#Just for grins we'll set the owner back to pcontreras 
Get-ChildItem -Path $Path -Recurse -Directory | Set-NTFSOwner -Account 'AD\pcontreras'

#Checking once again to see if the permissions were set properly.
Get-ChildItem -Path $Path -Recurse -Directory | Get-NTFSOwner


Item                 Owner
----                 -----
E:\Linux ISOs\CentOS AD\pcontreras
E:\Linux ISOs\Redhat AD\pcontreras

</pre>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2018/06/Set-NTFSOwner-Account-Administrators.png" target="_blank"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2018/06/Set-NTFSOwner-Account-Administrators.png" alt="Set-NTFSOwner -Account Administrators" width="970" height="495" class="aligncenter size-full wp-image-701" srcset="https://thesysadminchannel.com/wp-content/uploads/2018/06/Set-NTFSOwner-Account-Administrators.png 970w, https://thesysadminchannel.com/wp-content/uploads/2018/06/Set-NTFSOwner-Account-Administrators-768x392.png 768w" sizes="(max-width: 970px) 100vw, 970px" /></a></p>
<p>&nbsp;</p>
<h2>Adding NTFS Permissions to a file or folder using Powershell</h2>
<pre class="brush: powershell; title: ; notranslate">

$Path = 'E:\Linux ISOs\'

#Adding username Djones full control rights to the Linux ISOs folder.
Add-NTFSAccess -Path $Path -Account &quot;AD\DJones&quot; -AccessRights FullControl -AccessType Allow -AppliesTo ThisFolderSubfoldersAndFiles

</pre>
<p>Hopefully this article of how to get NTFS access permissions was useful for you hopefully it saved you a lot of time with regards to permissions.  I know it helped save me a ton a time when I had to weed through permissions.</p>
<p>Also, don&#8217;t forget to check out our <a href="https://www.youtube.com/channel/UC9VnUjmZrNG3ithDZmG-S-g" rel="noopener" target="_blank">Youtube Channel</a> for more awesome Sysadmin content, especially if you&#8217;re more of a visual leaner, you will love what we got going on over there.</p>
<p>The post <a href="https://thesysadminchannel.com/get-ntfs-access-permissions-using-ntfssecurity-module/">Get NTFS Access Permissions using NTFSSecurity Module</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://thesysadminchannel.com/get-ntfs-access-permissions-using-ntfssecurity-module/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">674</post-id>	</item>
	</channel>
</rss>
