First Commit

This commit is contained in:
efrick 2021-04-09 10:38:20 -04:00
commit 829f1627a9
3 changed files with 82 additions and 0 deletions

26
README.md Normal file
View File

@ -0,0 +1,26 @@
# Sysinfo
A script to output to output basic system information.
## Usage
1. Download the `.bat` file.
2. Run from `CMD` with `C:\Path\to\sysinfo.bat`
## Features
It currently outputs:
* The Hostname
* The CPU name
* The OS Version
* The system's serial number
* The model name of the system
## Dependencies
Uses `echo` and `wmic`.
## `sysinfo.ps1`
This is currently under development. Don't use it.

13
sysinfo.bat Normal file
View File

@ -0,0 +1,13 @@
ECHO off
REM sysinfo.ps1
REM Inumerate a systems processor, serial number, modle number, and ammount of RAM.
echo Hostname
wmic computersystem get name
echo CPU name
wmic cpu get name
echo OS Type
wmic os get Caption
echo System Serial Number
wmic bios get serialnumber
echo System Model Name
wmic csproduct get name

43
sysinfo.ps1 Normal file
View File

@ -0,0 +1,43 @@
#sysinfo.ps1
#Inumerate a systems processor, serial number, modle number, and ammount of RAM.
echo "Hostname"
wmic computersystem get name
echo "CPU name"
wmic cpu get name
echo "OS Type"
wmic os get Caption
echo "System Serial Number"
wmic bios get serialnumber
echo "System Model Name"
wmic csproduct get name
# wmic computersystem get name; wmic cpu get name; wmic os get Caption;wmic bios get serialnumber; wmic csproduct get name
#Get-ServerInformation.ps1
#-------------------
#$serversOuPath = 'OU=Servers,DC=powerlab,DC=local'
#$servers = Get-ADComputer -SearchBase $serversOuPath -Filter * |
#Select-Object -ExpandProperty Name
#foreach ($server in $servers) {
# $output = @{
# 'ServerName' = $null
# 'IPAddress' = $null
# 'OperatingSystem' = $null
# 'AvailableDriveSpace (GB)' = $null
# 'Memory (GB)' = $null
# 'UserProfilesSize (MB)' = $null
# 'StoppedServices' = $null
# }
# $getCimInstParams = @{
# CimSession = New-CimSession -ComputerName $server
# }
# $output.ServerName = $server
# $output.'UserProfilesSize (MB)' = (Get-ChildItem -Path "\\$server\c$\
# Users\" -File | Measure-Object -Property Length -Sum).Sum
# $output.'AvailableDriveSpace (GB)' = [Math]::Round(((Get-CimInstance @getCimInstParams -ClassName Win32_LogicalDisk).FreeSpace / 1GB),1)
# $output.'OperatingSystem' = (Get-CimInstance @getCimInstParams -ClassName Win32_OperatingSystem).Caption
# $output.'Memory (GB)' = (Get-CimInstance @getCimInstParams -ClassName Win32_PhysicalMemory | Measure-Object -Property Capacity -Sum).Sum /1GB
# $output.'IPAddress' = (Get-CimInstance @getCimInstParams -ClassName Win32_NetworkAdapterConfiguration -Filter "IPEnabled = 'True'").IPAddress[0]
# $output.StoppedServices = (Get-Service -ComputerName $server | Where-Object { $_.Status -eq 'Stopped' }).DisplayName
# Remove-CimSession -CimSession $getCimInstParams.CimSession
# [pscustomobject]$output
#}