Jump to content

Unshare/delete multiple home folders


Recommended Posts

Posted

Hi,

 

I currently have a large number of users to be deleted, all with home folders on various servers. The issue is, when the ID's are deleted from AD, the home folders have to be unshared and removed manually.

 

At the moment, the only solution is to do a dump of the home drive locations (using the Hyena application), connect to each server through "Computer Management", unshare the home drive, and manually delete the folder.

 

Is there any tool that can do this, or any other way to automate this process?

 

Cheers.

Posted
Well you can remove the share remotely using "net share sharename \\computername" so if you have a list of usernames to delete you could use excel with the command to unshare it and then delete it
Posted

Nice little script...

 

REM Script to de-share all sub-folders within a folder

REM Use when deleting a student year group

 

REM Set folder before use!!

 

FOR /D %%I IN (F:\USERDATA\STUDATA\HDRIVES\2009\*) DO NET SHARE %%~nI$ /DELETE

 

REM Follow up with RMDIR /S F:\USERDATA\STUDATA\HDRIVES\2009

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...