Solved

Remove user rights from a shared folder using powershell

Posted on 2011-09-30
4
466 Views
Last Modified: 2012-05-12
I need to remove a specific user from a network share. Alot of these users are sids or orphans from AD. I want to use powershell to do it.  Can someone setup the code as to what commands I need to do this with?
0
Comment
Question by:SOSNet
[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
  • 2
  • 2
4 Comments
 
LVL 70

Accepted Solution

by:
Qlemo earned 500 total points
ID: 36899545
If you look at http://powershell.com/cs/media/p/2535.aspx, you will see that it is rather complicated to do that (shown by creating a share with setting the permission). You really do not want to rely on ready-to-use tools like subinacls (and (x)cacls) for that purpose?
0
 

Author Comment

by:SOSNet
ID: 36903104
Thank you! I will look at that.  I am trying to remove the old user (old SIDs), from the shares, is what I am trying to accomplish.  I can de-inherit them but cannot get rid of the orphens (Sids) using powershell.  
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 36903139
As shown in that code it isn't easy, so I would not spend much time with solving in PowerShell just for this single purpose. It is different if you use it to learn more about PowerShell, and have similar tasks to accomplish, of course.
0
 

Author Closing Comment

by:SOSNet
ID: 36981291
It works in powrshell 2 but errors in PS1.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…

728 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