Wireless Networks Thread, Copy file to Homeshare for certain OU's in Technical; I am wanting to copy an excel file to each user in a certain OU.
I tried using a logon ...
6th July 2010, 11:33 AM #1
Copy file to Homeshare for certain OU's
I am wanting to copy an excel file to each user in a certain OU.
I tried using a logon batch file for the specific user OU that would do an IF NOT EXIST then copy the file to their H drives.
It didnt work and I have a feeling that its either the H drive is mapped after this logon bat file has run, or when I changed the bat file it cannot read the %username% variable as the correct person.
Anyone got any ideas?
IDG Tech News
6th July 2010, 11:45 AM #2
get it to write some logging info:
- this should create a log file in the user's temp folder (so check it before they log off otherwise the log will be deleted!) and might help you to see what's going on.
echo starting >%temp%\excelcopy.log
time /t >> %temp%\excelcopy.log
if exist h:\ echo H drive OK >> %temp%\excelcopy.log
if exist h:\project.xls goto copied
echo about to copy file >> %temp%\excelcopy.log
copy \\server\share\project.xls h:\
echo copied file >> %temp%\excelcopy.log
echo finishing off
time /t %temp%\excelcopy.log
6th July 2010, 11:56 AM #3
No error checking or logs that srochford put in, this however doesn't use the H: drive letter.
Maybe you can mash the two together.
6th July 2010, 12:02 PM #4
The error checking doesnt seem to be working at all and doesnt create the log.
What user does the logon script run as? The user logging on or system?
6th July 2010, 12:09 PM #5
A logon script is run as the interactive user.
6th July 2010, 12:13 PM #6
At this point I'd go back to basics to work out what's happening.
Just put in a login script that creates a file in the users home directory, see if that is working first.
As this is group policy, I'd also check the policy link is enabled and that the user settings aren't disabled.
You could add the setting that runs the logon script visibly so that you can watch what is happening.
6th July 2010, 12:14 PM #7
Hmmm I'm obviously doing something very silly then!!
Just trying to implement the InContainer Kix UDF to see if that makes things easier.
As you also say... will try some basic stuff
6th July 2010, 12:54 PM #8
Used the Incontainer and TranslateName Kix UDF to check the OU and then added a line to copy the file if in correct OU... AFTER the homeshare was mapped
Thanks everyone for your help
By spider6986 in forum Windows
Last Post: 8th February 2010, 05:15 PM
By itgeek in forum Scripts
Last Post: 1st December 2009, 03:38 PM
By SimpleSi in forum *nix
Last Post: 10th March 2009, 07:15 PM
By kerrymoralee9280 in forum How do you do....it?
Last Post: 7th March 2008, 01:19 PM
By tosca925 in forum Scripts
Last Post: 23rd March 2006, 07:27 AM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)