Powershell Script to Share a Folder, Set NTFS and Share Permissions and Make it a Virtual Directory in IIS
I am looking to create a share, set NTFS and Share Permissions and then make it a Virtual Directory in IIS.
This is something I repetitively do with my job, but all by hand.
Here are the current permissions:
c:\program files\landesk\managementsuite\ldlogon
FRM-EPMCORE-01\LANDesk Management Suite:(RX)
FRM-EPMCORE-01\LANDesk Management Suite:(OI)(CI)(IO)(GR,GE)
FRM-EPMCORE-01\LANDesk Administrators:(OI)(CI)(F)
BUILTIN\Administrators:(OI)(CI)(F)
NT AUTHORITY\SYSTEM:(OI)(CI)(F)
NT AUTHORITY\IUSR:(RX)
NT AUTHORITY\IUSR:(OI)(CI)(IO)(GR,GE)
Everyone:(RX)
Everyone:(OI)(CI)(IO)(GR,GE)
NT AUTHORITY\NETWORK SERVICE:(OI)(CI)(F)
I want the share permissions to be the same as the NTFS permissions.
So to clarify, I want to do the following:
- Create a Share (We'll call it Distribution) pointing to C:\Distribution
- Set Share Permissions and NTFS permissions as shown above
- Create a Virtual Directory in IIS named "Distribution" pointing to C:\Distribution
Huge thanks in advance to the guru that knows how to do this!