

Prior to this, he spent more than 8 years dealing with small business systems and home user environments. His present position has him testing and deploying just about any new Microsoft technology he’s asked to as well as dealing with users in an enterprise class environment. He deals with “anything thrown at him” from gnawed keyboards to recovery of Exchange servers to networking setups and isolating the realm of the unknown. He is self-taught in computer programming with 65xx machine code, working with many technologies, but primarily Microsoft technologies. He is a devoted and passionate computer enthusiast from the early 80s to the present day, having used just about every microcomputer ever. Sean is a network administrator, a Microsoft Certified Technology Specialist in Windows Server Virtualization, Configuration, and a Microsoft Certified Systems Engineer and MVP in Windows PowerShell. Wrapping up Guest Blogger Week is Sean Kearney. Hey, Scripting Guy! How can I use Windows PowerShell to create shares?

$Properties = Name'=$Folder.FullName 'Group/User'=$Access.IdentityReference 'Permissions'=$Access.FileSystemRights 'Inherited'=$Access.Summary: Guest blogger Sean Kearney shows you how to use Windows PowerShell to create shared folders and set permissions on a Windows desktop. $FolderPath = Get-ChildItem -Directory -Path "C:\temp" -Recurse -Force The final output ($Output) is then piped to Out-GridView so that you can sort and filter the results. A second ForEach loop formats each access control entry (ACE) into an ordered list, pulling out just the information that we need, making the results easy to read. The script below puts the folder hierarchy into a variable ($FolderPath) and then passes each folder to Get-Acl in the first ForEach loop.

So, if you want to know the permissions set on all folders in a directory tree, you need to use the Get-ChildItem cmdlet with the -Recurse parameter to list all the folders in the tree and then pass the results to Get-Acl using a ForEach loop. Get-Acl cannot recursively return all the permissions of folders in the hierarchy. The example below gets the permissions set on the C:\temp folder and all the available properties. The PowerShell Get-Acl cmdlet can be used to return permissions on objects like files, folders, and registry keys. How to use Get-Acl cmdlet to Get an NTFS Permissions Report
