Solved

Shutdown script copy files if IP address range is in office

Posted on 2009-07-14
3
851 Views
Last Modified: 2012-06-27
Hi Experts,

We have some laptop users and we really do not want to use the Windows Sync function. Seemed to have issues with that so want to make something a bit more custom.. The users Mydocuments folder is stored on their local laptop - we want to take a copy (where changes have happened) but only if the are in the office.

When they are in the office their IP address will be either 192.168.50.X 192.168.51.X or 192.168.52.X. - X obviously will change between .1 - .254

I want to add a little script to the shutdown in group policy which does the following.

1. Check the IP address of the machine, this could be "Local Area Connection" or "Wireless Network Connection"

2. If the IP is within these ranges then I want to say: copy all files from %UserProfile%\My Documents to M:\backup\MyDocuments

3. Copy %UserProfile%\Application Data\Microsoft\Outlook\ *.NK2 and *.pst files to M:\backup\mailarchive\

If the machine IP address is not in the range its safe to presume they are not in office and just let the script die.

When it copies the files it should only copy files which are new or have chaged rather than copying over everything.

Ideally I would like to show some type of popup saying "backing up files now" while the process is running, so that the users know its doing something.

Wow, this quite a task now I write it out, I started looking at how to get the IP address...There seems to be a bit of debate here:
http://www.tek-tips.com/viewthread.cfm?qid=1435334&page=1
http://www.experts-exchange.com/Operating_Systems/MSDOS/Q_21335206.html

Please could someone help get me started here

Many thanks

Rob






 
0
Comment
Question by:arundelr
  • 2
3 Comments
 
LVL 25

Expert Comment

by:Ron Malmstead
ID: 24853775
you should configure Active Directory SItes-and-services, add the local subnet...
Then link your GPO to the Site....instead of the OU.

If the computer is not in the site/subnet...it won't run the GPO that contains the script.

http://technet.microsoft.com/en-us/library/cc731907.aspx
0
 

Author Comment

by:arundelr
ID: 24856951
Hi,

thanks for the fast reply, it's a great suggestion but the thing is that the systems on this site are a mix of laptops and desktops, I only want to setup the script on the laptops.. The laptops are in a seperate OU, I plan to setup the GP only on these laptops
0
 
LVL 25

Accepted Solution

by:
Ron Malmstead earned 500 total points
ID: 24860129
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

765 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