+ Post New Thread
Results 1 to 8 of 8
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 ...
  1. #1

    Join Date
    Dec 2005
    Posts
    542
    Thank Post
    38
    Thanked 89 Times in 79 Posts
    Rep Power
    39

    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?

  2. #2

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,157
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124
    get it to write some logging info:
    Code:
    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
    :copied
    echo finishing off
    time /t %temp%\excelcopy.log
    - 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.

  3. #3
    TheLibrarian
    Guest
    Code:
    for /f %%i in ( 'dsquery user -samid %username% ^| dsget user -hmdir ^| findstr /i /c:"\\"') do (
    if not exist %%i\filename.ext copy \\servername\sharename\filename.ext %%i
    )
    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.

  4. #4

    Join Date
    Dec 2005
    Posts
    542
    Thank Post
    38
    Thanked 89 Times in 79 Posts
    Rep Power
    39
    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?

  5. #5
    TheLibrarian
    Guest
    A logon script is run as the interactive user.

  6. #6
    TheLibrarian
    Guest
    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.

  7. #7

    Join Date
    Dec 2005
    Posts
    542
    Thank Post
    38
    Thanked 89 Times in 79 Posts
    Rep Power
    39
    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

  8. #8

    Join Date
    Dec 2005
    Posts
    542
    Thank Post
    38
    Thanked 89 Times in 79 Posts
    Rep Power
    39
    Sorted now...

    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

SHARE:
+ Post New Thread

Similar Threads

  1. Copy Batch file
    By spider6986 in forum Windows
    Replies: 10
    Last Post: 8th February 2010, 04:15 PM
  2. Copy New file from A to B
    By itgeek in forum Scripts
    Replies: 11
    Last Post: 1st December 2009, 02:38 PM
  3. Copy file across variable folder name
    By SimpleSi in forum *nix
    Replies: 11
    Last Post: 10th March 2009, 06:15 PM
  4. File copy tool
    By kerrymoralee9280 in forum How do you do....it?
    Replies: 5
    Last Post: 7th March 2008, 12:19 PM
  5. Replies: 4
    Last Post: 23rd March 2006, 06:27 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •