Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-07-01
1
Medium Priority
?
499 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 41

Accepted Solution

by:
footech earned 2000 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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
Group policies can be applied selectively to specific devices with the help of groups. Utilising this, it is possible to phase-in group policies, over a period of time, by randomly adding non-members user or computers at a set interval, to a group f…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
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…

661 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