• 获取系统信息脚本。


    1.总的信息:

    systeminfo

    msinfo32

    2.磁盘空间:

    (powershell)Get-WmiObject -query "Select * from Win32_logicaldisk" |Ft

    3.已安装的软件包

    wmic product get /format:csv > c: mpfilename.csv

    4.已安装的角色和特性

    4.1 方法一

    servermanagercmd –query

    参考:servermanagercmd的介绍:

    http://www.windowsnetworking.com/articles-tutorials/windows-server-2008/Windows-Server-2008-Servermanagerexe-CLI-tool-Add-Remove-Server-Roles.html

    (注:only windows server 2008)

    image

    4.2 方法二 (通用-需要powershell)

    查询所有安装的Role和特性

    Import-module servermanager ; Get-WindowsFeature | where-object {$_.Installed -eq $True} | format-list DisplayName
    查询特定feature(范例hyper-v特性)
    Import-module servermanager ; (Get-WindowsFeature -name hyper-v).Installed 
     
    image

    5.列出所有共享权限

    wmic share get caption,name,path

    (导出文件)/output:d:Shared.txt share get caption,name,path

    (导出HTM)/output:d:Shared.htm share get caption,name,path

    image

    image

    also see : http://www.cnblogs.com/jjkv3/p/3207983.html

    6.CPU信息

    wmic cpu get name

    wmic cpu list brief

    wmic cpu list full

    image

    7.防火墙状态

    netsh advfirewall show allprofile

    image

    8.计划任务清单

    方法1:dir /b "%SystemRoot% asks"

    方法2:powershell脚本

    $strComputer = "."
    $colItems = get-wmiobject -class "Win32_ScheduledJob" -namespace "rootCIMV2" `
    -computername $strComputer
    foreach ($objItem in $colItems) {
    write-host "Caption: " $objItem.Caption
    write-host "Command: " $objItem.Command
    write-host "Days Of Month: " $objItem.DaysOfMonth
    write-host "Days Of Week: " $objItem.DaysOfWeek
    write-host "Description: " $objItem.Description
    write-host "Elapsed Time: " $objItem.ElapsedTime
    write-host "Installation Date: " $objItem.InstallDate
    write-host "Interact With Desktop: " $objItem.InteractWithDesktop
    write-host "Job ID: " $objItem.JobId
    write-host "Job Status: " $objItem.JobStatus
    write-host "Name: " $objItem.Name
    write-host "Notify: " $objItem.Notify
    write-host "Owner: " $objItem.Owner
    write-host "Priority: " $objItem.Priority
    write-host "Run Repeatedly: " $objItem.RunRepeatedly
    write-host "Start Time: " $objItem.StartTime
    write-host "Status: " $objItem.Status
    write-host "Time Submitted: " $objItem.TimeSubmitted
    write-host "Until Time: " $objItem.UntilTime
    write-host
    }

    9.性能状态

    wmic cpu get loadpercentage

    perfmon  /sys

    参考:http://blogs.technet.com/b/heyscriptingguy/archive/2011/02/01/use-powershell-to-check-your-server-s-performance.aspx

  • 相关阅读:
    Mongodb-SpringData
    Node-Vue
    SpringBoot-SpringCloud
    WebSocket-WebService
    Scala_学习
    GO_学习
    页面分页
    页面分页
    如何将域名部署到Tomcat中,用域名访问服务器
    如何将域名部署到Tomcat中,用域名访问服务器
  • 原文地址:https://www.cnblogs.com/jjkv3/p/3242711.html
Copyright © 2020-2023  润新知