Options

group policy question

nelnel Member Posts: 2,859 ■□□□□□□□□□
heres the deal....

i need to put a file upon every users desktop. we have a 2000 native system with xp clients. all the clients do not use roaming profiles so i cannot simply put the file in the appropriate profile.
ive had a look in group policy but cant seem to come across anything.

does any1 have any ideas about placing the file on the desktops?

i was thinkin maybe a batch file but i need to ensure it is completed on everyones desktop and obviously the batch file could not tell me iff it had or not.

any help would be great.

thanks in advance
Xbox Live: Bring It On

Bsc (hons) Network Computing - 1st Class
WIP: Msc advanced networking

Comments

  • Options
    woodwormwoodworm Member Posts: 153
    Copy it over with a startup script?

    I'm not too good at scripting ... icon_redface.gif But this would check to see if the newfile.txt exists, if it doesn't it will copy it over and then write the name of the PC to "hostname.txt"


    if not exist "%allusersprofile%\desktop\newfile.txt" goto newfile
    exit

    :newfile
    copy c:\new\newfile.txt "%allusersprofile%\desktop\newfile.txt"
    hostname >> \\server1\share\hostname.txt


    This would need to be a startup script in GPO rather than a logon script as users do not have write access to the 'All Users' profile.
  • Options
    sprkymrksprkymrk Member Posts: 4,884 ■■■□□□□□□□
    woodworm wrote:
    Copy it over with a startup script?

    I'm not too good at scripting ... icon_redface.gif But this would check to see if the newfile.txt exists, if it doesn't it will copy it over and then write the name of the PC to "hostname.txt"


    if not exist "%allusersprofile%\desktop\newfile.txt" goto newfile
    exit

    :newfile
    copy c:\new\newfile.txt "%allusersprofile%\desktop\newfile.txt"
    hostname >> \\server1\share\hostname.txt



    This would need to be a startup script in GPO rather than a logon script as users do not have write access to the 'All Users' profile.

    This is on the right track, but there may be a couple of problems. First of all it depends on what he wants the users to do with the file. By copying it to the "All Users" desktop, they cannot modify the file. This might be a good thing, but then again maybe not.

    Second, it will log the computer name regardless of whether the file copy was successful or not.

    Third, by running it as a startup script it actually could not copy the log to a network share.

    I think a better idea would be to run it as a login script to copy it to the users own desktop, rather than the "All Users" desktop. Then on a network share accessable to users (I like to use a hidden share and just give users "write" access, but not read) you can log the results. So it would look something like this:

    IF NOT EXIST %USERPROFILE%\DESKTOP\NEWFILE.TXT GOTO NEWFILE
    GOTO END

    :NEWFILE
    COPY \\SERVER1\SHARE$\NEWFILE.TXT %USERPROFILE%\DESKTOP && ECHO FILE COPIED TO %COMPUTERNAME% FOR USER %USERNAME% >> \\SERVER1\SHARE$\FILECOPY.LOG

    :END


    Note that the line starting with COPY below :NEWFILE is all one contiuous line, I see that it was too long and wrapped. Make sure to keep it all on one line in the batch file. The "&&" makes the echo statement conditional on whether the file copy was successful, it will not log the computer name if the file copy fails.
    All things are possible, only believe.
  • Options
    woodwormwoodworm Member Posts: 153
    sprkymrk wrote:
    This is on the right track, but there may be a couple of problems. First of all it depends on what he wants the users to do with the file. By copying it to the "All Users" desktop, they cannot modify the file. This might be a good thing, but then again maybe not.

    Second, it will log the computer name regardless of whether the file copy was successful or not.

    Third, by running it as a startup script it actually could not copy the log to a network share.

    I think a better idea would be to run it as a login script to copy it to the users own desktop, rather than the "All Users" desktop. Then on a network share accessable to users (I like to use a hidden share and just give users "write" access, but not read) you can log the results. So it would look something like this:

    IF NOT EXIST %USERPROFILE%\DESKTOP\NEWFILE.TXT GOTO NEWFILE
    GOTO END

    :NEWFILE
    COPY \\SERVER1\SHARE$\NEWFILE.TXT %USERPROFILE%\DESKTOP && ECHO FILE COPIED TO %COMPUTERNAME% FOR USER %USERNAME% >> \\SERVER1\SHARE$\FILECOPY.LOG

    :END


    Note that the line starting with COPY below :NEWFILE is all one contiuous line, I see that it was too long and wrapped. Make sure to keep it all on one line in the batch file. The "&&" makes the echo statement conditional on whether the file copy was successful, it will not log the computer name if the file copy fails.

    That's much nicer! Originally I did copy it to the current users desktop and I tested this and it seemed ok, then changed my mind to make it all users ... anyway, I learnt something there - thanks :D
  • Options
    nelnel Member Posts: 2,859 ■□□□□□□□□□
    hey.

    thanks theres some good ideas there. basically the file that will be copied to the desktop is just a a shortcut to a intranet site within the company. i know i could put it in the users favourites in IE through group policy but i want it available upon the users desktops so i can specifically say it is directly there in front of you as you login, because lets face it i dont wanna make it to hard for them by makin them goto their favourites because i know a large majority will not know how to do so!

    so do you think this would be the best route?
    Xbox Live: Bring It On

    Bsc (hons) Network Computing - 1st Class
    WIP: Msc advanced networking
  • Options
    sprkymrksprkymrk Member Posts: 4,884 ■■■□□□□□□□
    You'll just have to test it. I would stick with the user's desktop (vs all users) so that if a user could care less he can delete it. Some folks like a clean desktop, and these same folks will know how to bookmark the site.

    The caveat here is that you are copying a shortcut. I have found that these can be problematic due to the file extesion being an ".lnk". If the file extension is ".url" it might work okay. Just test it out by running the batch file manually from a couple of workstations before adding it to the login script. Also, one more thing I noticed. Let's say you run this in the login script and it gets copied to everyone's desktop. Joe Blow doesn't like it on his desktop, so he adds it to his favorites and deletes it from his desktop. The next time he logs on, bam, there it is again! Just something to keep in mind. You could pop it in the login script for a day or two and then REM it out or remove it. Actually, rather than modify the default login script completely with this, just create a seperate batch file called "filecopy.bat" or something and save it in the same location as the login script. Then just add a single line to your login script like this:

    CALL FILECOPY.BAT

    Then after running it for a day or two and you're sure most everyone has it, you can just remove that line from your login script and keep the filecopy.bat for future reference. Or just REM it out so your login script ignores it:

    REM CALL FILECOPY.BAT
    All things are possible, only believe.
  • Options
    strauchrstrauchr Member Posts: 528 ■■■□□□□□□□
    nel wrote:
    hey.

    thanks theres some good ideas there. basically the file that will be copied to the desktop is just a a shortcut to a intranet site within the company. i know i could put it in the users favourites in IE through group policy but i want it available upon the users desktops so i can specifically say it is directly there in front of you as you login, because lets face it i dont wanna make it to hard for them by makin them goto their favourites because i know a large majority will not know how to do so!

    so do you think this would be the best route?

    You could use group policy to set it as users home page in Internet Explorer. That is a common configuration in many companies.

    While this scripting was a good lesson I feel it is overkill just to put an link on a desktop.

    You could also build the link into a your desktop images into All Users profile.
  • Options
    hanakuinhanakuin Member Posts: 144
    We deploy several shortcuts to users desktops here; it's nice having limited security on the deployed files so users can't make changes to them. But for an intranet site we make it their homepage; the only thing more obvious than adding "another" shortcut to their desktop is to make them stare at the site every time that they start IE.
Sign In or Register to comment.