Solved

Remove user rights from a shared folder using powershell

Posted on 2011-09-30
4
460 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
  • 2
  • 2
4 Comments
 
LVL 68

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 68

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article will help you understand what HashTables are and how to use them in PowerShell.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 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

18 Experts available now in Live!

Get 1:1 Help Now