commit 829f1627a9fd00486e913293c3770f2b4c97d1f4 Author: efrick Date: Fri Apr 9 10:38:20 2021 -0400 First Commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..921b8a4 --- /dev/null +++ b/README.md @@ -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. \ No newline at end of file diff --git a/sysinfo.bat b/sysinfo.bat new file mode 100644 index 0000000..85b65bf --- /dev/null +++ b/sysinfo.bat @@ -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 \ No newline at end of file diff --git a/sysinfo.ps1 b/sysinfo.ps1 new file mode 100644 index 0000000..71e552e --- /dev/null +++ b/sysinfo.ps1 @@ -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 +#} \ No newline at end of file