Solved

Remove user rights from a shared folder using powershell

Posted on 2011-09-30
4
464 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 69

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 69

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

828 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