Jump to content

Recommended Posts

Posted

Hi,

 

When a student leaves we move their user account in AD to an OU called "Leavers", and then delete their profiles and homes. The profile location is in \\server\a-dProfiles$\username and the home location is \\server\a-dHomes$\username

 

We want to continue moving leavers accounts to the OU, but once they are moved we want to move their profile and home to another location, for example, \\server\leaverProfiles$\username and \\server\leaverHomes$\username this is in case they return in the future and we can then just move their profile and home back.

 

Is there a way of scripting the movement of the profile and home folders when their accounts are moved into the Leavers OU?

 

Regards,

 

Net-Eng

Posted (edited)

Hi,

 

Havnt done this myself but something i will be doing in the future.

 

The way im probably going to do it is using a batch file with a for loop.

 

 

 

@echo off

for %%T in (
User1
User2

) do (
robocopy [i]Path to home d[/i]\%%T [i]Path to destination[/i]\%%T /MIR /R:2 /W:5

)

 

Just need to add the names to the list, one per line.

And then find the right command to delete from the AD. Think you do this with the dsrm command.

Edited by dany2010
Posted
Thanks for this, I will give it a go. Although I could do with a way to automate the list, or just delete profiles for the users in the specific OU - is this possible? With your method I would have to type/paste usernames in to the list wouldn't I?

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...