Is it possible to monitor State change of a .CSV file using powershell scripting ?

Hi All,
I just would like to know Is it possible to monitor State change of a .CSV file using powershell scripting ? We have SCOM tool which has that capability but there are some drawbacks in that for which we are not able to utilise that. So i would like
to know is this possible using powershell.
So if there is any number above 303 in the .CSV file then i need a email alert / notification for the same.
Gautam.75801

Hi Jrv,
Thank you very much. I modified the above and it worked.
Import-Csv C:\SCOM_Tasks\GCC2010Capacitymanagement\CapacityMgntData.csv | ?{$_.Mailboxes -gt 303} | Export-csv -path C:\SCOM_Tasks\Mbx_Above303.csv;
Send-MailMessage -Attachments "C:\SCOM_Tasks\Mbx_Above303.csv" -To “[email protected]" -From “abc@xyz" -SMTPServer [email protected] -Subject “Mailboxex are above 303 in Exchange databases” -Body “Mailboxex are above 303 in Exchange databases" 
Mailboxex - is the line which i want to monitor if the values there are above 303. And it will extract the lines with all above 303 to another CSV file and 2nd is a mail script to email me the same with the attachment of the 2nd extract.
Gautam.75801

Similar Messages

  • Is it possible to extract the contents of any PDF file using Adobe PDF SDK?

    Is it possible to extract the contents of any PDF file using Adobe PDF SDK?
    For Example: There is one pdf file. Let us say xxx.pdf with 32 pages. I am interested in only in a topic present at 10th page. Can I extract this information and save it into another pdf file (means new pdf file)?

    Thanks Irosenth,
    I am actually interested in extract the page and create a new PDF with that page. But still there is a catch that on which basis the page needs to extract either on PAGE number OR on Bookmark basis.
    But here in this scenario assume I am looking for the PDF file, now I want to save only page 5. How can I extract page 5 automatically/programmatuically? Or in simple word how can I get the reference link of page 5?
    Here I am not getting clear picture that Do I need both SDK Adobe & Acrobat to achieve this requirement. And more over you have mentioned that SDK itself is free. But on Adobe side it is mentioned that it is available by license only with this I have another doubt: To work my desktop/system application with Adobe PDF library, this library needs to distribute with the application. So in this case will it be chargeable for each and every deployment.
    Could you please provide me the link from where I can download the SDK? So that I can do some excerise with SDK to figure out the exact flow of functionality to work with my application.

  • Monitor SQL Database mirroring using powershell script

    I am trying use the below powershell script to monitor SQL Database mirroring. The motive here is to determine if there are databases which are in "Disconnected" or "Suspended" mode.
    I am running the script on the Principal Server:
    $returnStateOK = 0
    $returnStateWarning = 1
    $returnStateCritical = 2
    $returnStateUnknown = 3
    $NagiosStatus = ""
    # Load SMO extension
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null;
    # Servers to check
    $sqlservers = @("$env:computername");
    foreach($server in $sqlservers)
    $srv = New-Object "Microsoft.SqlServer.Management.Smo.Server" $server;
    # Get mirrored databases
    $databases = $srv.Databases | Where-Object {$_.IsMirroringEnabled -eq $true -and $_.MirroringStatus -eq "Suspended" -or $_.MirroringStatus -eq "Synchronizing" -or $_.MirroringStatus -eq "Disconnected"
    -or $_.MirroringStatus -eq "None"  -and $_.Name -ne "Master" -and $_.Name -ne "model" -and $_.Name -ne "msdb" -and $_.Name -ne "tempdb"};
    if ($databases -ne $null)
    $databases | Select-Object -Property Name, MirroringStatus | Format-Table -AutoSize;
    exit $returnStateCritical
    } Else {
    Write-Host "All Databaes are Mirrored"
    exit $returnStateOK
    I have Suspended few databases for testing purpose but when I run the above script the output says "All Databaes are Mirrored"
    If I make changes to $database and use it below i.e. I am changing the AND operator to OR after "$_.IsMirroringEnabled -eq $true"
    $databases = $srv.Databases | Where-Object {$_.IsMirroringEnabled -eq $true -or $_.MirroringStatus -eq "Suspended" -or $_.MirroringStatus -eq "Synchronizing" -or $_.MirroringStatus
    -eq "Disconnected" -or $_.MirroringStatus -eq "None"  -and $_.Name -ne "Master" -and $_.Name -ne "model" -and $_.Name -ne "msdb" -and $_.Name -ne "tempdb"};
    I get the below output:
    Name                                                                        
       MirroringStatus
    DB1                                                                    
      Synchronized
    DB2                                                                    
      Synchronized
    DB3                                                                       Synchronized
    DB4                                                                   
    Suspended
    DB5                                                                       Suspended
    DB6                  
         Suspended
    DB7                                                              
            Synchronized
    DB8                                                              
            Synchronized
    I only want the databases which are Suspended or Disconnected to be listed.

    I only want the databases which are Suspended or Disconnected to be listed.
    Hi raul-133,
    Based on your description, to list the databases which are Suspended or Disconnected ,I recommend you execute the following Transact-SQL statements in SQL Server firstly. If you can get the expected results from this query, then use the SQL Server query
    in powershell script. For more details, please review this similar blog:
    Monitor database mirroring.
    Use master
    go
    select d.name, m.mirroring_state_desc
    from sys.database_mirroring m,
    sys.databases d
    where m.database_id = d.database_id and (m.mirroring_state in (0,1))
    For more details about mirroring state, you can review this article:
    sys.database_mirroring (Transact-SQL).
    Thanks,
    Lydia Zhang

  • Changing proxy to PAC file using command line tool ?

    I've asked this before but have not had much luck getting an easy fix.
    I need to change a large number of machines over to using a pac file instead of the current settings for secure and web proxys.
    It's not possible using 10.4 CLI command networksetup but I'm wondering if anyone may have another way of doing this ? Possibly a script or something ???
    Mitch

    The command line tools with ARD do not appear to have any syntax for specifying a PAC file URL nor the syntax to specify Proxies use a PAC file.
    I suggest you look at /Library/Preferences/SystemConfiguration/preferences.plist file. This is where your PAC file settings will be saved. You may be able to programatically alter the file using "defaults write" or some other tool.
    Hope this helps!
    bill
      Mac OS X (10.4.10)   1 GHz Powerbook G4

  • Changing a SQL Report server Database to a new One Using Powershell script

    Hi,
    I have an existing report server (Native Mode) and a pre-configured report server database. I have created a new database and want to assign it new report server database. How can i automate this process using powershell?
    Here is the detail requirement
    If there is a Report Server database seeded on the xxxxx server, follow the below steps:
    ◾Click the Database button on the left. Click on the Change Database button, choose option Choose an existing report server database. Enter the RPT server name (e.g. xxxxxx) in Server Name text box and click Next.
    ◾In the Report Server Database selection, select the ReportServer database. Then click next button to complete the process.
    Any help in this regard will be very much helpfull.
    Sushruta Banerjee

    Hi Sushruta,
    To query export from Report server Database, the scripts below may be helpful for you:
    Export RDL Files from ReportServer Database with PowerShell
    SQL Database Reports with PowerShell
    I hope this helps.

  • Change array index font size using VI scripting

    Hello All,
                         I have a array control in my front panel, I'm wondering is there any way to change that "array index" font size using VI scripting?
    Example:
    1. I have this array
    2. Manually I have changed the font size of the array in "Selection Font" panel as below
    3. Through VI scripting I'm able to control control font size, label font size.,.. But not the index font size. So it looks odd.
    4. I'm expecting to be modify this array as same as picture 1 through VI scripting.
    Note: It may not have any practical application, but some time it will be helpful for the programmers to make a quick drop. If anybody have any idea, please share.
    <Electro Sam>
    ELECTRO SAM
    For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.
    - John 3:16

    Raven - you are right, Actually I'm looking for options to change the font size of the array index.
    Actually we have coding standard to follow. In that, all the front panel controls needs to be in Font size 14 and the size should be 25X120, so I'm trying to write a code which automatically converts the VI FP control sizes to be in standard size.
    I'm not only using one customer VI, I'm handling various customer VIs, so each one VI FP control sizes are different. So I'm developing this utility to standardize the VI's as per the guidelines we have.
    Except this array index most of the VI FP control elements I have handled, Only this array is troubling me.
    Appreciate your support guys, please share your thoughts.
    <ElectroSam>
    ELECTRO SAM
    For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.
    - John 3:16

  • Change alignment in CSV file

    Hi
    I am working on ABAP-CRM 7.0.I am generation a  CSV file by concatenating values with comma from a internal table data.
    I have text coloumn with left aligned. I need to change it  to right aligned.  How to do in abap while generating( while concatenating)  CSV file?
    thanks
    Logu

    Hi Logu,
    You can try this:
    [http://www.watto.org/program/abap/download/Z_RIGHT_ALIGN.abap|http://www.watto.org/program/abap/download/Z_RIGHT_ALIGN.abap]
    Regards,
    Leon

  • Changing HTML to text file using java

    Hi,
    I am doing a project in which i have to read news articles from websites. I have tried XML but for that i need to know which tag has the article in it. Since i have to read from various websites so each site used different tags for different informations.
    Is there anyway that i can change an HTML file into a text file using java. Maybe some command that removes all the HTML tags and gives just the information. Is there anything else that anyone would like to recommend?
    Thanx
    yafis

    Maybe something like this:
    import java.io.*;
    import java.net.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    class GetHTMLText
         public static void main(String[] args)
              throws Exception
              EditorKit kit = new HTMLEditorKit();
              Document doc = kit.createDefaultDocument();
              // The Document class does not yet handle charset's properly.
              doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
              // Create a reader on the HTML content.
              Reader rd = getReader(args[0]);
              // Parse the HTML.
              kit.read(rd, doc, 0);
              //  The HTML text is now stored in the document
              System.out.println( doc.getText(0, doc.getLength()) );
         // Returns a reader on the HTML data. If 'uri' begins
         // with "http:", it's treated as a URL; otherwise,
         // it's assumed to be a local filename.
         static Reader getReader(String uri)
              throws IOException
              // Retrieve from Internet.
              if (uri.startsWith("http:"))
                   URLConnection conn = new URL(uri).openConnection();
                   return new InputStreamReader(conn.getInputStream());
              // Retrieve from file.
              else
                   return new FileReader(uri);
    }

  • Changing /updating an xml file using JAXP(DOM)

    Hello,
    i am fairly new to xml and am using it in my degree project.I am able to retrieve and read data from a fairly large xml file using JAXP(DOM) and/or XMLBeans.I am having difficulties in updating the xml document. Any updation i believe is ito be saved into a new xml document,but dont know how to proceed with it. Any help would be appreciated.
    Following is a snippet of my code using JAXP. Here i am able to retrieve data from the source file.
    File document=new File("C:\\tester.xml");
    try {
    DocumentBuilderFactory factory
    = DocumentBuilderFactory.newInstance();
    DocumentBuilder parserr = factory.newDocumentBuilder();
    Document doc=parserr.parse(document);
    System.out.println(document + " is well-formed.");
    NodeList n2=doc.getElementsByTagName("Top");
    NodeList n3=doc.getElementsByTagName("Base");
    int x=n2.getLength();
    System.out.println("There are " x "players");
    for(int g=0;g<=x;g++)
    System.out.println("Top is" + n2.item(g).getFirstChild().getNodeValue()+" Base is" +n3.item(g).getFirstChild().getNodeValue());
    --------------------------------------------------------------------------------

    Following is my updation code to the dom tree:
    NodeList list=doc.getElementsByTagName("Information");
    for(int i=0; i<list.getLength();i++){
    Node thissampnode=list.item(i);
    Node thisNameNode=thissampnode.getFirstChild();
    if(thisNameNode==null) continue;
    if(thisNameNode.getFirstChild()==null)continue;
    // if(thisNameNode.getFirstChild() !(instanceof org.w3c.dom.Text) continue;
    String data=thisNameNode.getFirstChild().getNodeValue();
    if (! data.equals("0.59")) continue;
    Node newsampNode = doc.createElement("Samp");
    Node newsampTopNode = doc.createElement("Top");
    Text tnNode = doc.createTextNode("0.50");
    newsampTopNode.appendChild(tnNode);
    Element newsampRef = doc.createElement("Ref");
    Text tsr = doc.createTextNode("0");
    newsampRef.appendChild(tsr);
    Element newsampType = doc.createElement("Type");
    Text tt = doc.createTextNode("z");
    newsampType.appendChild(tt);
    Element newsampbase = doc.createElement("Base");
    Text sb = doc.createTextNode("0.55");
    newsampbase.appendChild(sb);
    newsampNode.appendChild(newsampTopNode);
    newsampNode.appendChild(newsampRef);
    newsampNode.appendChild(newsampType);
    newsampNode.appendChild(newsampbase);
    rootNode.insertBefore(newsampNode, thissampnode);
    Here i dont see any changes to the original xml source file.

  • HT204365 Is it possible to monitor a folder for new .pdf files?

    I mostly use my iPad for a few apps and reading my textbooks.  I'd like to be able to put new .pdf files in a particular folder and have iTunes automatically notice so I don't have to drag them over every time.  Is this possible?

    If you install beehive extensions for explorer, you can drag and drop files and folders.

  • In a Conversion file, Using Java Script - IF statement with Greater,Less definitions

    Hail to All Gurus,
    Well, I've been trying to make a conversion file by using if statement of Java script with < , > definitions. unfortunately i got "Evolution error" over and over again.
    Actually i want to convert all dates before 2009 as 2008.12. And the dates which is greater than 2009 will be converted as they are (e.g. 2009.01 or 2010.02 etc.).
    Code is:
    js:if(%external%.toString().substring(0,4)<"200900"){"2008.12"}else{%external%.toString().substring(0,4) + "." + %external%.toString().substring(4,6)}
    SAP EPM version 10.0 SP15 Patch 2
    Build 8586
    Thanks for your help in advance

    Sadi,
    You can write if Statement in transformation not conversion.
    Look at this docs,
    How to Import Master Data and Hierarchies into SAP BusinessObjects BPC 7.5 from SAP NetWeaver BW
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c02d0b47-3e54-2d10-0eb7-d722b633b72e?QuickLink=index&…
    Thanks

  • .How to Change Path to dbf files Using Visual FoxPro ODBC Driver

    Using vb.Net 2008, full Crystal 2008.
    I have a Crystal report that uses a Visual FoxPro File DSN pointing at a folder with dbase (.dbf) files. 
    I need to be able to change the folder location at runtime. In the RDC, one key part of this has been specifying a connection string, such as:
    "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=" & gs_FileDSN_Path & ";Exclusive=No;Collate=Machine;Null=Yes;BackgroundFetch=No;"""""""
    However, I can't find any .NET documentation confirming this syntax and, even more importantly, where does it go?
    I tried 2 variations as:
                    reportTableLogonInfo.ConnectionInfo.Attributes.Collection.Add(New NameValuePair2("Connection String", ls_ConnectionString))
                    reportTableLogonInfo.ConnectionInfo.Attributes.Collection.Add(New NameValuePair2("ConnectionString", ls_ConnectionString))
    Followed later by   TableN.ApplyLogOnInfo(reportTableLogonInfo)before calling
    But I don't know if the correct attribute name is "Connection String", "ConnectionString", or something else.
    I also tried to set the connection string to the QE_ServerDescriptions property, as in:
    reportTableLogonInfo.ConnectionInfo.Attributes.Collection.Add(New NameValuePair2("QE_ServerDescription", ls_ConnectionString))
    None of these variations nr many others seem to work.
    BOTTOM LINE:
    Could someone provide sample code for overriding the dbase files folder location specified by a Visual FoxPro FileDSN?
    Thanks!

    OK, I came to the conclusion that the tables or the report somehow hold on to the File DSN for dear life and I can't change that fact.
    So I'm going to change my approach and instead of changing the connection properties of the tables, I'll modify the properties of the File DSN on the fly.  Ugly, but an OK solution for my use scenario.
    It would still be great to get a code sample for the original question but, it's no longer a burning issue for me.
    It would be nice if the support team created a document describing in detail how to achieve database location changes using .NET for different scenarios. It's a common need and the RDC object model had such a document.

  • Is it possible in firefox to close a browser window/tab using java script without modifying the configuration settings? If YES, please let me know.

    Requirement: On click of button, I want the browser window to be closed.
    Solution: I am calling below java script on "onClick()" event of button.
    function close_window()
    window.close()
    This works in internet explorer but not in Mozilla Firefox. What is the reason behind it. Is there any way out to close the browser window in Mozilla Firefox?

    Can you post a link to a page that opens a pop-up window where a close button doesn't work?
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do not click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Change mode of unix file using ftp

    I want change the unix file permission at the time of ftp.

    Hi
    You should setup a secure anonymous ftp server..
    Modern ftp daemons support all kinds of useful commands, such as chmod, that allow outsiders to undo your careful permission settings. They also have configuration options (WuFTP) to acheive this.
    You should ask your FTP (wu-ftp)server admin to enable extention set.
    Your windows client does not support a chmod command.
    In such case, chmod via the quote command with your client should
    support. Something like
       <b><i>ftp> quote site chmod yyy fileName</i></b>
    where "yyy" is the octal number for the permission
    Hope this helps
    Regards
    Senthil

  • How to export contacts and change vcf to csv file

    I need to export the contacts so I can make updates and import them into my marketing system. iCloud exports in only ,vcf, which cannot be imported anywhere I can find.( that is the entire file, not one contact at a time)  I am very frustrated and don't understand Apple using this format for exporting.Every other application I can think of uses .csv and none takes .vcf for import.
    Help!

    You might want to try an app that can export in CSV format, like My Contacts Backup.

Maybe you are looking for

  • WLSE doesn't seem to notice it when an Aironet device goes down

    WLSE type: 1105, version 2.7 Aironet 1100 devices (267 pieces), IOS 12.2(13)JA4 After the upgrade from version 2.6 to 2.7 we have a problem with the WLSE. Device discoveries and inventories run without a problem, but whenever a device goes down the W

  • Accessing a tab of a specific web page using cfhttp

    Hello, CFers! I need to access a remote page using the cfhttp. To be more specific, I need to access this page: https://sistemas.dnpm.gov.br/SCM/Extra/site/admin/dadosProcesso.aspx?numero=861738&ano=2013 (Sorry, Brazilian government sites works bette

  • Using java.lang.reflect.Method.invoke on a static method?

    This is probably a FAQ, but I am finding it impossible to construct a search which answers this question for me. How do I call java.lang.reflect.Method.invoke on a static (e.g. class) method? Is it even possible? Thanks, dwh

  • Is it possible to assign an AD User to SQL Server Login with a defined set of SQL Server Roles?

    A customer asked me if its possible to define in the Active Directory, the SQL Server Roles that should be automatically assigned to a sql server Login that is mapped to a Windows Account. In short, his idea is: - he creates in the Active Directory a

  • Error messages when starting Dreamweaver

    I keep getting a heap of error messages when I start Dreamweaver and although I've looked under the hood, I'm not sure how to *easily* sort them out. Here's an image of the first message: Unable to find file BL.htm in the Configuration/Floaters direc