How to Read the "text file and csv file" through powershell Scripts

Hi All
i need to add a multiple users in a particular Group through powershell Script how to read the text and CSV files in powershell
am completly new to Powershell scripts any one pls respond ASAP.with step by step process pls
Regards:
Rajeshreddy.k

Hi Rajeshreddy.k,
To add multiple users to one group, I wouldn't use a .csv file since the only value you need from a list is the users to be added.
To start create a list of users that should be added to the group, import this list in a variable called $users, the group distinguishedName in a variable called $Group and simply call the ActiveDirectory cmdlet Add-GroupMember.
$Users = Get-Content -Path 'C:\ListOfUsernames.txt'
$Group = 'CN=MyGroup,OU=MyOrg,DC=domain,DC=lcl'
Add-ADGroupMember -Identity $Group -Members $Users

Similar Messages

  • How to read the TEXT TABLE (or) .CSV in HSQLDB Standalone using Java

    Hi, I like to use the text tables in our application. And like to use the HSQL Database Engine as Standalone. I created the text tables, those are stored in the disk as ".CSV" files. But i am unable to read that text table (.CSV) when i relogin and gave the CSV file path as URL along with "jdbc:hsqldb:file". So can anybody give me the tips how use the text tables.
    Regards,
    Vinay

    You need to make a URLConnection to the page you want, and get the input stream from that page.
    The contents of the input stream (use a reader to get them) will give you the raw HTML code. Use a parser to get the actual content. I dont know of a parser offhand, but you can search for one.

  • How to read the TEXT TABLES (Or) .CSV in HSQLDB using JAVA

    Hi,
    I want to use the HSQLDB instead of mdb in our application. I am using the HSQLDB Engine Standalone mode, and given a file name "TEMP" in URL along with the "jdbc:hsqldb:file:". Then a I created a TEXT TABLE, that table was created as a .CSV file in the Disk. But I am unable to read that CSV, I tried that file in the database URL. But its not working. Can anubody give me the suggestions.
    Thankyou,
    Regards,
    Vinay.

    Hi Rajeshreddy.k,
    To add multiple users to one group, I wouldn't use a .csv file since the only value you need from a list is the users to be added.
    To start create a list of users that should be added to the group, import this list in a variable called $users, the group distinguishedName in a variable called $Group and simply call the ActiveDirectory cmdlet Add-GroupMember.
    $Users = Get-Content -Path 'C:\ListOfUsernames.txt'
    $Group = 'CN=MyGroup,OU=MyOrg,DC=domain,DC=lcl'
    Add-ADGroupMember -Identity $Group -Members $Users

  • How to read the content of ms-word file use pure java???

    how to read the content of ms-word file use pure java???

    hi,
    check this: http://jakarta.apache.org/poi/

  • How to embed the Word Document and PDF file into Crystal report?

    How to embed the Word Document and PDF file into Crystal report?
    I have word doc which having 10 pages. I need to show all of the 10 pages at a time. I tried OLE object but problem is it shows only one page.
    Is there any solution to show word doc / PDF file in CR?

    Symptom :
    When embedding a pdf document into a Crystal Report, only the one page shows.
    Reproducing the Issue
    Environment:
    Crystal Reports OLE object
    Cause
    An OLE object only displays the first page.
    Resolution
    Embed multiple objects, one for each page
    Or
    Use a hyperlink to the object instead
    Hope this helps!
    Regards,
    Vinay

  • Function and Department of contactpersons - how to read the texts

    Hello,
    we use at the level of contact person the fields FUNCTION and DEPARTMENT where codes represent a function or department.
    My question is how could we read the texts in users language for the codes in this fields?
    Are there function modules we could use?
    Thank you.
    Kind regards
    Manfred

    hi,
    Use FM BUPR_CONTP_GET_DETAIL to get the codes of Function and department.
    Read the language of the user
    Pass those codes along with language to TB911 --> Departments and TB913 --> functions to get the descriptions repectively
    Regds,
    Raghu

  • How to read the text file present in the Al11 server through our program?

    My requirement is that , i have one file already present in the AL11 server. Now i want to take this file so that I can read this file .
    So will you please help me , how to read the file from AL11 server in our program ?
    Thankx in advance

    Hi..
    I too agree to the above post .. SEARCH in SCN before posting..
      DATA: lv_filename  TYPE string, "File name
            lv_line      TYPE string. "One line entry in a file
      lv_filename = iv_file_name.
      IF iv_location = gc_application.
        IF iv_record_count IS SUPPLIED.
      Open file
          IF gv_file IS INITIAL.
            OPEN DATASET lv_filename FOR INPUT IN TEXT MODE
                                     ENCODING DEFAULT.
                                     ENCODING DEFAULT
                                     IGNORING CONVERSION ERRORS.
            IF sy-subrc <> 0.
              RAISE file_open_error.
            ENDIF.
            gv_file = gc_check.
          ENDIF.
      Read data
          DO iv_record_count TIMES.
            READ DATASET lv_filename INTO lv_line.
            IF sy-subrc <> 0.
      Close file
              CLOSE DATASET lv_filename.
              IF sy-subrc NE 0.
                RAISE file_close_error.
              ENDIF.
              CLEAR gv_file.
    Exit from the loop
              EXIT.
            ENDIF.
    Regards
    Ansari

  • How to read the content of this excel file in LV

    Hi could you please let me know how can I read the content of this excel file using the Read From Speardsheet function. It contains text and numbers
    Thanks
    The excel file is attached
    Attachments:
    Datalogging.zip ‏307 KB

    Check attached VI.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.
    Attachments:
    ReadFromExcel.vi ‏27 KB

  • How to transfer the messages saved as .csv file to the iphone?

    I made abackup my messages using SQlite browser which saved the backup file as .csv file. How can i transfer it to my phone again?

    PC suite does not help. Especially in my case where i created sub-folders in the "saved messages" folder, after which the messages can be read, but cannot be moved back to inbox anymore. After calling the nokia care centre, guess what the d**B customer care person said? she said one option is to forward the SMS's to another SIM card, then save it on that sim card. talk abt not using your brain!!! firstly, it would be costly, at 5cents per sms; that notwithstanding, it would take hours and hours to forward all (I have ard 900 saved sms's) to another number!
    with technology at the leve it's at now, I don't see why I have to incur both the TIME and MONEY to transfer something that is already belonging to me.

  • How to read the text in a link present in a web site ?

    An excellent example I can think of ..is this forum. Using a Java program I need to access/read
    the text present in all the topics posted here (in one page) and put them into a file. In this way if suppose the network goes down, I can still read the entire topic stored in the text file. This program can be scheduled to run daily.
    Can anyone give any sample code/hints to do this ?
    Thanks in advance.

    You need to make a URLConnection to the page you want, and get the input stream from that page.
    The contents of the input stream (use a reader to get them) will give you the raw HTML code. Use a parser to get the actual content. I dont know of a parser offhand, but you can search for one.

  • Hi how to edit the text content in CSV

    Hi,
    I need to edit the text content in CSV using java script.
    The content goes like this..........
    "missing image No"
    need to replace "No" by "Yes"
    Thanks in advance

    > I need to edit the text content in CSV using java script.
    Something like this work. I haven't tested it but it pretty close :)
    var file = new File("~/somefile.csv");
    file.open("r");
    file.close();
    var str = file.read();
    var nstr = str.replace(/\bNo\b/g, 'Yes');
    file.open("w");
    file.write(nstr);
    file.close();
    -X

  • How to read the contens of an ini-File

    How can I read the contens of an ini-File?

    Depends on what you have in the file - ini file with or without sections.
    Without sections: you may be able to read it as a property file.
    With sections: You'll have to implement a class to read and parse the file, and a class to hold the parsed results.
    If you have to build your own objects, I found the easiest way was to read each line and use the StringParser to pick it apart. My data holding object was pretty simple -
    o A Vector to hold Section objects.
    o A Section object with a Vector to hold each Entry object.
    o An Entry object
    o Appropriate getters and setters to look up stuff I wanted or to insert it.
    My model for the object was the Borland C++ IniFile object, but I separated the I/O so that I could read or write from any stream I wished, including just a long string.
    o an internal object for section, an internal object for entry

  • How to Read the text enetered in Notes Tab of Invoice Doc. ( FB60, MIRO  )

    Hi All,
    We are trying to read the Text Entered in Notes Tab of Invoice Doc using the tcode FB60, MIRO..
    We are able to see the text when we use these tcode but can you please help us how to read these deatils in a program..
    We wanted to download these notes corresponding to the Invoivces..
    Thanks in Advance....
    Regards,
    Vidya.

    Hmm..you will get lots of links if you search the forum/google..
    Anyway - keep a breakpoint in SAVE_TEXT/READ_TEXT function module and create/display MIRO and FB60 documents - this tell you how it stores and reads long text.
    You should use READ_TEXT in your program with same header inputs with respective TDOBJECT and TDNAME parameters.

  • Help on how to read the content of an XML file from the payload

    I have a receiver channel / mail adapter, that sends e-mails with a XML attachment.
    I’m trying to write a Bean, that should make it possible to rename the attached XML file dynamically.
    In the Bean I want to read the content of the attached XML file, it could be the “order number”.
    The filename should then be “Order number”.XML.
    <u><i>Can anyone help me with how to read the content of the XML file from the payload.</i></u>
    <i><b>Frank</b></i>

    hi,
    check this: http://jakarta.apache.org/poi/

  • How to get the text boxes and select lists dynamically?

    Hi,
    I have a requirement such that I need to create the text boxes and select lists depending on the user input at the run time. It means that if the user requires four text boxes/select lists then I need to have 4 such thing. If the user need 6 then I need to have 6.
    The design may be such that initially only one text box/select list will be available when the page launches. Then as ad when the user asks for more those will be available to the user accordingly.
    regards,
    Dipankar.

    You can use Ajax to call textboxes and select list based on what user enters.
    Otherwise make those items conditional and based on what user enters you can display textbox or select list.
    You can call Single Textbox and Select List using Ajax for any number of conditions.
    Regards
    Chandra

Maybe you are looking for

  • How do I select two-sided printing now that I have Adobe Reader? I didn't know it would change my pr

    How do I select two-sided printing now that I have Adobe Reader? I didn't know it would change my print function at all and am curious why it does. My HP printer always did this and on the old screen there was a check off box for two-sided printing.

  • Maximum number of proceses

    Hi Experts, How to find what is the maximum number of processes configured on instance. spfile has the parameter, is there any query which can return same? v$process and v$session seems will not help much. Please suggest. Regards - Neuron

  • FSCM-COL: Deletion of customers contacts in Worklist

    Hi all, I have a quick question for you guys. Do you know if is possible to delet the some customer contacts in Worklist. I try to check in SAP and in other forumns but the only info that i got is that only resubmissions are possible to delete (progr

  • Template Shifting

    Hi everyone, I really hope someone can help out with this, because it's doing my head in. I'm running my site from a template, and even though it's only by a few pixels, when you go from the home page to 'browse' page, the title and menu shift out sl

  • Can we change the title of "Java Web Start" window?

    Hi while running our application into "Java Web Start" using jnlp configuration file, may I know how to change the title of Java Web Start Window. At present it show the title like "Java Web Start" I want to customize, is it possible? , How?