?
Solved

Remove user rights from a shared folder using powershell

Posted on 2011-09-30
4
Medium Priority
?
467 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 1000 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

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.
In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

764 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