Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to delete everyone's Offline Address Book in the domain 1

Status
Not open for further replies.

DSPG

MIS
May 2, 2008
9
0
0
US
Hi everyone,

We're going through a messy domain migration, and it's not going well. One thing I've been tasked to do is create a process that deletes everyones OAB one time. Some have suggested adding something to the login script, but I don't know how to make that happen only one time. I can create a script that deletes the files, but how do I delete them once for everybody in the domain?

Chris
 
1 way I have found to do something once is to look for a flag that is created the 1st time it is done.

I used VBScript to do that tho.
I looked if a file existed on the target computer,
then if it wasn't there I would do whatever needed to be done and after I created an empty file on the target computer,

So the next time it would look for the file, and since it would be there, it would skip that part.

If you want me to send you parts of the code, let me know.

I guess you could also use a WMI filter to look at the date of creation of the file and delete it if it's older then <date> but I'm not good enough with WMI to help there, but I think I remember seeing loginscripts with WMI filters.

An other way would be to use the runonce, it could be added to the computers via GPO.

only a few things to think about...
Goodluck!
 
Thanks for your help. I took your suggestion and came up with the following batch script:

@echo off
:CHECK
if exist "C:\Documents and Settings\%username%\Local Settings\Application Data\Microsoft\Outlook\fixed.txt" goto DONE

:FIX
C:
CD\Documents and Settings\%username%\Local Settings\Application Data\Microsoft\Outlook
MD Backup
Copy *.oab Backup
DEL *.oab
echo %date% %time% > fixed.txt

:DONE

I added this to our existing login script and it works perfectly. I decided to backup the OAB files before deleting them in case of a disaster. I also thought about going the GPO route, but this seemed simpler to implement (corporate politics, ya know). Anyway, I hope this helps someone else out in the future.

Again, thanks for your help.

DSPG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top