Category: Systems

RegistrySystems

Query Remote Registry for Key Value

# Open the specified Registry Hive on a remote machine specified. LocalMachine = HKLM / CurrentUser = HKCU $computer = 'localhost' $w32reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine',$computer) # Open the specific registry key (exclude hive from path) $keypath = 'SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI' $SubKey = $w32reg.OpenSubKey($keypath) # Return data for a specific value $SubKey.GetValue('LastLoggedOnUser') # List all values $SubKey.GetValueNames() # Return data for all values to...
PerformanceSystems

Determine if Hyper-Threading is enabled

Function Check-HyperThreading($ComputerName){ # Get the Processor information for the computer $Proc = Get-WMIObject Win32_Processor -ComputerName $ComputerName # Determine if hyper-threading is enabled $CPUCount = @($Proc).count $NumberOfLogicalProcessors = $($Proc | measure-object -Property NumberOfLogicalProcessors -sum).Sum $NumberOfCores = $($Proc | measure-object -Property NumberOfCores -sum).Sum # Output the results as a PS object [pscustomobject]@{ Computer = $ComputerName CPUCount = $CPUCount NumberOfLogicalProcessors = $NumberOfLogicalProcessors NumberOfCores...