How to: Use DDConfigClient DLL in PowerShell Script

DDConfigClient DLL can be used in PowerShell to check the status of a job and to send commands to DD.

Code sample to get job data for a job:

Copy
Add-Type -Path 'C:\Program Files (x86)\LS Retail\Data Director 3\bin \DDConfigClient.dll'
$a = new-object LSRetail.DD.Control.DDConfigClient
$a.GetJobData('ddhost', 'ad577629-3208-42c0-a149-bf385ece2dba')

Code sample for how to get all jobs in Global Queue and check all CONFIG jobs, if any are still running. Print out status of the job, and when all CONFIG jobs are done, stop the process.

Copy
Add-Type -Path 'C:\Program Files (x86)\LS Retail\Data Director 3\bin \DDConfigClient.dll'
$ddClient = New-Object LSRetail.DD.Control.DDConfigClient
do
{
    $complete = $true
    [xml]$ddglobalqueue = $ddclient.GetGlobalQueue("ddhost")

    foreach ($ddchildnode in $ddglobalqueue.GlobalQue.ChildNodes)
    {
        if ($ddchildnode.JobId.StartsWith("CONF"))
        {
            $ddchildnode.JobId + " = " + $ddchildnode.Status
            if ($ddchildnode.Status -ne 'Done')
            {
                $complete = $false
            }
        }              
    }
    start-sleep 5
} while ($complete -eq $false)

Functions in DDConfigClient

  • string GetLastErrorMessage();
  • string GetHostConfig(string host);
  • bool SendHostConfig(string host, string configdata);
  • string CheckDestinationStatusEx(string host, string packid, int destindex);
  • string GetGlobalQueue(string host);
  • string GetJobData(string host, string packid);
  • bool SendModifyJob(string host, string packid, string tcode, int index, string pwd);
  • bool UpdateDBString(string host, string packid, bool all, int index, string dbstring, string pwd);
  • bool UpdateDestHost(string host, string packid, bool all, int index, string desthost, string pwd);
  • string GetHostStatus(string host);
  • string GetManualQue(string host, string pullhost, bool cloud);