locked
Script for to handle 2 variables RRS feed

  • Question

  • Hi All,

    Thanks in advance for the help.

    I have a requirement where I need to parse 2 columns from a csv file. Below is the sample how it would look like:

    Lwemail                                               Tmemail
    test.sharedmailbox@ourdomain.com       abc@otherdomain.com
    test.shared2@ourdomain.com                     xyz@otherdomain.com

    Now, I need to collect each row at a time and parse them through a Exchange Shell command to create inbox rules.

    I know the EMS command, but since I am still a learner in powershell I don't know how to handle the inputs from csv file.

    Many Thanks,

    Niru


    Niranjan

    Wednesday, January 31, 2018 8:59 AM

Answers

  • We don't write scripts for you in this forum. I would suggest learning PowerShell as a simple Google could show you how to interact with a CSV file.

    $CSVInput = Import-CSV -Path c:\path\to\csv
    
    foreach ($I in $CSVinput){
     $lewmail = $I.lewmail
     $tmemail = $I.tmemail
    
     #REST OF CODE HERE
    }



    Wednesday, January 31, 2018 9:19 AM

All replies