Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

copy profile to network share

Posted on 2006-05-26
5
Medium Priority
?
606 Views
Last Modified: 2012-08-13
I am migrating my users to new computers (50+ users) and I would like them to run a batch file that will copy their user profile to their home directory (P:).  Below are the contents of my batch file, which removes temporary internet files and then copies the rest to the P:\profile directory.  

rd "C:\Documents and Settings\%username%\Local Settings\Temporary Internet Files" /s /q
xcopy "C:\Documents and Settings\%username%" p:\profile\ /E /I /H /O /Y /C



This works fine as an administrator, or if I do these items by hand as a user these work, but running via the batch file it does not work.  I get an access denied, can't create p:\profile, and then can't find *.*

Any help would be great.
Thanks,
Glenn


0
Comment
Question by:glennjbrown
5 Comments
 
LVL 13

Accepted Solution

by:
prashsax earned 500 total points
ID: 16769431
first of all make sure P:\Profile have share permissions and NTFS permissions set correctly.

Check that NTFS permissions is set to Domain users Read/Write/Modify.

Since you can do it with administrator, NTFS permissions could be the only thing stopping it from happening.
0
 

Author Comment

by:glennjbrown
ID: 16769483
This is the users home directory, and through windows they can do any tasks within the P:\ drive (R,W,X,D)

Thanks,
Glenn
0
 
LVL 3

Expert Comment

by:JJT2750
ID: 16769640
While you are logged in as administrator can you copy their profiles to a share that they can move them into their home drive from?  While the user is logged in the profile is being used and locked files can't be copied or moved.
0
 
LVL 1

Expert Comment

by:matt_ward
ID: 16769933
You could setup a share with owner creator rights on your server.

Then change all the users accounts to be roaming accounts and set it to upload the users profiles to the profile share. Next time they log off it will do it automatically.

Exclude the Temporay internet files folder from within the local machine policy cause you dont need to upload that really.
0
 
LVL 13

Expert Comment

by:prashsax
ID: 16769950
Yes, files will be locked if user is logged on.

What you can do it to make a computer startup script.

This script will run with system rights, and can copy all the profiles to any network folder.

only problem is that username variable will not be set at this time.


You can use this command to extract the username from the folder list

dir /b | find /v "Administrator" | find /v "All Users" > profilename.txt

This will copy the names of all the user profiles in profilename.txt file.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
#Citrix #POC #XenDesktop #vCenter #VMware #ESX
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Suggested Courses

578 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