No announcement yet.

Delete users plus homdir and share

  • Filter
  • Time
  • Show
Clear All
new posts

  • Delete users plus homdir and share

    I have approximately 4500 users to delete and want to simultaneously want to remove the associated homdir and remove the share from the server....HELP please...I am puzzled by the cmd switches

  • #2
    Re: Delete users plus homdir and share

    You can create a post-user batch procedure to do this for you. You will need rmtshare.exe from the Windows NT Resource Kit to remove the share.

    You will create the batch file and name it something like c:\share.bat. Then go to Tools->Settings->User and enter c:\share.bat in the Batch file to run for all user changes box.

    Your batch file will look something like:

    @echo on
    if %1 == ADD goto ADD
    if %1 == MODIFY goto MODIFY
    if %1 == DEL goto DEL
    goto END

    rmtshare \\%5\%6 /DELETE
    rd \\%5\E$\users\%3
    goto END

    goto END

    goto END


    After you have this in place, when you delete a user it will run this batch file and remove the share and the directory.

    [This message has been edited by cmccullough (edited 04-24-2001).]