New
#21
desktop,
run this little script for me please and attach file placed on your desktop.
Script:
# ************************************************
# Collects information about your operating system
# Places OSinfo.txt on the desktop
# ************************************************
# Create an empty array to hold objects
$arr = @()
# ######### OS ############################
$os = gwmi win32_operatingsystem
# $e = current element in the following foreach loop
foreach ($e in $OS) {
# Create and populate a hash table for os info
$hash = @{
"OPERATING SYSTEM" = "*" * 40
"OS Version" = $e.caption
"Service Pack" = $e.csdversion
"Installed" = ($e.converttodatetime($e.installdate)).tostring("d")
"Last Bootup" = ($e.converttodatetime($e.lastbootuptime))
"Local Date-Time" = ($e.converttodatetime($e.localdatetime))
"Number of Users" = $e.numberofusers
"OS Architecture" = $e.osarchitecture
"Registered User" = $e.registereduser
"Product ID" = $e.serialnumber
"Service Pack Version" = [string]$e.servicepackmajorversion + "." + [string]$e.servicepackminorversion
"System Drive" = $e.systemdrive
"Windows Directory" = $e.windowsdirectory
} # end of hash array
# create object using hash array
$obj = new-object -type psobject -property $hash |
Select "Operating System", "OS Version", "Service Pack", Installed, "Last Bootup", "Local Date-Time", "Number of Users", "OS Architecture", `
"Registered User", "Product ID","service pack version", "System Drive", "Windows Directory"
# add to result array
$arr += $obj
} # end of foreach loop
$arr > $env:userprofile\desktop\OSinfo.txt
EXIT
EXIT