Solved

powershell to add AD GROUP to folder security with full control right

Posted on 2013-07-01
1
479 Views
Last Modified: 2013-07-03
hi,

i have a list of server in txt file like this:

server1
server2
....

i need to add security right on all this server on the same folder, the folder is c:\test\temp

i nee to add the conttrol total right for GROUP1, this group is an active directory group.

thanks for help
0
Comment
Question by:cawasaki
1 Comment
 
LVL 39

Accepted Solution

by:
footech earned 500 total points
ID: 39290507
Using PowerShell Remoting would be the best way, but I'm not sure about the OS of your target servers.  Managing security via PS is a pain in my opinion.  I prefer to combine some PS code with a utility like icacls.exe which is much easier to work with.
$scriptblock = { icacls "C:\temp\test" /grant "domain\group":F(OI)(CI) }
$servers = Get-Content servers.txt
Invoke-Command -computername $servers -scriptblock $scriptblock

Open in new window

0

Join & Write a Comment

Resolve DNS query failed errors for Exchange
Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now