Solved

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

Posted on 2013-07-01
1
485 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 40

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

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

751 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