Symantec IGA

 View Only
Expand all | Collapse all

How to automate a daily backup of the IME and directory.xml files

  • 1.  How to automate a daily backup of the IME and directory.xml files

    Posted Jun 01, 2012 10:02 AM
    Hello All,

    You may find this process of use, especially when managing deltas and updates between environments & DAR.
    I find it very useful to manage PX rule updates.

    These processes require use of the open source tool, curl, to exercise the URLs and IM Forms of the IM Management Console.
    You will need to determine your OID values; which are assigned upon creation event within the IM Management Console.
    If you have not created many environments or directories, your numbers are likely low, otherwise you may see value of 10+.
    The OID may be viewed in the IM Management Console, when you select the entries. Just view the URL header to capture the correct values.


    Below are two (2) examples

    1) an example for Linux/Unix that can be scheduled with cron.
    2) an example for Win OS that can be schedule with WinScheduler


    **** Script begins here ***
    #!/bin/bash

    #:: Automate daily backup of IME
    #:: SET DATESTAMP / TIMESTAMP
    today=$(date +%Y%m%d_%H%M%S_%N)

    #:: SET IM OBJECTS
    HOST=192.168.181.131:8080
    OID=1
    IME=imwa
    IMCD=idmusers
    IMCD_OID=1
    IMPS=IMPS
    IMPS_OID=2

    export HOST OID IME IMCD IMCD_OID IMPS IMPS_OID today


    echo HOST=$HOST
    echo OID=$OID
    echo IME=$IME
    echo IMCD=$IMCD and IMCD_OID=$IMCD_OID
    echo IMPS=$IMPS and IMPS_OID=$IMPS_OID
    echo today=$today

    rm -f cookies
    #touch ${today}_${IME}_${IMCD}.txt
    #:: Use of open source curl with -o switch to rename output and -c/-b switch to manage the IM Forms of the IM management console
    #:: Export five of five XML configuration files for IM and the zip file for IME

    #:: Store Session Cookies for IM Forms
    curl http://$HOST/iam/immanage/ -c cookies

    #:: Audit Settings
    curl -b cookies "http://$HOST/iam/immanage/env.do?method=listEnvs"
    curl -b cookies "http://$HOST/iam/immanage/env.do?method=editEnv&envoid=$OID"
    curl -b cookies "http://$HOST/iam/immanage/envsettings.do?method=getSettings&envoid=$OID&envname=$IME"
    curl -b cookies "http://$HOST/iam/immanage/audit.do?method=editItem&envname=$IME&envoid=$OID"
    curl -b cookies -o ${today}_${IME}_AuditSettings.xml "http://$HOST/iam/immanage/audit.do?method=exportSettings&envoid=$OID&envname=$IME"

    #:: Environmental Settings (IMCD to IMPD)
    curl -b cookies "http://$HOST/iam/immanage/env.do?method=listEnvs"
    curl -b cookies "http://$HOST/iam/immanage/env.do?method=editEnv&envoid=$OID"
    curl -b cookies -o ${today}_${IME}_EnvironmentSettings.xml "http://$HOST/iam/immanage/envsettings.do?method=exportSettings&envoid=$OID&envname=$IME"

    #:: IME Roles/Tasks/Screens/PX Rules/Identity Policies/Mail/Explore&Correlate Definations
    curl -b cookies "http://$HOST/iam/immanage/env.do?method=listEnvs"
    curl -b cookies "http://$HOST/iam/immanage/env.do?method=editEnv&envoid=$OID"
    curl -b cookies "http://$HOST/iam/immanage/env.do?method=editRoles&envoid=$OID&envname=$IME"
    curl -b cookies -o ${today}_${IME}_RoleDefinitions.xml "http://$HOST/iam/immanage/env.do?method=exportRoles&envoid=$OID&envname=$IME"

    #:: Pull IME zip file
    curl -b cookies "http://$HOST/iam/immanage/env.do?method=listEnvs"
    curl -b cookies -o ${today}_${IME}.zip "http://$HOST/iam/immanage/env.do?method=exportEnv&deleteobjs=,$OID&envoid=$OID&envname=$IME"

    #:: IMCD User Store
    curl -b cookies "http://$HOST/iam/immanage/dir.do?method=listDirs"
    curl -b cookies "http://$HOST/iam/immanage/dir.do?method=editDir&diroid=$IMCD_OID"
    curl -b cookies -o ${today}_${IMCD}.xml "http://$HOST/iam/immanage/dir.do?method=editDir&diroid=$IMCD_OID&dirname=$IMCD"

    #:: IMPS (IMPD) User Store
    #curl -b cookies "http://$HOST/iam/immanage/dir.do?method=listDirs"
    #curl -b cookies "http://$HOST/iam/immanage/dir.do?method=editDir&diroid=$IMPS_OID"
    #curl -b cookies -o ${today}_${IMPS}.xml "http://$HOST/iam/immanage/dir.do?method=exportDir&dirname=$IMPS"


    #:: Remove files older than 60 days; to prevent drive or folder from filling up with files.
    rm -f cookies


    *** Script Ends Here ***

    Win Version:
    *** Script Starts Here ****

    @echo on

    :: Automate daily backup of IME
    :: SET DATESTAMP / TIMESTAMP
    :: *** Set the date string for file naming and archive ***
    for /f "tokens=1,2" %%u in ('date /t') do set d=%%v
    set t=%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2%
    if "%t:~0,1%"==" " set t=0%t:~1%
    set date=%d:~6,4%%d:~0,2%%d:~3,2%_%t%


    :: SET IM OBJECTS
    set HOST=192.168.181.131:8080
    set OID=1
    set IME=imwa
    set IMCD=idmusers
    set IMCD_OID=1
    set IMPS=IMPS
    set IMPS_OID=2

    :: Use of open source curl (windows 32 bit version) with -o switch to rename output and -c/-b switch to manage the IM Forms of the IM management console
    :: Export five of five XML configuration files for IM and the zip files for the IME
    del cookies.txt

    :: Set cookies for IM Forms:
    curl http://%HOST%/iam/immanage/ -c cookies.txt

    :: Audit Settings {Audit File.xml export works on some WinOS.  YMMV.  un-comment as needed}
    curl -b cookies.txt "http://%HOST%/iam/immanage/env.do?method=listEnvs"
    curl -b cookies.txt "http://%HOST%/iam/immanage/env.do?method=editEnv&envoid=%OID%"
    curl -b cookies.txt "http://%HOST%/iam/immanage/envsettings.do?method=getSettings&envoid=%OID%&envname=%IME%"
    curl -b cookies.txt "http://%HOST%/iam/immanage/audit.do?method=editItem&envname=%IME%&envoid=%OID%"
    ::curl -b cookies.txt -o %date%-%IME%-AuditSettings.xml "http://%HOST%/iam/immanage/audit.do?method=exportSettings&envoid=%OID$&envname=%IME%"

    :: Environmental Settings (IMCD to IMPD)
    curl -b cookies.txt "http://%HOST%/iam/immanage/env.do?method=listEnvs"
    curl -b cookies.txt "http://%HOST%/iam/immanage/env.do?method=editEnv&envoid=%OID%"
    curl -b cookies.txt -o %date%-%IME%-EnvironmentSettings.xml "http://%HOST%/iam/immanage/envsettings.do?method=exportSettings&envoid=%OID%&envname=%IME%"

    :: IME Roles/Tasks/Screens/PX Rules/Identity Policies/Mail/Explore&Correlate Definitions
    curl -b cookies.txt "http://%HOST%/iam/immanage/env.do?method=listEnvs"
    curl -b cookies.txt "http://%HOST%/iam/immanage/env.do?method=editEnv&envoid=%OID%"
    curl -b cookies.txt "http://%HOST%/iam/immanage/env.do?method=editRoles&envoid=%OID%&envname=%IME%"
    curl -b cookies.txt -o %date%-%IME%-RoleDefinitions.xml "http://%HOST%/iam/immanage/env.do?method=exportRoles&envoid=%OID%&envname=%IME%"

    :: IME zip files
    curl -b cookies.txt "http://%HOST%/iam/immanage/env.do?method=listEnvs"
    curl -b cookies.txt -o %date%-%IME%.zip "http://%HOST%/iam/immanage/env.do?method=exportEnv&deleteobjs=,%OID%&envoid=%OID%&envname=%IME%"

    :: IMCD
    curl -b cookies.txt "http://%HOST%/iam/immanage/dir.do?method=listDirs"
    curl -b cookies.txt "http://%HOST%/iam/immanage/dir.do?method=editDir&diroid=%IMCD_OID%"
    curl -b cookies.txt -o %date%-%IMCD%.xml "http://%HOST%/iam/immanage/dir.do?method=exportDir&dirname=%IMCD%"

    :: IMPS
    ::curl -b cookies.txt "http://%HOST%/iam/immanage/dir.do?method=listDirs"
    ::curl -b cookies.txt "http://%HOST%/iam/immanage/dir.do?method=editDir&diroid=%IMPS_OID%"
    ::curl -b cookies.txt -o %date%-%IMPS%.xml "http://%HOST%/iam/immanage/dir.do?method=exportDir&dirname=%IMPS%"

    :: Move zip file to archive folder to prevent cleanup process below from removing zip file or extracted xml.

    :: Remove files older than 60 days; to prevent drive from filling up with files.
    ::forfiles /s /m *.xml /d -60 /c "cmd /c del @file"
    ::forfiles /s /m *.zip /d -60 /c "cmd /c del @file"

    del cookies.txt

    ::pause


    *** Script ends here ***





    ***** 8/8/12 UPDATED Linux VERSION FOR IM r12.6 with a password protected IM Management Console *****


    #!/bin/bash

    #:: Automate daily backup of IME
    #:: SET DATESTAMP / TIMESTAMP
    today=$(date +%Y%m%d_%H%M%S_%N)

    #:: SET IM OBJECTS
    HOST=imwa001.im.dom:7001
    IME="CAM Unified User (UU)"
    OID=1
    IMCD="CAM Unified User (UU)"
    IMCD_OID=3
    IMPS="provisioning user store"
    IMPS_OID=2

    #:: IM Management Console authentication (r12.6) (if enabled)
    username=idmembedded
    password=Password01

    #export HOST OID IME IMCD IMCD_OID IMPS IMPS_OID today


    echo HOST=$HOST
    echo OID=$OID
    echo IME=$IME
    echo IMCD=$IMCD and IMCD_OID=$IMCD_OID
    echo IMPS=$IMPS and IMPS_OID=$IMPS_OID
    echo today=$today

    rm -f cookies
    #touch ${today}_${IME}_${IMCD}.txt
    #:: Use of open source curl with -o switch to rename output and -c/-b switch to manage the IM Forms of the
    IM management console
    #:: Export five of five XML configuration files for IM and the zip file for IME
    #:: Use this switch to debug --trace-ascii debugdump.txt
    #:: Use this switch to populate a form --data-urlencode "username=idmembedded"
    #:: Replace spaces with underscores ${variable// /_}

    #:: Store Session Cookies for IM Forms
    curl -c cookies trace-ascii debugdump_auth.txt  data-urlencode "username=$username" --data-urlencode
    "password=$password" "http://$HOST/iam/immanage/" > /dev/null

    #:: Audit Settings
    curl -b cookies "http://$HOST/iam/immanage/env.do?
    method=listEnvs" > /dev/null
    curl -b cookies "http://$HOST/iam/immanage/env.do?
    method=editEnv&envoid=$OID" > /dev/null
    curl -b cookies "http://$HOST/iam/immanage/envsettings.do?
    method=getSettings&envoid=$OID&envname=$IME" > /dev/null
    curl -b cookies "http://$HOST/iam/immanage/audit.do?
    method=editItem&envname=$IME&envoid=$OID" > /dev/null
    curl -b cookies -o "${today}_${IME// /_}_AuditSettings.xml" --trace-ascii debugdump_audit.txt  "http://
    $HOST/iam/immanage/audit.do?method=exportSettings&envoid=$OID&envname=$IME"


    #:: Environmental Settings (IMCD to IMPD)
    curl -b cookies "http://$HOST/iam/immanage/env.do?
    method=listEnvs" > /dev/null
    curl -b cookies "http://$HOST/iam/immanage/env.do?
    method=editEnv&envoid=$OID" > /dev/null
    curl -b cookies -o "${today}_${IME// /_}_EnvironmentSettings.xml" --trace-ascii debugdump_env.txt
    "http://$HOST/iam/immanage/envsettings.do?method=exportSettings&envoid=$OID&envname=$IME"


    #:: IME Roles/Tasks/Screens/PX Rules/Identity Policies/Mail/Explore&Correlate Definitions
    curl -b cookies "http://$HOST/iam/immanage/env.do?
    method=listEnvs" > /dev/null
    curl -b cookies "http://$HOST/iam/immanage/env.do?
    method=editEnv&envoid=$OID" > /dev/null
    curl -b cookies "http://$HOST/iam/immanage/env.do?
    method=editRoles&envoid=$OID&envname=$IME" > /dev/null
    curl -b cookies -o "${today}_${IME// /_}_RoleDefinitions.xml" --trace-ascii debugdump_roledef.txt
    "http://$HOST/iam/immanage/env.do?method=exportRoles&envoid=$OID&envname=$IME"


    #:: Pull IME zip file
    curl -b cookies "http://$HOST/iam/immanage/env.do?
    method=listEnvs" > /dev/null
    curl -b cookies -o "${today}_${IME// /_}.zip" --trace-ascii debugdump_ime.txt "http://
    $HOST/iam/immanage/env.do?method=exportEnv&deleteobjs=,$OID&envoid=$OID&envname=$IME"


    #:: IMCD User Store
    curl -b cookies "http://$HOST/iam/immanage/dir.do?
    method=listDirs" > /dev/null
    curl -b cookies "http://$HOST/iam/immanage/dir.do?
    method=editDir&diroid=$IMCD_OID" > /dev/null
    curl -b cookies -o "${today}_${IMCD// /_}_imcd.xml" --trace-ascii debugdump_imcd.txt "http://
    $HOST/iam/immanage/dir.do?method=editDir&diroid=$IMCD_OID&dirname=$IMCD"


    #:: IMPS (IMPD) User Store
    curl -b cookies "http://$HOST/iam/immanage/dir.do?
    method=listDirs" > /dev/null
    curl -b cookies "http://$HOST/iam/immanage/dir.do?
    method=editDir&diroid=$IMPS_OID" > /dev/null
    curl -b cookies -o "${today}_${IMPS// /_}_imps.xml" --trace-ascii debugdump_imps.txt "http://
    $HOST/iam/immanage/dir.do?method=exportDir&dirname=$IMPS"


    #:: Remove files older than 7 days; to prevent drive from filling up with files.
    #:: Example using find to list or remove files that end with extension xml or zip
    #find ./*.xml *.zip -mtime +7 -exec ls {} \;
    find ./*.xml *.zip -mtime +7 -exec rm {} \;


    #:: Remove cookies and debug files after every session
    rm -rf cookies
    rm -rf debugdump*.txt


  • 2.  RE: How to automate a daily backup of the IME and directory.xml files

     
    Posted Jun 05, 2012 04:04 PM
    Thanks for providing this great information to the community!


  • 3.  RE: How to automate a daily backup of the IME and directory.xml files

    Posted Sep 10, 2013 11:05 AM
    Updated version for IM r12.6sp2. May be executed on any Windows OS or modified for Unix/Linux.

    ****

    Updated the auto-backup version for IM r12.6sp2; had to adjust the cookie creation lines.
    Included the link to the curl version I used on Windows 2008 x64.
    http://curl.haxx.se/gknw.net/7.32.0/dist-w32/curl-7.32.0-ssl-sspi-zlib-static-bin-w32.zip
     
     
    ****
     
    @echo on
    ::Automate daily backup of IME
    :: SET DATESTAMP / TIMESTAMP
    :: *** Set the date string for file naming and archive ***
    for /f "tokens=1,2" %%u in ('date /t') do set d=%%v
    set t=%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2%
    if "%t:~0,1%"==" " set t=0%t:~1%
    set today=%d:~6,4%%d:~0,2%%d:~3,2%_%t%
    :: SET IM OBJECTS
    :: Objects below are assumed to have NO space characters
    set HOST=imps-001.exchange.exc:8080
    set IME=ime
    set OID=1
    set IMCD=imcd
    set IMCD_OID=3
    set IMPS=impd
    set IMPS_OID=2
    :: IM Management Console authentication (r12.6) (if enabled)
    set username=idmembedded
    set password=Password01
    ::export HOST OID IME IMCD IMCD_OID IMPS IMPS_OID today

    echo HOST=%HOST%
    echo OID=%OID%
    echo IME=%IME%
    echo IMCD=%IMCD% and IMCD_OID=%IMCD_OID%
    echo IMPS=%IMPS% and IMPS_OID=%IMPS_OID%
    echo today=%today%
    del /f cookies
    ::echo hi > "%today%_%IME%_%IMCD%.txt"
    :: Use of open source curl with -o switch to rename output and -c/-b switch to manage the IM Forms of the IM management console
    :: Export five of five XML configuration files for IM and the zip file for IME
    :: Use this switch to debug              --trace-ascii debugdump.txt
    :: Use this switch to populate a form    --data-urlencode "username=idmembedded"
    :: Replace spaces with underscores  ${variable// /_}
    :: Store Session Cookies for IM Forms
    ::curl -c cookies trace-ascii debugdump_auth.txt  data-urlencode "username=%username%" --data-urlencode "password=%password%"    http://%HOST%/iam/immanage> nul
    ::pause
    ::exit
    :: Audit Settings
    curl -c cookies   trace-ascii 01_debugdump_audit_listenv.txt  data-urlencode "username=%username%" --data-urlencode "password=%password%"   http://%HOST%/iam/immanage/env.do?method=listEnvs > nul
    curl -b cookies   --trace-ascii 02_debugdump_audit_editenv.txt    "http://%HOST%/iam/immanage/env.do?method=editEnv&envoid=%OID%" > nul
    curl -b cookies   --trace-ascii 03_debugdump_audit_getenv.txt     "http://%HOST%/iam/immanage/envsettings.do?method=getSettings&envoid=%OID%&envname=%IME%"> nul
    curl -b cookies   --trace-ascii 04_debugdump_audit_edititem.txt   "http://%HOST%/iam/immanage/audit.do?method=editItem&envname=%IME%&envoid=%OID%" > nul
    curl -b cookies   -o  %today%_%IME%_AuditSettings.xml   trace-ascii 05_debugdump_audit_export.txt data-urlencode "username=%username%" --data-urlencode "password=%password%"  "http://%HOST%/iam/immanage/audit.do?method=exportSettings&envoid=%OID%&envname=%IME%"

    :: Environmental Settings (IMCD to IMPD)
    curl -c cookies       trace-ascii 05_debugdump_audit_listenv.txt   data-urlencode "username=%username%" --data-urlencode "password=%password%"  "http://%HOST%/iam/immanage/env.do?method=listEnvs" > nul
    curl -b cookies       --trace-ascii 06_debugdump_audit_editenv.txt  "http://%HOST%/iam/immanage/env.do?method=editEnv&envoid=%OID%" > nul
    curl -b cookies -o "%today%_%IME%_EnvironmentSettings.xml"  --trace-ascii 07_debugdump_audit_exportEnvSet.txt  "http://%HOST%/iam/immanage/envsettings.do?method=exportSettings&envoid=%OID%&envname=%IME%"

    :: IME Roles/Tasks/Screens/PX Rules/Identity Policies/Mail/Explore&Correlate Definitions
    curl -c cookies       trace-ascii 08_debugdump_audit_listenv.txt   data-urlencode "username=%username%" --data-urlencode "password=%password%"  "http://%HOST%/iam/immanage/env.do?method=listEnvs"   > nul
    curl -b cookies       --trace-ascii 09_debugdump_audit_editenv.txt   "http://%HOST%/iam/immanage/env.do?method=editEnv&envoid=%OID%" > nul
    curl -b cookies       --trace-ascii 10_debugdump_audit_editRole.txt  "http://%HOST%/iam/immanage/env.do?method=editRoles&envoid=%OID%&envname=%IME%" > nul
    curl -b cookies -o "%today%_%IME%_RoleDefinitions.xml"  --trace-ascii 11_debugdump_audit_exportRole.txt  "http://%HOST%/iam/immanage/env.do?method=exportRoles&envoid=%OID%&envname=%IME%"

    :: Pull IME zip file 
    curl -c cookies       trace-ascii 12_debugdump_audit_listenv.txt data-urlencode "username=%username%" --data-urlencode "password=%password%"  "http://%HOST%/iam/immanage/env.do?method=listEnvs"> nul
    curl -b cookies -o "%today%_%IME%.zip" --trace-ascii 13_debugdump_audit_exportime.txt   "http://%HOST%/iam/immanage/env.do?method=exportEnv&deleteobjs=,%OID%&envoid=%OID%&envname=%IME%"

    :: IMCD User Store
    curl -c cookies       trace-ascii 14_debugdump_audit_listdir.txt data-urlencode "username=%username%" --data-urlencode "password=%password%" "http://%HOST%/iam/immanage/dir.do?method=listDirs"> nul
    curl -b cookies       --trace-ascii 15_debugdump_audit_editdir.txt                                        "http://%HOST%/iam/immanage/dir.do?method=editDir&diroid=%IMCD_OID%"> nul
    curl -b cookies -o "%today%_%IMCD%_imcd.xml"  --trace-ascii 16_debugdump_audit_exportdir.txt   "http://%HOST%/iam/immanage/dir.do?method=exportDir&dirname=%IMCD%"
    :: IMPS (IMPD) User Store
    curl -c cookies   trace-ascii 17_debugdump_audit_listdir.txt data-urlencode "username=%username%" --data-urlencode "password=%password%"     "http://%HOST%/iam/immanage/dir.do?method=listDirs" > nul
    curl -b cookies   --trace-ascii 18_debugdump_audit_editdir.txt                                           "http://%HOST%/iam/immanage/dir.do?method=editDir&diroid=%IMPS_OID%"> nul
    curl -b cookies -o "%today%_%IMPS%_imps.xml"   --trace-ascii 19_debugdump_audit_exportdir.txt   "http://%HOST%/iam/immanage/dir.do?method=exportDir&dirname=%IMPS%"

    :: Remove cookies and debug files after every session
    del /f cookies
    del /f debugdump.txt

    :: Remove files older than 7 days; to prevent drive from filling up with files.
    forfiles /s /m *.xml /d -7 /c "cmd /c del @file"
    forfiles /s /m *.zip /d -7 /c "cmd /c del @file"
     


  • 4.  RE: How to automate a daily backup of the IME and directory.xml files

     
    Posted Sep 11, 2013 03:15 PM
    Thanks for the update!

    baual01 wrote:

    Updated version for IM r12.6sp2. May be executed on any Windows OS or modified for Unix/Linux.

    ****

    Updated the auto-backup version for IM r12.6sp2; had to adjust the cookie creation lines.
    Included the link to the curl version I used on Windows 2008 x64.
    http://curl.haxx.se/gknw.net/7.32.0/dist-w32/curl-7.32.0-ssl-sspi-zlib-static-bin-w32.zip
     
     
    ****
     
    @echo on
    ::Automate daily backup of IME
    :: SET DATESTAMP / TIMESTAMP
    :: *** Set the date string for file naming and archive ***
    for /f "tokens=1,2" %%u in ('date /t') do set d=%%v
    set t=%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2%
    if "%t:~0,1%"==" " set t=0%t:~1%
    set today=%d:~6,4%%d:~0,2%%d:~3,2%_%t%
    :: SET IM OBJECTS
    :: Objects below are assumed to have NO space characters
    set HOST=imps-001.exchange.exc:8080
    set IME=ime
    set OID=1
    set IMCD=imcd
    set IMCD_OID=3
    set IMPS=impd
    set IMPS_OID=2
    :: IM Management Console authentication (r12.6) (if enabled)
    set username=idmembedded
    set password=Password01
    ::export HOST OID IME IMCD IMCD_OID IMPS IMPS_OID today

    echo HOST=%HOST%
    echo OID=%OID%
    echo IME=%IME%
    echo IMCD=%IMCD% and IMCD_OID=%IMCD_OID%
    echo IMPS=%IMPS% and IMPS_OID=%IMPS_OID%
    echo today=%today%
    del /f cookies
    ::echo hi > "%today%_%IME%_%IMCD%.txt"
    :: Use of open source curl with -o switch to rename output and -c/-b switch to manage the IM Forms of the IM management console
    :: Export five of five XML configuration files for IM and the zip file for IME
    :: Use this switch to debug              --trace-ascii debugdump.txt
    :: Use this switch to populate a form    --data-urlencode "username=idmembedded"
    :: Replace spaces with underscores  ${variable// /_}
    :: Store Session Cookies for IM Forms
    ::curl -c cookies trace-ascii debugdump_auth.txt  data-urlencode "username=%username%" --data-urlencode "password=%password%"    http://%HOST%/iam/immanage> nul
    ::pause
    ::exit
    :: Audit Settings
    curl -c cookies   trace-ascii 01_debugdump_audit_listenv.txt  data-urlencode "username=%username%" --data-urlencode "password=%password%"   http://%HOST%/iam/immanage/env.do?method=listEnvs > nul
    curl -b cookies   --trace-ascii 02_debugdump_audit_editenv.txt    "http://%HOST%/iam/immanage/env.do?method=editEnv&envoid=%OID%" > nul
    curl -b cookies   --trace-ascii 03_debugdump_audit_getenv.txt     "http://%HOST%/iam/immanage/envsettings.do?method=getSettings&envoid=%OID%&envname=%IME%"> nul
    curl -b cookies   --trace-ascii 04_debugdump_audit_edititem.txt   "http://%HOST%/iam/immanage/audit.do?method=editItem&envname=%IME%&envoid=%OID%" > nul
    curl -b cookies   -o  %today%_%IME%_AuditSettings.xml   trace-ascii 05_debugdump_audit_export.txt data-urlencode "username=%username%" --data-urlencode "password=%password%"  "http://%HOST%/iam/immanage/audit.do?method=exportSettings&envoid=%OID%&envname=%IME%"

    :: Environmental Settings (IMCD to IMPD)
    curl -c cookies       trace-ascii 05_debugdump_audit_listenv.txt   data-urlencode "username=%username%" --data-urlencode "password=%password%"  "http://%HOST%/iam/immanage/env.do?method=listEnvs" > nul
    curl -b cookies       --trace-ascii 06_debugdump_audit_editenv.txt  "http://%HOST%/iam/immanage/env.do?method=editEnv&envoid=%OID%" > nul
    curl -b cookies -o "%today%_%IME%_EnvironmentSettings.xml"  --trace-ascii 07_debugdump_audit_exportEnvSet.txt  "http://%HOST%/iam/immanage/envsettings.do?method=exportSettings&envoid=%OID%&envname=%IME%"

    :: IME Roles/Tasks/Screens/PX Rules/Identity Policies/Mail/Explore&Correlate Definitions
    curl -c cookies       trace-ascii 08_debugdump_audit_listenv.txt   data-urlencode "username=%username%" --data-urlencode "password=%password%"  "http://%HOST%/iam/immanage/env.do?method=listEnvs"   > nul
    curl -b cookies       --trace-ascii 09_debugdump_audit_editenv.txt   "http://%HOST%/iam/immanage/env.do?method=editEnv&envoid=%OID%" > nul
    curl -b cookies       --trace-ascii 10_debugdump_audit_editRole.txt  "http://%HOST%/iam/immanage/env.do?method=editRoles&envoid=%OID%&envname=%IME%" > nul
    curl -b cookies -o "%today%_%IME%_RoleDefinitions.xml"  --trace-ascii 11_debugdump_audit_exportRole.txt  "http://%HOST%/iam/immanage/env.do?method=exportRoles&envoid=%OID%&envname=%IME%"

    :: Pull IME zip file 
    curl -c cookies       trace-ascii 12_debugdump_audit_listenv.txt data-urlencode "username=%username%" --data-urlencode "password=%password%"  "http://%HOST%/iam/immanage/env.do?method=listEnvs"> nul
    curl -b cookies -o "%today%_%IME%.zip" --trace-ascii 13_debugdump_audit_exportime.txt   "http://%HOST%/iam/immanage/env.do?method=exportEnv&deleteobjs=,%OID%&envoid=%OID%&envname=%IME%"

    :: IMCD User Store
    curl -c cookies       trace-ascii 14_debugdump_audit_listdir.txt data-urlencode "username=%username%" --data-urlencode "password=%password%" "http://%HOST%/iam/immanage/dir.do?method=listDirs"> nul
    curl -b cookies       --trace-ascii 15_debugdump_audit_editdir.txt                                        "http://%HOST%/iam/immanage/dir.do?method=editDir&diroid=%IMCD_OID%"> nul
    curl -b cookies -o "%today%_%IMCD%_imcd.xml"  --trace-ascii 16_debugdump_audit_exportdir.txt   "http://%HOST%/iam/immanage/dir.do?method=exportDir&dirname=%IMCD%"
    :: IMPS (IMPD) User Store
    curl -c cookies   trace-ascii 17_debugdump_audit_listdir.txt data-urlencode "username=%username%" --data-urlencode "password=%password%"     "http://%HOST%/iam/immanage/dir.do?method=listDirs" > nul
    curl -b cookies   --trace-ascii 18_debugdump_audit_editdir.txt                                           "http://%HOST%/iam/immanage/dir.do?method=editDir&diroid=%IMPS_OID%"> nul
    curl -b cookies -o "%today%_%IMPS%_imps.xml"   --trace-ascii 19_debugdump_audit_exportdir.txt   "http://%HOST%/iam/immanage/dir.do?method=exportDir&dirname=%IMPS%"

    :: Remove cookies and debug files after every session
    del /f cookies
    del /f debugdump.txt

    :: Remove files older than 7 days; to prevent drive from filling up with files.
    forfiles /s /m *.xml /d -7 /c "cmd /c del @file"
    forfiles /s /m *.zip /d -7 /c "cmd /c del @file"
     


  • 5.  RE: How to automate a daily backup of the IME and directory.xml files

    Posted Oct 22, 2013 12:28 AM
    Hello, All.

    How can I find out what values to use for these variables?

    set IME=ime (I know it IME. Can it be anything here?)
    set OID=1
    set IMCD=imcd ( I guess this is IM CA Directory. I am using CA Directory. What should this value be for my own environment?)
    set IMCD_OID=3
    set IMPS=impd ( I guess this IM Provisioning server. I do have PS. What should this value be?
    set IMPS_OID=2

    Thank you in advance.


  • 6.  RE: How to automate a daily backup of the IME and directory.xml files

    Posted Mar 06, 2014 10:48 AM
    fisidm:
    Hello, All. How can I find out what values to use for these variables? set IME=ime (I know it IME. Can it be anything here?) set OID=1 set IMCD=imcd ( I guess this is IM CA Directory. I am using CA Directory. What should this value be for my own environment?) set IMCD_OID=3 set IMPS=impd ( I guess this IM Provisioning server. I do have PS. What should this value be? set IMPS_OID=2 Thank you in advance.


    Hi fisidm,

    You can locate these number from the IM management console, if you select the IME, you will see the OID as an attribute.  Or if you "hover your mouse" over the IME or IMCD/IMPS links, it will have the OID in the hyperlinks.    These OID only exist if the IME, IMCD, IMPS entries exist.   

    If you have access to database tools, dbvisualizer or a SQL manager tool, you can view the OID numbers for each different IME or if you create an IME or deleted an IME; then recreate another IME, you will see the OID numbers grow in sequence.

    Cheers,

     

     

     



  • 7.  RE: How to automate a daily backup of the IME and directory.xml files

    Posted Apr 10, 2014 01:32 PM

    Hi Alan,

    Thanks for these scripts. What version of curl were you using for the above on the Linux systems?

     



  • 8.  RE: [CA IdentityMinder (formerly CA Identity Manager) General Discussion] R

    Posted Apr 10, 2014 01:46 PM
    I used the static 32bit version w/ SSL. Here is the direct link.


    http://curl.haxx.se/gknw.net/7.32.0/dist-w32/curl-7.32.0-ssl-sspi-zlib-static-bin-w32.zip




    Alan Baugher, CISSP, ITIL, Master Certified IT Architect
    CA Principal Architect
    Tel: 636.578.6072 / 636.336.6605
    CC Bridge # 18663766162 x6365786072
    1-631-342-3333

    From: CA Security Global User CommunityMessage Boards [mailto:CommunityAdmin@communities-mail.ca.com]
    Sent: Thursday, April 10, 2014 12:32 PM
    To: mb_message.2252815.112945988@myca-email.ca.com
    Subject: [CA IdentityMinder (formerly CA Identity Manager) General Discussion] RE: How to automate a daily backup of the IME and directory.xml files


    Hi Alan,

    Thanks for these scripts. What version of curl were you using?


    Posted by:mullachv
    --
    CA Communities Message Boards
    112948528
    mb_message.2252815.112945988@myca-email.ca.com<mailto:mb_message.2252815.112945988@myca-email.ca.com>
    https://communities.ca.com


  • 9.  RE: [CA IdentityMinder (formerly CA Identity Manager) General Discussion] R

    Posted Apr 10, 2014 10:54 PM
    alan_baugher:
    I used the static 32bit version w/ SSL. Here is the direct link. http://curl.haxx.se/gknw.net/7.32.0/dist-w32/curl-7.32.0-ssl-sspi-zlib-static-bin-w32.zip Alan Baugher, CISSP, ITIL, 

    The standard RHEL build of curl does not allow a "--data-urlencode" flag, Alan.

    Of course simply using --data will do for most instances.

     



  • 10.  Re: How to automate a daily backup of the IME and directory.xml files

    Posted Sep 27, 2015 01:24 AM

    Thank you, Alan.

     

    Just finished testing the script on Windows and it was successful. Just an update from my side:

     

    If the User Store or Provisioning Store have spaces in their names, use "+" to replace the space. For eg:

       set IMCD="User+Store"

       set IMPS="Prov+Store"

     

     

    Regards,

    Piyush.