cls
@echo off
echo "Wait collecting Make, Model, Serial Number, Hostname, and Login Information."
del my_hostname.txt
PowerShell -Command "& {'1.>> Manufacturer: ' | Out-File my_hostname.txt -Append}"
PowerShell -Command "& {Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object Manufacturer | ForEach-Object{$_.Manufacturer} | Out-File my_hostname.txt -Append}"
PowerShell -Command "& {'2.>> Model: ' | Out-File my_hostname.txt -Append}"
PowerShell -Command "& {Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object Model | ForEach-Object{$_.Model} | Out-File my_hostname.txt -Append}"
PowerShell -Command "& {'3.>> Serial Number: ' | Out-File my_hostname.txt -Append}"
PowerShell -Command "& {Get-CimInstance -ClassName Win32_BIOS | Select-Object SerialNumber | ForEach-Object{$_.SerialNumber} | Out-File my_hostname.txt -Append}"
PowerShell -Command "& {'4.>> Hostname:' | Out-File my_hostname.txt -Append}"
PowerShell -Command "& {Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object Name | ForEach-Object{$_.Name} | Out-File my_hostname.txt -Append}"
PowerShell -Command "& {'5.>> Login: ' | Out-File my_hostname.txt -Append}"
PowerShell -Command "& {Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object UserName | ForEach-Object{$_.UserName} | Out-File my_hostname.txt -Append}"
PowerShell -Command "& {Start-Process notepad my_hostname.txt}
0 Comments