Collect server daily check reports with PowerShell, and send messages to administrators

Source: Internet
Author: User

Refer to Elephant Brother's blog post, original post address http://hubuxcg.blog.51cto.com/2559426/458065

I was in the elephant Brother's code to add a collection of server system patch options, for everyone to see, a total of two places, listing patches, export to HTML, add code as follows

    1. List patches, I am here to list the last three patches of system installation, you can modify them yourself

[String]$HotfixEvents =get-hotfix-computername $Computer |where{$_. Installedon-ge [datetime] "$ ($today. AddDays (-30)) "} | Select-object-first 3


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/77/67/wKiom1ZnmTSgLhdDAABKxbnbycw763.png "title=" 1.png " alt= "Wkiom1znmtsglhddaabkxbnbycw763.png"/>


2. Exporting to HTML

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/77/66/wKioL1ZnmsjxHFKDAAA8Su-KlVU520.png "title=" 2.png " alt= "Wkiol1znmsjxhfkdaaa8su-klvu520.png"/>

Can look at the effect

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/77/69/wKiom1ZnoJzw9i8iAABGZIDHBh4383.png "style=" float: none; "title=" 3.png "alt=" Wkiom1znojzw9i8iaabgzidhbh4383.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/77/67/wKioL1ZnoQ3yBoncAAAsa_xlECs883.png "style=" float: none; "title=" 4.png "alt=" Wkiol1znoq3yboncaaasa_xlecs883.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/77/68/wKioL1Znom6Br0xzAAWTOiAwhkQ930.png "title=" 5.png " alt= "Wkiol1znom6br0xzaawtoiawhkq930.png"/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/77/69/wKiom1ZnoJ2yNRnsAAAd_xn3zec993.png "style=" float: none; "title=" 6.png "alt=" Wkiom1znoj2ynrnsaaad_xn3zec993.png "/>

Accessories for Elephant Brother's code and I modified the code after

We need to modify the other party is the sender, the recipient, the sender of the server, CC, CC people, if you want to copy more people, it will be used "," "," to separate, and Serverlist.txt file, fill in the name of their server, if there are more than one row a list.


This article is from the "green Light Dad" blog, please make sure to keep this source http://lvguangbaba.blog.51cto.com/1271362/1721063

Collect server daily check reports with PowerShell, and send messages to administrators

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.