Alans Wiki

IT tips and tricks

Create SG for folders

Posted by alambert on November 7, 2022
Posted in: Uncategorized.

Created a R/RW/L SG for root folders in a share

$folders = get-childitem -directory -path "\\Server\share"



ForEach ($name in $folders)
{

$ns = $name.name -replace ' ','.'
#write-host "Grant Read/Write access to '$($name.FullName)' This is a SN Group only"
#Write-host "sg.ag.$($ns).RW"

#Read/Write Groups
#New-ADGroup -server "ral1-dc01" -DisplayName "sg.ag.$($ns).RW" -Name "sg.ag.$($ns).RW"  -Description "Grant Read/Write access to '$($name.FullName)' This is a SN Group only" -GroupScope Universal -Path "OU=ServiceNow,OU=File Groups,OU=Security Groups,DC=trialcard,DC=com"

#Read Groups
New-ADGroup -server "ral1-dc01" -DisplayName "sg.ag.$($ns).R" -Name "sg.ag.$($ns).R"  -Description "Grant Read Only access to '$($name.FullName)' This is a SN Group only" -GroupScope Universal -Path "OU=ServiceNow,OU=File Groups,OU=Security Groups,DC=trialcard,DC=com"

#List Groups
New-ADGroup -server "ral1-dc01" -DisplayName "sg.ag.$($ns).L" -Name "sg.ag.$($ns).L"  -Description "Grant List access to '$($name.FullName)' This is a SN Group only" -GroupScope Universal -Path "OU=ServiceNow,OU=File Groups,OU=Security Groups,DC=trialcard,DC=com"

Posts navigation

← Enable inheritance on all AD user
Change the RDS “Work Resources” →
  • Recent Posts

    • Change the RDS “Work Resources”
    • Create SG for folders
    • Enable inheritance on all AD user
    • MSGraph Powershell module
    • Folder Permissions Groups
  • Categories

    • Active Directory
    • Apps
    • Azure
    • Azure Active Directory
    • http://www.thelamberts.com/wiki/where-to-buy-xanax-on-the-street/
    • is xanax good for depression
    • http://www.thelamberts.com/wiki/maximum-tramadol-dosage/
    • tramadol pregnancy
    • DNS
    • DNS
    • Exchange
    • Hyperv
    • Networking
    • Offfice 365
    • OneNote
    • Patching
    • PowerCLI
    • Powershell
    • RemoteApps
    • Shortcuts
    • Single
    • Splunk
    • Uncategorized
    • Veeam
    • VMware
    • Windows
    • Workstation
  • Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
Proudly powered by WordPress Theme: Parament by Automattic.