Created
February 28, 2011 23:17
-
-
Save RhysC/848255 to your computer and use it in GitHub Desktop.
Retrieve details for the machine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Audit script | |
$auditFile = "audit.txt" | |
$computername = "." #i.e local machine | |
"Computer name $computername" > $auditFile | |
"Computer details:" >> $auditFile | |
get-wmiobject Win32_ComputerSystem -computername $computername | | |
select Name, Manufacturer, Model,` | |
NumberOfProcessors, TotalPhysicalMemory, ` | |
Domain, CurrentTimeZone, DayLightInEffect | | |
Format-List| | |
Out-File $auditFile -Append | |
#os details | |
"OS details:" >> $auditFile | |
get-wmiobject Win32_OperatingSystem -computername $computername | | |
select Caption, ServicePackMajorVersion, ServicePackMinorVersion | | |
Format-List| | |
Out-File $auditFile -Append | |
#CLR versions | |
".Net details:" >> $auditFile | |
Get-ChildItem "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP" | Get-ItemProperty| | |
Format-List| | |
Out-File $auditFile -Append | |
#powershell version | |
"PowerShell version:" >> $auditFile | |
$Host.Version >> $auditFile | |
#silverlight version | |
"`r`nSilverlight version:" >> $auditFile | |
(get-itemproperty HKLM:\SOFTWARE\Microsoft\Silverlight Version).Version >> $auditFile | |
#Environment variables | |
"`r`nEnvironment variables:" >> $auditFile | |
[Environment]::GetEnvironmentVariables()| | |
Format-List| | |
Out-File $auditFile -Append |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment