Change folder perms using powershell

I'm trying to use the Get-Acl and Set-Acl commands to set perms on a folder..

For example I have a folder with where users do not have modify rights:

D:\Program Files (x86)\bogusfolder  

I have C:\Program Files (x86)\bogusfolder where users have modify rights so I have run:

Get-Acl -path "C:\Program Files (x86)\bogusfolder" | Set-Acl -path "D:\Program Files (x86)\bogusfolder"

However, I keep getting "The security identifier is not allowed to be the owner of this object"

Google yields quite a few hits on this topic but they are all ancient from PS 1.0 etc.. is there a new and better way of doing this simply without delving into .net etc...
LVL 2
seanabAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Joseph MoodyBlogger and wearer of all hats.Commented:
How exactly are you doing it? This is how I set permissions with PowerShell.
  $Basepath = "\\SERVER\SHARE\folder"
  $ACL = Get-Acl "$BasePath\$($_.LastName)-$($_.FirstName[0])"
  $permission = "DOMAINNAME\GROUP NAME","FullControl","Allow"
  $accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $permission
  $acl.SetAccessRule($accessRule)
  $acl | Set-Acl "$BasePath\)" 

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
seanabAuthor Commented:
I think that is close to what I am looking for.  Essentially what I have is a folder that I need to give the User group modify rights to.  That is all I need to do.
0
seanabAuthor Commented:
I found the solution by using UNC paths instead and that seemed to do the trick.
0
seanabAuthor Commented:
That works in addition to using unc paths as opposed to drive letter paths.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.