LKBEN10574: Schedule automatic export of Active Directory structure and objects with AT job and csvde


This article has not been checked!

LKB | Created: 02/04/2020 | Version: 1 | Language: EN | Rating: 0 | Outdated: False | Marked for deletion: False

Author: Wim Peeters - Keskon GmbH & Co. KG

Latest update: 05/10/2020 | Comment:


Symptom

You want an export from your AD.

Cause

none

Solution

With AT you can schedule automatic jobs. To export AD you can use the following code and save it as a cmd file.

at 20:30 /every:Mo c:windowssystem32cmd.exe /c csvde -m -f c:AD-exportAD-export-Montag.csv
at 20:30 /every:Di c:windowssystem32cmd.exe /c csvde -m -f c:AD-exportAD-export-Dienstag.csv
at 20:30 /every:Mi c:windowssystem32cmd.exe /c csvde -m -f c:AD-exportAD-export-Mittwoch.csv
at 20:30 /every:Do c:windowssystem32cmd.exe /c csvde -m -f c:AD-exportAD-export-Donnerstag.csv
at 20:30 /every:Fr c:windowssystem32cmd.exe /c csvde -m -f c:AD-exportAD-export-Freitag.csv
at 20:30 /every:Sa c:windowssystem32cmd.exe /c csvde -m -f c:AD-exportAD-export-Samstag.csv
at 20:30 /every:So c:windowssystem32cmd.exe /c csvde -m -f c:AD-exportAD-export-Sontag.csv

Save it as CMD and execute it. You can than check for execution, it should look like:

Statuskenn. Tag                     Zeit          Befehlszeile
-------------------------------------------------------------------------------
        1   Jeden Mo                20:30         c:windowssystem32cmd.exe /c csvde -m -f c:AD-exportAD-export-Montag.csv
        2   Jeden Di                20:30         c:windowssystem32cmd.exe /c csvde -m -f c:AD-exportAD-export-Dienstag.csv
        3   Jeden Mi                20:30         c:windowssystem32cmd.exe /c csvde -m -f c:AD-exportAD-export-Mittwoch.csv
        4   Jeden Do                20:30         c:windowssystem32cmd.exe /c csvde -m -f c:AD-exportAD-export-Donnerstag.csv
        5   Jeden Fr                20:30         c:windowssystem32cmd.exe /c csvde -m -f c:AD-exportAD-export-Freitag.csv
        6   Jeden Sa                20:30         c:windowssystem32cmd.exe /c csvde -m -f c:AD-exportAD-export-Samstag.csv
        7   Jeden So                20:30         c:windowssystem32cmd.exe /c csvde -m -f c:AD-exportAD-export-Sontag.csv

 

About the Author

Wim Peeters is electronics engineer with an additional master in IT and over 30 years of experience including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux in different European countries and different European languages. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform where he is one of the most important contributors and the main developer.

Disclaimer:

The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!