Jump to content

Recommended Posts

Posted (edited)

Hi guys

we have around 1000 deleted students on our system (Deleted from AD) however their home folders still exist

 

Now we have 3 different fileshares where these students home files are located

 

and unfortunately since their AD account is deleted we have no where of finding out where there home folders are located unless we manually check all the fileshares

 

What im trying to do or accomplish is possibly look for a script or something where i have student numbers on a CSV file and try and query which fileshares these folders belong too which will do it for us

 

Essentially what i am trying to achieve is move all those folders from into another folder but we have around 1000 students so looking for something less time consuming :D

 

 

any one got any suggestions or ideas?

 

Thanks

Edited by error404
Posted (edited)

Assuming the share still exists and depending exactly how tidy you want to be, you could do a brute force move of \\server1\username$ to \\newserver\archives\username

 

66% of the moves would silently fail, but it would achieve your aim of moving all the data to the target.

 

Excel will do this for you.

 

Username,formula

123456,HERE

987654,HERE

 

Replace HERE with the following (copied down to all rows):

 

=concatenate("move \\server1\", b1, "$ \\newserver\archives\", b1)

 

Which will give you:

 

move \\server1\123456$ \\newserver\archives\123456

move \\server1\987654$ \\newserver\archives\987654

 

Then highlight the formula column and copy/paste it into a CMD on whichever PC you want it to run on.

 

Then repeat for server2 and server3.

 

Peter

Edited by howartp
  • Thanks 1
Posted

Thanks! That Worked

 

I ran this from a Windows 7 Box

 

Actually the MV didnt work so i used

 

"Move" Instead

 

and Had to remove the $ from the Statement

 

so it looked like this

 

move \\fileshare\Users\studentnumber \\fileshare\Users\Deleted\studentnumber

 

Then i simply ran the script 3 times changing the fileshares each time

 

We had over 5000 students so doing it the Excel method worked a treat :D

 

Was considering using UMRA to do this but took too long to figure out

Posted
We had over 5000 students so doing it the Excel method worked a treat :D

I use Excel as a swiss army knife for stuff like this. It's far more than just a spreadsheet programme if you know how to use it.

 

I corrected 'mv' in an edit, but you obviously used the email alert with the old version in.

 

Peter

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