How can i export the results for this loop

Hi all 
i wrote a script to do nslookup for a list of web sites here is the code i wrote 
$servers = get-content "C:\NSLOOKUP.txt"
foreach ($server in $servers) {
$addresses = [System.Net.Dns]::GetHostAddresses($server)
foreach($a in $addresses) {
"{0},{1}" -f $server, $a.IPAddressToString
} | Export-Csv 'C:\scripts\output.csv' -NoType
but it didn't export shall you support me on this 

Hi,
Try it this way:
Get-Content .\wwwList.txt | ForEach {
$addr = [System.Net.Dns]::GetHostAddresses($_)
$props = @{
Name = $_
Addresses = $addr.IPAddressToString -join ','
New-Object PsObject -Property $props
} | Sort Name | Export-Csv .\wwwList.csv -NoTypeInformation
Don't retire TechNet! -
(Don't give up yet - 13,085+ strong and growing)

Similar Messages

  • How can I export the results of a query?

    After executing a select statement I can see the results in a grid but how can I export the results (the data)?
    How can I export the results of a join of two or more tables?

    Right click in the results grid and select the Export menu option

  • How Can I change the Authentication for this Dynpage

    Hello ,
    I have created a rss feed in special Dnypage.   When I try to connect with rss reader  to dynpage it occurs an error 500.  The problem is that no logon screen appears and the portal would start the Dynpage with the User Guest.
    How Can I change the Authentication for this Dynpage ? I need a LogonScreen
    RSS URL:
    /irj/servlet/prt/portal/prtmode/rss/prtroot/com.geberit.ep.uwlquick.uwlquickstarter?mode=rss

    Hi ,
    sry the entry in xml does not help. No Logon Prompt
    <?xml version="1.0" encoding="UTF-8"?>
    <application>
      <application-config>
        <property name="SecurityArea" value="NetWeaver.Portal"/>
        <property name="Vendor" value="xx.com"/>
        <property name="PrivateSharingReference" value="com.sap.portal.htmlb,com.sap.portal.pcd.glservice,com.sap.portal.ivs.iviewservice,usermanagement,,com.sap.netweaver.bc.uwl"/>
      </application-config>
      <components>
        <component name="uwlquickstarter">
          <component-config>
              <property name="SafetyLevel" value="no_safety"/>
            <property name="ClassName" value="com.xx.portal.uwl.uwlquickstarter"/>   
          </component-config>
              <component-profile>
                   <property name="AuthScheme" value="default"/>
              </component-profile>
        </component>
      </components>
      <services/>
    </application>

  • How can I access the settings for this program.

    How do I access the setting for Adobe Flash player?
    I keep getting a box which asks me to allow or not allow additional storage space, but when I click either box nothing happens.
    When this program was installed it never provided me with a setting screen - so how can I access this information.

    http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager03.htm l
    Or use the Flash Player Settings Manager.

  • How can i delete the backup for this ipod

    ipod will not sinc, box says deete the backup for this ipod and try again. how? any help please

    Go into the iTunes Preferences>Devices - select your iPod Touch backup and hit delete backup.

  • How can I uninstall the software for this printer?

    I am attempting to remove the software for my 7280 AIO but am unable to.  Help?

    hi there,
    could you provide the community with a little more information to help narrow troubleshooting? Things like your operating system can help out a lot.
    You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too.

  • How can I get the attributes for this tag?

    THis is the tag:
    <InvoiceQueryRs requestID="1" statusCode="0" statusSeverity="Info" statusMessage="Status OK">
    But when I do a nodeType() is returns a "1" which is Element. Shouldn't it return Attribute type?
    org.w3c.dom.Document xDoc = xml.parseXML(false);
    Element el = xDoc.getDocumentElement(); //Using DOM API
    NodeList nl = el.getElementsByTagName("InvoiceQueryRs");
    NodeList nl = el.getChildNodes();
    for(int c = 0; c < nl.getLength(); c++) {
    System.out.println(nl.item(c).getAttributes());
    This code returns a "com.ibm.xml.dom.NamedNodeMapImpl@88f03c" for the attributes. I also tried a NamedNodeMap with similar results. Please help if you can!
    THanks
    Bill

    Nevermind, I got it. Thanks.

  • How can I unlock the cookies for this web browser

    My web browser is locked and I need to unlock it to log in to a web acccount

    Sorry, but I'm not sure what you mean by "locked". Is that a message a web page is giving you, or a pop-up dialog, or ???
    If you want to delete the cookies that are currently in Firefox for Android, they are part of the "Clear Private Data" feature. See this article for detailed steps: [[Clear your browsing history and other personal data on Firefox for Android]].

  • Derived Table How can I give the results of this SQL Line an Explicit Name.

    I am trying to create a derived table and I get the error
    "each calculated column must have an explicit name"
    I added the as shiptype to the end of the line and that did not work. Any thoughts?
    shiptype = case when araddr.invno is not null then 'ADDR' else (case when arcadr.custno is not null then 'CADR' else 'CUST' end) end as shiptype,
    Thanks
    Jeff

    Sure,
    Here is the complete query.
    This query works fine is sql query analyzer but when I put it in the designer I get the error.
    SELECT      'C' as tableId,
    '' as StartMast,
    armast.invno as invno,
    armast.invdte as invdte,
    armast.ponum as ponum,
    armast.ordate as ordate,
    armast.shipvia as shipvia,
    armast.fob as fob,
    armast.ornum as ornum,
    armast.disc as Idisc,
    armast.taxrate as Itaxrate,
    armast.tax as tax,
    armast.invamt as invamt,
    armast.disamt as disamt,
    armast.paidamt as paidamt,
    armast.balance as balance,
    armast.dtepaid as dtepaid,
    armast.pterms as pterms,
    armast.arstat as arstat,
    armast.artype as artype,
    armast.notes as notes,
    armast.salesmn as salesmn ,
    '' as StartBill,
    arcust.custno,
    arcust.company as billComp,
    arcust.contact as billaddr1,
    arcust.address1 as billaddr2,
    arcust.address2 as billaddr3,
    arcust.city as billcity,
    arcust.addrstate as billstate,
    arcust.zip as billzip,
    arcust.country as billcountry,
    arcust.phone as billphone,
    arcust.faxno as billfaxno,
    rtrim(cast(arcust.email as varchar(2000))) as billemail,
    '' as StartShip,
    armast.tosw,
    armast.cshipno,
    shiptype = case when araddr.invno is not null then 'ADDR' else (case when arcadr.custno is not null then 'CADR' else 'CUST' end) end,
    shipcomp = left(case when araddr.invno is not null then araddr.company else (case when arcadr.custno is not null then arcadr.company else arcust.company end) end + space(35),35),
    shipaddr1 = left(case when araddr.invno is not null then araddr.address1 else (case when arcadr.custno is not null then arcadr.contact else arcust.contact end) end + space(30),30),
    shipaddr2 = left(case when araddr.invno is not null then araddr.address2 else (case when arcadr.custno is not null then arcadr.address1 else arcust.address1 end) end + space(30),30),
    shipaddr3 = left(case when araddr.invno is not null then araddr.address3 else (case when arcadr.custno is not null then arcadr.address2 else arcust.address2 end) end + space(30),30),
    shipcity = left(case when araddr.invno is not null then araddr.city else (case when arcadr.custno is not null then arcadr.city else arcust.city end) end + space(20),20),
    shipstate = left(case when araddr.invno is not null then araddr.addrstate else (case when arcadr.custno is not null then arcadr.addrstate else arcust.addrstate end) end + space(10),10),
    shipzip = left(case when araddr.invno is not null then araddr.zip else (case when arcadr.custno is not null then arcadr.zip else arcust.zip end) end + space(10),10),
    shipcntry = left(case when araddr.invno is not null then araddr.country else (case when arcadr.custno is not null then arcadr.country else arcust.country end) end + space(15),15),
    '' as StartCmnt,
    armast.commid as commid,
    arcomm.comment as CommCmnt,
    arscom.comment as ScomCmnt,
    invCmnt = isnull(
                case
                      when armast.commid = 'MISC' then arcomm.comment
                      when len(rtrim(armast.commid)) > 0 then arscom.comment
                      else ''
                end
    '' as StartTran,
    artran.tranlineno,
    artran.item,
    artran.loctid,
    artran.Descrip,
    artran.intmemo,
    artran.custmemo,
    artran.qtyord,
    artran.qtyshp,
    artran.price,
    artran.disc as ldisc,
    artran.taxrate as ltaxrate,
    artran.extprice,
    artran.taxable,
    artran.arstat as linestat,
    artran.artype as linetype
    FROM armast
    LEFT JOIN artran ON artran.invno = armast.invno
    Left JOIN arcust ON arcust.custno = armast.custno
    Left JOIN arcomm ON arcomm.invno = armast.invno
    Left JOIN arscom ON arscom.commid = armast.commid
    LEFT JOIN araddr ON araddr.invno = armast.invno
    LEFT JOIN arcadr ON arcadr.custno = armast.custno AND arcadr.cshipno = armast.cshipno
    WHERE (armast.invdte >= getdate() - 180 OR len(rtrim(armast.arstat)) = 0)
          AND armast.invno <> '_RECEIPT'
          AND len(rtrim(armast.currhist)) = 0
          AND armast.custno = 'TJS-01'
    Union All
    SELECT      'H' as tableId,
    '' as StartMast,
    arymst.invno as invno,
    arymst.invdte as invdte,
    arymst.ponum as ponum,
    arymst.ordate as ordate,
    arymst.shipvia as shipvia,
    arymst.fob as fob,
    arymst.ornum as ornum,
    arymst.disc as Idisc,
    arymst.taxrate as Itaxrate,
    arymst.tax as tax,
    arymst.invamt as invamt,
    arymst.disamt as disamt,
    arymst.paidamt as paidamt,
    arymst.balance as balance,
    arymst.dtepaid as dtepaid,
    arymst.pterms as pterms,
    arymst.arstat as arstat,
    arymst.artype as artype,
    arymst.notes as notes,
    arymst.salesmn as salesmn ,
    '' as StartBill,
    arcust.custno,
    arcust.company as billComp,
    arcust.contact as billaddr1,
    arcust.address1 as billaddr2,
    arcust.address2 as billaddr3,
    arcust.city as billcity,
    arcust.addrstate as billstate,
    arcust.zip as billzip,
    arcust.country as billcountry,
    arcust.phone as billphone,
    arcust.faxno as billfaxno,
    rtrim(cast(arcust.email as varchar(2000))) as billemail,
    '' as StartShip,
    arymst.tosw,
    arymst.cshipno,
    shiptype = case when aryadr.invno is not null then 'YADR' else (case when arcadr.custno is not null then 'CADR' else 'CUST' end) end,
    shipcomp = left(case when aryadr.invno is not null then aryadr.company else (case when arcadr.custno is not null then arcadr.company else arcust.company end) end + space(35),35),
    shipaddr1 = left(case when aryadr.invno is not null then aryadr.address1 else (case when arcadr.custno is not null then arcadr.contact else arcust.contact end) end + space(30),30),
    shipaddr2 = left(case when aryadr.invno is not null then aryadr.address2 else (case when arcadr.custno is not null then arcadr.address1 else arcust.address1 end) end + space(30),30),
    shipaddr3 = left(case when aryadr.invno is not null then aryadr.address3 else (case when arcadr.custno is not null then arcadr.address2 else arcust.address2 end) end + space(30),30),
    shipcity = left(case when aryadr.invno is not null then aryadr.city else (case when arcadr.custno is not null then arcadr.city else arcust.city end) end + space(20),20),
    shipstate = left(case when aryadr.invno is not null then aryadr.addrstate else (case when arcadr.custno is not null then arcadr.addrstate else arcust.addrstate end) end + space(10),10),
    shipzip = left(case when aryadr.invno is not null then aryadr.zip else (case when arcadr.custno is not null then arcadr.zip else arcust.zip end) end + space(10),10),
    shipcntry = left(case when aryadr.invno is not null then aryadr.country else (case when arcadr.custno is not null then arcadr.country else arcust.country end) end + space(15),15),
    '' as StartCmnt,
    arymst.commid as commid,
    arcomm.comment as CommCmnt,
    arscom.comment as ScomCmnt,
    invCmnt = isnull(
                case
                      when arymst.commid = 'MISC' then arcomm.comment
                      when len(rtrim(arymst.commid)) > 0 then arscom.comment
                      else ''
                end
    '' as StartTran,
    arytrn.tranlineno,
    arytrn.item,
    arytrn.loctid,
    arytrn.Descrip,
    arytrn.intmemo,
    arytrn.custmemo,
    arytrn.qtyord,
    arytrn.qtyshp,
    arytrn.price,
    arytrn.disc as ldisc,
    arytrn.taxrate as ltaxrate,
    arytrn.extprice,
    arytrn.taxable,
    arytrn.arstat as linestat,
    arytrn.artype as linetype
    FROM arymst
    LEFT JOIN arytrn ON arytrn.invno = arymst.invno
    Left JOIN arcust ON arcust.custno = arymst.custno
    Left JOIN arcomm ON arcomm.invno = arymst.invno
    Left JOIN arscom ON arscom.commid = arymst.commid
    LEFT JOIN aryadr ON aryadr.invno = arymst.invno
    LEFT JOIN arcadr ON arcadr.custno = arymst.custno AND arcadr.cshipno = arymst.cshipno
    WHERE (arymst.invdte >= getdate() - 180 OR (len(rtrim(arymst.arstat)) = 0 AND arymst.invno in (select invno FROM armast where len(rtrim(arstat)) = 0)))
          AND arymst.invno <> '_RECEIPT'
          AND arymst.custno = 'TJS-01'

  • How can I change the language for the Quiz Results page?

    How can I change the language for the Quiz Results (labels on buttons and text labels)? Is this possible only manually each time, or are general settings possible?

    For Quiz Slides you've already added to your project file you will need to change the labels manually.  If you change your Quiz Settings and Master Slides that control the defaults and then add new Quiz Slides, THEN those slides will carry your new settings.

  • HT2486 how can I export the contact book data to a csv file for editing?

    how can I export the contact book data to a csv file for editing?

    You can edit a card right in Contacts. No need to export and re-import.
    Select a name and on the right side, click the Edit button:

  • I am a student who subscribed to the 9.99 photography package, I didn't realize there was a discount for students.  I would like to upgrade to the full package with the student discount.  I can not find the option for this. How do I do this?

    I am a student who subscribed to the 9.99 photography package, I didn't realize there was a discount for students.  I would like to upgrade to the full package with the student discount.  I can not find the option for this. How do I do this?

    Hi Djmontanalv,
    Please go through the link below.
    http://helpx.adobe.com/x-productkb/policy-pricing/cancel-membership-subscription.html
    Regards,
    Anand

  • I have written an ebook that has been created for kindle. How can I export the book into iBooks author?

    I have written an ebook that has been created for kindle. How can I export the book into iBooks Author?
    I have tried converting the book to different files like, mobi, epub, pdf. By using an app on my iphone.
    I still cannot add it to iBooks Author.
    I'm stuck, Please help me!

    Either use copy/paste and then format/style as desired, or take it to Pages or WORD and insert chapters - which may still require resettling.
    If you're looking for a 1:1 port, with all styles and layout intact, you may be dissapointed, tho.

  • How can i display the result of java class in InputText ?

    Hi all,
    How can i get the result of java class to InputText Or OutputText ???
    also can every one in the forum give me road map for dealing with java in oracle adf because i'm beginner in oracle adf
    i saw some samples in oracle adf corner but it's difficult for me.

    User,
    Always mention your JDev version, technologies used and clear usecase description (read through this announcement : https://forums.oracle.com/forums/ann.jspa?annID=56)
    How can i get the result of java class to InputText Or OutputText ???Can you elaborate on your requirement? Do you mean the return value of a method in a class as output text? Or an attribute in your class (bean?) as text field?
    -Arun

  • How can i export the data to excel which has 2 tables with same number of columns & column names?

    Hi everyone, again landed up with a problem.
    After trying a lot to do it myself, finally decided to post here..
    I have created a form in form builder 6i, in which on clicking a button the data gets exported to excel sheet.
    It is working fine with a single table. The problem now is that i am unable to do the same with 2 tables.
    Because both the tables have same number of columns & column names.
    Below are 2 tables with column names:
    Table-1 (MONTHLY_PART_1)
    Table-2 (MONTHLY_PART_2)
    SL_NO
    SL_NO
    COMP
    COMP
    DUE_DATE
    DUE_DATE
    U-1
    U-1
    U-2
    U-2
    U-4
    U-4
    U-20
    U-20
    U-25
    U-25
    Since both the tables have same column names, I'm getting the following error :
    Error 402 at line 103, column 4
      alias required in SELECT list of cursor to avoid duplicate column names.
    So How can i export the data to excel which has 2 tables with same number of columns & column names?
    Should i paste the code? Should i post this query in 'SQL and PL/SQL' Forum?
    Help me with this please.
    Thank You.

    You'll have to *alias* your columns, not prefix it with the table names:
    $[CHE_TEST@asterix1_impl] r
      1  declare
      2    cursor cData is
      3      with data as (
      4        select 1 id, 'test1' val1, 'a' val2 from dual
      5        union all
      6        select 1 id, '1test' val1, 'b' val2 from dual
      7        union all
      8        select 2 id, 'test2' val1, 'a' val2 from dual
      9        union all
    10        select 2 id, '2test' val1, 'b' val2 from dual
    11      )
    12      select a.id, b.id, a.val1, b.val1, a.val2, b.val2
    13      from data a, data b
    14      where a.id = b.id
    15      and a.val2 = 'a'
    16      and b.val2 = 'b';
    17  begin
    18    for rData in cData loop
    19      null;
    20    end loop;
    21* end;
      for rData in cData loop
    ERROR at line 18:
    ORA-06550: line 18, column 3:
    PLS-00402: alias required in SELECT list of cursor to avoid duplicate column names
    ORA-06550: line 18, column 3:
    PL/SQL: Statement ignored
    $[CHE_TEST@asterix1_impl] r
      1  declare
      2    cursor cData is
      3      with data as (
      4        select 1 id, 'test1' val1, 'a' val2 from dual
      5        union all
      6        select 1 id, '1test' val1, 'b' val2 from dual
      7        union all
      8        select 2 id, 'test2' val1, 'a' val2 from dual
      9        union all
    10        select 2 id, '2test' val1, 'b' val2 from dual
    11      )
    12      select a.id a_id, b.id b_id, a.val1 a_val1, b.val1 b_val1, a.val2 a_val2, b.val2 b_val2
    13      from data a, data b
    14      where a.id = b.id
    15      and a.val2 = 'a'
    16      and b.val2 = 'b';
    17  begin
    18    for rData in cData loop
    19      null;
    20    end loop;
    21* end;
    PL/SQL procedure successfully completed.
    cheers

Maybe you are looking for