Formatting output from psbase.InvokeGet

I can run the following script to get each user's name, FQDN's and RDS (Terminal Services) path.  If I pipe the script to an OutFile when I run it, I get a text file with these elements listed on separate lines.  If I break it into two scripts
with one getting display name and RDS profile and the other getting FQDN and RDS profile, I can work through the 2 output files with Word and Excel to get a spreadsheet of all 3 elements, but I would much rather not have to go through the added hassle since
we will be checking this somewhat frequently in the near future.
What can I do to the script below to have it output all 3 elements of each userID in a table?  If not in a table, then a text file with the elements separated by semicolons (doesn't have to be semicolons, but it can't be commas since the FQDN is full
of commas) and each user's info on a separate line so that I can easily bring it into Excel?
The script is:
$Users = ([ADSISearcher]"(&(objectCategory=person)(objectClass=user))").findall() | select path
 foreach ($user in $users) {
 $userSearch = [adsi]"$($user.path)"
 $userSearch.psbase.InvokeGet(“displayname”)
 $userSearch.psbase.InvokeGet(“distinguishedname”)
 $userSearch.psbase.InvokeGet(“terminalservicesprofilepath”)
Thank you for your help with this.

Hi Logan,
Give this a try:
$out = @()
$Users = ([ADSISearcher]"(&(objectCategory=person)(objectClass=user))").findall() | select path
foreach ($user in $users) {
$userSearch = [adsi]"$($user.path)"
try { $rdsPath = $userSearch.psbase.InvokeGet(“terminalservicesprofilepath”) }
catch { $rdsPath = '' }
$props = @{
DisplayName = $userSearch.psbase.InvokeGet(“displayname”)
DN = $userSearch.psbase.InvokeGet(“distinguishedname”)
RDSPath = $rdsPath
$out += New-Object PsObject -Property $props
$out | Export-Csv .\userInfo.csv -NoTypeInformation
Don't retire TechNet! -
(Don't give up yet - 12,700+ strong and growing)

Similar Messages

  • How to get XML format output from Hyperion Financial Reporting

    Dears,
    We are using Hyperion Financial Reporting to replace FSG in fusion. I found that Hyperion FR report can be exported to html/excel/pdf format. However, I would like the report to export to xml format.It means I only need the xml data source.
    Anyone who knows how to get the xml format output from Hyperion FR, is there any avaiable API?

    I think if you export the report, you will be able to open the .des file in Notepad/Wordpad and see xml content.

  • A litttle help formatting output from powershell?

    Hi all, I am working on a software inventory project and am (as will become obvious) a novice at powershell.  I have the script running so I get what I need, but the formatting is borderline un-useable.  I would like to see if anyone can point
    me in the direction of creating one or two of the following: a single, collated file of all installed programs on all computers in the OU, filtered for duplicates (ie, only unique entries, not 37 instances of Office 2010 Service Pack 2), and/or an excel worksheet
    with a page for each pc in the OU, and the list of installed programs on each page.  This is what I have so far:
    $rtn = $null
    Get-ADComputer -filter '*' -searchbase 'ou=levy chd, dc=doh,dc=ad,dc=state,dc=fl,dc=us'|
    ForEach-Object {
    $rtn = Test-Connection -CN $_.dnshostname -Count 1 -BufferSize 16 -Quiet
    IF($rtn -match 'True') {write-output $_.name | out-file C:\chd38computers_ping=true.csv -Append }
    ELSE { write-output $_.name | out-file C:\chd38computers_ping=false.txt -Append }
    $computers = Import-Csv "C:\chd38computers_ping=true.csv"
    foreach($obj in $computers){
    Get-WmiObject -Class win32reg_addremoveprograms | Select DisplayName,Publisher,Version,Installdate | Sort Publisher -Descending| Export-Csv d:\installed_apps.csv -append
    Thanks in advance for the help!
    adam

    To filter out duplicates, you can use the -unique switch for Select here:
    Get-WmiObject -Class win32reg_addremoveprograms | Select DisplayName,Publisher,Version,Installdate -unique | Sort Publisher -Descending| Export-Csv d:\installed_apps.csv -append
    To manipulate excel file from Powershell you will need to use New-Object -ComObject "Excel.Application". I'd add the result of each computer into an array and then use the ComObject to add the content to a new sheet. You can read more here:
    http://blogs.technet.com/b/heyscriptingguy/archive/2013/04/03/excel-spreadsheets.aspx
    tompa
    http://tompaps.blogspot.com

  • Formatting Output from a procedure

    Hi all,
    I want to format the output of this procedure
    declare
    cursor c1 is select tname from tab where tabtype = 'TABLE' ;
    tabname varchar2(1000) ;
    i number := 1;
    rc number ;
    str varchar2(1000) ;
    begin
    open c1 ;
    loop
    fetch c1 into tabname ;
    exit when c1%notfound ;
    str := 'select count(*) from ' || tabname ;
    execute immediate str into rc ;
    dbms_output.put_line(i || ' - ' || tabname || ' -- ' ||rc) ;
    i := i + 1 ;
    end loop ;
    close c1 ;
    end ;
    The OUTPUT is like this.......
    1 - asdf -- 0
    2 - asdfsdafasdf -- 16
    3 - asdfsaf -- 327
    4 - asdfasdfasfsdafsdfs -- 27
    5 - asd -- 128562
    Now, I want this output should be like this
    1 - asdf -- 0
    2 - asdfsdafasdf -- 16
    3 - asdfsaf -- 327
    4 - asdfasdfasfsdafsdfs -- 27
    5 - asd -- 128562
    Thanks in advance,
    Pal

    Use [ pre ] and [ /pre ] with no sapce.
    http://www.oracle.com/technology/forums/faq.html#q14
    But,for your question, using to_char or lpad, you can format.
    dbms_output.put_line(i || ' - ' || tabname || ' -- ' ||lpad(rc,20)) ;
    -- Oops, I correct as following.
    dbms_output.put_line(rpad(i || ' - ' || tabname || ' -- ' ,60)||lpad(rc,20)) ;
    Message was edited by:
    ushitaki

  • Formatting output from a select statement?

    Hi: a trivial question.
    When I run a select on four fields, it prints the first field in one line and the rest in the second line.
    TYPE
      PROTO CLASS_ID DSTPORT
    BUILT_INBOUND_UDP
         17    50007      53
    Is there a any variable I can configure so that all four fields are printed in the same line?
    TYPE               PROTO CLASS_ID DSTPORT
    BUILT_INBOUND_UDP 17    50007      53Thanks
    Ray

    SQL> SELECT a.owner from all_all_tables a WHERE rownum = 1;
    OWNER
    SYS
    SQL> column owner format a15;
    SQL> SELECT a.owner from all_all_tables a WHERE rownum = 1;
    OWNER
    SYS
    SQL> column owner format a5;
    SQL> SELECT a.owner from all_all_tables a WHERE rownum = 1;
    OWNER
    SYS
    SQL>

  • Need formatted EXCEL output, from View Output,Oracle Applications

    To view the report(Normal RDF report,not XML Publisher Report) output in EXCEL, I changed the Profile Options.
    From: System Administrator Responsibility.
    Navigation: Install -> Viewer Options.
    Added the below entry.
    PDF application/vnd.ms-excel Microsoft Excel
    Now when I submit the report, after completing, when clicked to View Output, I can see the list showing Browser and Microsoft Excel.
    I saved the Excel Sheet,but its not formatted. How do I get the formatted Output. As columns are not in proper shape.
    Please do the needful.
    Thanks.

    Hi Abdul;
    Please check below thread's mention metalink note&advice:
    Open Text output of a Report in Excel - Bad format
    Re: Open Text output of a Report in Excel  - Bad format
    Hope it helps
    Regard
    Helios

  • Exporting HD video clips from Final Cut Pro in a format readable from IPad

    There are many ways to convert mp4 formatted videos into a file that can be sent to IPad via Itune and be read by IPad. However, my problem is that my videos are in a format 16 x 9 and the IPad screen is near 4 x 3 format and the pictures of my videos are squeezed horizontally.
    Which application could help me creating a letter box stype with black bands on top and bottom of the IPad screen so that I can have my 16 x 9 dimension of the picture kept correctly?

    Whatever your output from Final Cut, if you open in Quicktime and export or share and select Apple TV (iPad), your video shouldl be exported in a format playable on iPad.

  • How to Generate CSV Output from JD Edwards BI Publisher

    Hi All,
    I have a report "Critical Date Report" - R15611 in JD Edwards 8.11. This report has to be generated as CSV output from BI Publisher which is embedded to JDE.
    The purpose we want use BI Publisher is to move some of the data displaying to different place in the page(ex: Move the company address from top left corner to Bottom right corner).
    In order to achieve this
    1.We created blank rtf template and upload to XML repository using P95600 application
    2.Create report definition using P95620 application
    3.Here I see the available output types as PDF,RTF,HTML,EXCEL,POWERPOINT and XML,ETEXT(GRAYED OUT)
    Which output type we can use for CSV ?
    4.Execute the report definition of the critical date report from P95620 to get the XML source
    5.This XML source will be loaded into the blank rtf template
    6.From this point no idea how to design the rtf template in order to get the CSV output.
    7.We did design and output type as excel - but the result data is not in good formatting and alignment*(Headers and footers are repeating).*
    If any one has worked on similar type of requirement,let us know how to do or send a sample XML source,rtf template and how the CSV output will be. Or any document link present in Oracle site will be helpful. Please let me know if you need more details.
    Thanks in Advance.
    Vijay

    Hi Vijay,
    For CSV output, you need an E-text template (not RTF) that's why its grayed out! You can use Excel as output type and have (No headers and footers) , then you can open the file in Excel and store it as CSV. Does not always display correctly though.
    Why are you compelled to use BI publisher? you can use the JDE standard csv output report, (as is used by most EDI systems) of course this may involve a bit of customization if you wants the fields arranged differently.
    -Domnic

  • Changing the seeded rdf report output from text to PDF

    Hi All,
    I am trying to change the seeded report "Print Requisition Report" output from text to PDF. I changed the output format in the concurrent program definition from text to pdf. The report is now getting displayed in pdf format, but the alignment of the fields are changed. The output is not printing as it was printing while in the text output format. The output looks very sloppy, with uneven fonts and too much of text wrapping.
    I tried some formatting and fields are somehow getting displayed but doesnt look in proper format. I am not able to change the font style in the report builder 6i, even if i change it is printing in the same font style with uneven font size. I think reducing the font size might help, but i am unable to change.We are on 11.5.10.2. Please provide your valuable suggestions on how to go about.
    Thanks
    Sarvesh

    Hi Hussein,
    Thanks for the information. After the adjustments in the layout and the font change the report is now getting displayed without any clipping when clicked on view output. But when the same report is printed some characters on the left and and right side is getting clipped. Please help on how to solve this issue.
    Thanks,
    Sarvesh

  • Initial-page-number not working in RTF format output

    A report has a parameter for the page number to start with. In rtf template below code is present
    <?initial-page-number:xdoxslt:ifelse(P_FIRST_PAGE_NUM!=’’,number(P_FIRST_PAGE_NUM),1)?>
    The report page number starts with the value which we pass in p_first_page_num in PDF format but in rtf format output it always starts with 1.
    Is initial-page-number not supported in RTF format output ? If not then what is the alternative?

    the method u followed is fine as need a page number staring from a specify value which u input.
    @section is only for resetting page number to 1 for every group and for that pdf and ppt will be fine but only for rtf u need to use that ( pressing F9).
    u can use @section and initial page number combined but they give u same output as get now. rtf output wont support it will only reset 1 every time
    What ever u do rtf output wont support initial page number code ..........
    i mentioned that F9 work around to mention that it is the only work around u have upto now to control rtf output with regards to page number.
    Guru's correct me if i am wrong. wait for a day or two if some one from guru's confirm it .
    If u need real confirmation raise an SR oracle will let u know .

  • How can I save a page and all its component parts in a single file, like IE does as an MHT - it's much easier for mailing to people where page address not available?? (as in output from an airline booking site, for example)

    how can I save a page and all its component parts in a single file, like IE does as an MHT?
    It's much easier for mailing to people where page address not available?? (as in output from an airline booking site, for example)
    It is simply too painful to have to zip everything up into a single file to send. MHT format has been available for years now from IE, and with every new FF release it's the first thing I look for. I have been using FF for years, and hate having to come out of it, over into IE |(which I even took out of startup) and key everything in again, in order to send somebody something in a convenient format that they can open with a single click.
    I can't believe this hasn't been asked before, so have you looked at it and rejected it? Have MS kept the file format secret?
    Thanks
    MG

    This is not really an answer just my comments on your question.
    I am sure I recollect efforts being made to get mhtml to work with FF.
    Probably the important thing to remember about .mhtml is that if other browsers do support it they may need addons, and may not necessarily render the content correctly/consistently.
    There are FF addons designed for archiving webpages, you could try them, but that then assumes the recipient has the same software.
    You could simply save the page from FF to your XP pc; then offline open it with and save it using IE, before then emailing using FF, and attaching the .mht or mhtml file that you have now created on your PC.
    As an alternative method, in some cases it could be worth considering taking a screen grab of the required page, then sending that to the recipient as a single email attatchment using either a bitmap or jpeg file format for instance.
    Something such as an airline booking may be designed with a print option, possibly it could be worthwile looking at sending the print file itself as an email attachment.

  • How to Get HTML Cell in red depending on a condition while getting a output from Sharepoint powershell

    In Below Script I am able to get "disksizerequired" number in red by below script but I want that whole Cell to be red.
    Please let me know how to do it
    # HTML code to format output
    $b = "<style>"
    $b = $b + "BODY{background-color:white;}"
    $b = $b + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
    $b = $b + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}"
    $b = $b + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;}"
    $b = $b + "</style>"
    # Variable initializing to send mail
    $TXTFile = "C:\Abhishek\test\test231.html"
    $SMTPServer = "mapintmail.lab.com" 
    $emailFrom = "[email protected]
    $emailTo = "[email protected]
    $subject = "Sharepoint Farms Content databases Report" 
    $emailBody = "Dailyreport on Sharepoint Farms Content databases"
    $encrypted ="01000000d08c9ddf0115d1118c7a00c04fc297eb0100000097606a1d1a7321488a23f2056c613f690000000002000000000003660000c000000010000000ebf48a9bd08c88a4de367597a1b86b390000000004800000a0000000100000006fa6c5ca0af8ad180e19cc6e5a42765e200000009a2551a74c5da425a1fa63705d1d7469fa0bb94409bf9a43ba951ee5c64d7ff614000000c9c659511fda53078b9f2e00f3b673349962affa"
    $usser1 = "lab\abhi"
    $usser2 = "labb\abhi"
    $password = ConvertTo-SecureString -string $encrypted
    $cred1 = new-object -typename System.Management.Automation.PSCredential -argumentlist $usser1,$password
    $cred2 = new-object -typename System.Management.Automation.PSCredential -argumentlist $usser2,$password
    # Creating PSSession and Loading Snapin
    $s1 = New-PSSession -Authentication CredSSP -Credential $cred1 -ComputerName LROSHRPTL01
    $s2 = New-PSSession -Authentication CredSSP -Credential $cred2 -ComputerName LROSHRPTL03
    Invoke-Command -Session $s1 -ScriptBlock {Add-PSSnapin Microsoft.SharePoint.PowerShell}
    $f1 = Invoke-Command -Session $s1 -ScriptBlock {Get-SPWebApplication | Get-SPContentDatabase}
    $g1 = $f1 | Select-Object DisplayName,WebApplication,disksizerequired,CurrentSiteCount,WarningSiteCount,MaximumSiteCount | ConvertTo-Html -Fragment DisplayName,WebApplication,CurrentSiteCount,WarningSiteCount,MaximumSiteCount,@{label="disksizerequired";expression={
     if($_.disksizerequired -gt 1024*1204*1024)
     {"#font"+$_.disksizerequired+"font#"} 
     else
     {$_.disksizerequired}
    $g1 = $g1 -replace "#font","<font color='red'>"
    $g1 = $g1 -replace "font#","</font>"
    Invoke-Command -Session $s2 -ScriptBlock {Add-PSSnapin Microsoft.SharePoint.PowerShell}
    $f2 = Invoke-Command -Session $s2 -ScriptBlock {Get-SPWebApplication | Get-SPContentDatabase}
    $g2 = $f2 | Select-Object DisplayName,WebApplication,disksizerequired,CurrentSiteCount,WarningSiteCount,MaximumSiteCount | ConvertTo-Html -Fragment DisplayName,WebApplication,CurrentSiteCount,WarningSiteCount,MaximumSiteCount,@{label="disksizerequired";expression={
     if($_.disksizerequired -gt 1024*1024*1024)
     {"#font"+$_.disksizerequired+"font#"} 
     else
     {$_.disksizerequired}
    $g2 = $g2 -replace "#font","<font color='red'>"
    $g2 = $g2 -replace "font#","</font>"
    ConvertTo-HTML -head $b -Body "<h1>$(Get-Date) Sharepoint Farm Database Content DB Report</h1> <br /> <h2>SharePoint_Config_UAT2010 $g1 SharePoint_Config_Intranet2010  $g2</h2>" | Out-File C:\Abhishek\test\test231.html 
    Invoke-Expression C:\Abhishek\test\test231.html
    # Code to Send Mail
    Send-MailMessage -SmtpServer $SMTPServer -From $emailFrom -To $emailTo -Subject $subject -Body $emailBody -Attachment $TXTFile

    If I understand the script correctly, what it will be doing at the moment is setting the font colour to red, instead of the background colour. To do this, you'd normally have to sent the attribute on the <td bgcolor='red'>, rather than using <font
    color='red'>, but you might try using a span instead.
    $g2 = $g2 -replace "#font","<span style='background-color:red;'>"
    $g2 = $g2 -replace "font#","</span>"
    If this isn't what you're looking for (because there may be an untidy margin around the span, or something), you'll need to give the <td> a classname, and then change the css for that class within $b instead. Let me know if you prefer to try that.
    OWA For SmartPhone

  • Reading the output from a object running in the local machine.

    Reading the output from a object running in the local machine.
    By using a signed applet i am lunching a small application that returns an image object, how to read that without storing it in the hard disk.
    Which means i need to read the image object return by the local application using applet or jsp .
    i am using tomacat and an html page with an applet with it to lunch the application.

    You can write that image in a binary format using OutputStream for System.out and then read it in your applet.

  • .CSV output from Oracle reports 10g (from Oracle application)

    Dear all,
    I have a requirement to give an Oracle 10g report which will be deployed in Oracle RMS application.
    When the report is run thru the application, it should give the output in .CSV format.
    But, by default when the report is run thru the application, its giving the output in PDF format.
    Can any one help me in this and guide me how to get a .csv output from the Oracle reports in the RMS application.
    Thanks,
    Suma

    pls reply

  • How can I export formatted text from a string indicator?

    Does someone know how I can export formatted text (i.e., parts of the text have different formatting, such as color, fontsize, etc.) from a string indicator? Using copy/paste does not work, as it only exports unformatted plain text.

    Hello Sparti,
        Thank you for your suggestions, they are all very useful, and I plan to use the HTML feature under Report Generation to export the formatted text from Labview. However, I am still not sure how I can extract the formatted text from a *string indicator* and transfer it to one of those VIs, so that it can be exported to other applications. Let me give some more specific info on what I am trying to achieve:  I am monitoring the communication between two pieces of equipment. A string indicator shows all the data flow, with different colors for data coming from different instruments. I managed to do that by using a property node and playing with the selection and font color properties. Now, if you just wire the output of the string indicator, the formatting is gone and all you get is just plain black text (for instance, try to programmatically transfer the formatted text from one string indicator to a different string indicator and you will see that the formatting is not preserved). Even if you try the "brute force" method of manually selecting and copying the text in the indicator and pasting it to Word, LV does not export the formatting. But, if you paste *within*  LV (for example, paste it to a string constant in your diagram), then it works. To extract the formatted string from the indicator, I also tried to use a property node, but without success. I am trying to avoid duplicating part of my code to generate the same color-coding scheme on a report. It would be way easier to be able to transfer the formatted text from the string indicator. This is particularly annoying, because the information is there, stored in the data structure associated with the string indicator. But how can I put my hands on it? Any ideas?

Maybe you are looking for