Symantec Management Platform (Notification Server)

 View Only
  • 1.  Altiris 7.6 Connector: How to pre-process import data

    Posted Aug 13, 2015 01:12 PM
    I am importing a CSV from Airwatch.  In order to associate the users correctly with our DB I need to add a column and populate it with our DOMAIN NAME.
     
    I have retrieved other data, i.e. BES Server Blackberry information and used a SQL query to manipulate the DOMAIN NAME as necessary.  Other than manipulating a CSV or EXCEL spreadsheet manually I do not know how to add the DOMAIN NAME column to the imported data.  We are creating an automated process of the Airwatch download to a share drive and the connector grabbing the file to import.  So I need to take care of this as a data source rule so that it is presented to the import/export rule and add the DOMAIN NAME from the source.
     
    Looking at the data source (which is a cvs spreadsheet), clicking on pre-process import data gives me some sample code but all I need to do as part of this pre-processing is to create a new column (let’s call it “DOMAIN” and it is simply add our DOMAIN NAME to every line.
     
    But it doesn't make sense to create a new table to simply add the same word to every row.  But then again the pre-processing is foreign to me so...
     
    Anyone keen to have a stab at this?


  • 2.  RE: Altiris 7.6 Connector: How to pre-process import data

    Posted Aug 25, 2015 03:12 PM

    Help please, anyone?



  • 3.  RE: Altiris 7.6 Connector: How to pre-process import data

    Posted Sep 04, 2015 05:20 AM

    Hi Blade_Co,

    I want to manage the same problem, but I am looking voor a different solution.

    We both would like to get the Airwatch device inventory into or Altiris inventory.

    One solution might be to export a CSV file from Airwatch and import this file into Altiris.

    An other solution is to connect the Altiris Inventory Solution directly to Airwatch and let Altiris collect the neccesary information. I have heard that this might be a proven and succesfull way to get inventory data from Airwatch to Altiris. However, I can't seem to find anybody to explain how this is done.

    Did you try this approach? Somebody else who will be able to help out?

     



  • 4.  RE: Altiris 7.6 Connector: How to pre-process import data

    Posted Sep 04, 2015 04:17 PM

    In pre-processing put this code

     

    importData.Columns.Add("Domain", typeof(string));
    for (int i = 0; i < importData.Rows.Count; i++)
    {
    row["Domain"]="MyDomain";

    }

     

    Did not test it but it should work

     



  • 5.  RE: Altiris 7.6 Connector: How to pre-process import data

    Posted Sep 05, 2015 07:55 AM

    Hi Eric G 2,

    Thank you for your comment.

    I am afraid I don't understand what you mean by it, i will, however, send this information to one of the engineers. You can help me out by explaining in concept where to put this script and what the script will do.

    Thanks,

    Hawee



  • 6.  RE: Altiris 7.6 Connector: How to pre-process import data

    Posted Sep 07, 2015 01:55 PM

    When you create a datasource and point it to the csv file, there is a button to add code for pre-processing.  The code you put there is Microsoft expressions which get compiles to a dll and runs when the data source is call.

    My script with comments

     

    importData.Columns.Add("Domain", typeof(string));
    The datasource by default will create an object called importData so I use herited actions to add a column in the recordset.  This column will be empty and exist only in memory


    for (int i = 0; i < importData.Rows.Count; i++)
    {
    row["Domain"]="MyDomain";

    }
    Now this loop will go through all rows and add the string "MyDomain" to the column Domain, repeating this process for each row.

    Then the script will display a record set with the column you were asking even if it doesn't exist in your csv file.



  • 7.  RE: Altiris 7.6 Connector: How to pre-process import data

    Broadcom Employee
    Posted Sep 18, 2015 12:07 PM

    Hi Blade_CO,

    could you show how looks content of CSV from AirWatch (with fake data), just to see what columns are there, etc. I'd like to see it and analyze for our data connector.

    You can send me in private message.

    Thanks,

    IP.



  • 8.  RE: Altiris 7.6 Connector: How to pre-process import data

    Posted Jan 05, 2016 02:46 AM

    Hi, I use the same method as ericg

    There is one small piece of code missing in his code. There needs to be a row variable defined within the For loop:

    DataRow row = importData.Rows[i];

     

    Full code is:

      // Check that the required columns exist.

      if (!importData.Columns.Contains("Domain"))

        importData.Columns.Add("Domain", typeof( System.String ));

      // Iterate through all rows

      for (int i = 0; i < importData.Rows.Count; i++)

      {

        DataRow row = importData.Rows[i];

        // Set value MyDomain to each row in added column Domain

     

        if (row["Domain"] == System.DBNull.Value)

        {

             row["Domain"] = " MyDomain";

         }

      }

     

      return importData;