Jak pobrać opis komputera – Windows PowerShell

W pracy zawodowej, w dużych systemach komputerowych często posługuję się mało znaczącymi nazwami komputerów i serwerów. Często potrzebuje na szybko sprawdzić opis danej maszyny aby zidentyfikować jaką pełnią rolę bez zagłębiania się w dokumentację lub logowania do interesującego mnie komputera. Warto wiedzieć jak pobrać opis maszyny z lokalnych ustawień systemu.

Pobieranie pola „Description” z lokalnego komputera

Aby pobrać opis lokalnego komputera, można posłużyć się komandletem Get-WmiObject pobierając informacje z klasy Win32_OperatingSystem

Get-WmiObject -Class Win32_OperatingSystem |Select Description
PowerShell Get-WmiObject - pobranie opisu komputera
PowerShell Get-WmiObject – pobranie opisu komputera

Pobieranie pola „Description” zdalnego komputera

W podobny sposób można pobrać opis komputera zdalnego. W tym celu do komandletu Get-WmiObject należy dodać parametr -ComputerName

Get-WmiObject -ComputerName nazwa_komputera -Class Win32_OperatingSystem |Select Description
PowerShell Get-WmiObject - pobranie opisu komputera
PowerShell Get-WmiObject – pobranie opisu komputera

Warto też pamiętać, że pełną listę właściwości jakie może zwracać dana klasa można sprawdzić przekazując wynik polecenia to komandletu Get-Member i ewentualnie zawęzić wyszukiwanie do samych właściwości:

Get-WmiObject -ComputerName SCHO0014 -Class Win32_OperatingSystem |Get-Member -MemberType Properties

   TypeName: System.Management.ManagementObject#root\cimv2\Win32_OperatingSystem

Name                                      MemberType    Definition
----                                      ----------    ----------
PSComputerName                            AliasProperty PSComputerName = __SERVER
BootDevice                                Property      string BootDevice {get;set;}
BuildNumber                               Property      string BuildNumber {get;set;}
BuildType                                 Property      string BuildType {get;set;}
Caption                                   Property      string Caption {get;set;}
CodeSet                                   Property      string CodeSet {get;set;}
CountryCode                               Property      string CountryCode {get;set;}
CreationClassName                         Property      string CreationClassName {get;set;}
CSCreationClassName                       Property      string CSCreationClassName {get;set;}
CSDVersion                                Property      string CSDVersion {get;set;}
CSName                                    Property      string CSName {get;set;}
CurrentTimeZone                           Property      int16 CurrentTimeZone {get;set;}
DataExecutionPrevention_32BitApplications Property      bool DataExecutionPrevention_32BitApplications {get;set;}
DataExecutionPrevention_Available         Property      bool DataExecutionPrevention_Available {get;set;}
DataExecutionPrevention_Drivers           Property      bool DataExecutionPrevention_Drivers {get;set;}
DataExecutionPrevention_SupportPolicy     Property      byte DataExecutionPrevention_SupportPolicy {get;set;}
Debug                                     Property      bool Debug {get;set;}
Description                               Property      string Description {get;set;}
Distributed                               Property      bool Distributed {get;set;}
EncryptionLevel                           Property      uint32 EncryptionLevel {get;set;}
ForegroundApplicationBoost                Property      byte ForegroundApplicationBoost {get;set;}
FreePhysicalMemory                        Property      uint64 FreePhysicalMemory {get;set;}
FreeSpaceInPagingFiles                    Property      uint64 FreeSpaceInPagingFiles {get;set;}
FreeVirtualMemory                         Property      uint64 FreeVirtualMemory {get;set;}
InstallDate                               Property      string InstallDate {get;set;}
LargeSystemCache                          Property      uint32 LargeSystemCache {get;set;}
LastBootUpTime                            Property      string LastBootUpTime {get;set;}
LocalDateTime                             Property      string LocalDateTime {get;set;}
Locale                                    Property      string Locale {get;set;}
Manufacturer                              Property      string Manufacturer {get;set;}
MaxNumberOfProcesses                      Property      uint32 MaxNumberOfProcesses {get;set;}
MaxProcessMemorySize                      Property      uint64 MaxProcessMemorySize {get;set;}
MUILanguages                              Property      string[] MUILanguages {get;set;}
Name                                      Property      string Name {get;set;}
NumberOfLicensedUsers                     Property      uint32 NumberOfLicensedUsers {get;set;}
NumberOfProcesses                         Property      uint32 NumberOfProcesses {get;set;}
NumberOfUsers                             Property      uint32 NumberOfUsers {get;set;}
OperatingSystemSKU                        Property      uint32 OperatingSystemSKU {get;set;}
Organization                              Property      string Organization {get;set;}
OSArchitecture                            Property      string OSArchitecture {get;set;}
OSLanguage                                Property      uint32 OSLanguage {get;set;}
OSProductSuite                            Property      uint32 OSProductSuite {get;set;}
OSType                                    Property      uint16 OSType {get;set;}
OtherTypeDescription                      Property      string OtherTypeDescription {get;set;}
PAEEnabled                                Property      bool PAEEnabled {get;set;}
PlusProductID                             Property      string PlusProductID {get;set;}
PlusVersionNumber                         Property      string PlusVersionNumber {get;set;}
PortableOperatingSystem                   Property      bool PortableOperatingSystem {get;set;}
Primary                                   Property      bool Primary {get;set;}
ProductType                               Property      uint32 ProductType {get;set;}
RegisteredUser                            Property      string RegisteredUser {get;set;}
SerialNumber                              Property      string SerialNumber {get;set;}
ServicePackMajorVersion                   Property      uint16 ServicePackMajorVersion {get;set;}
ServicePackMinorVersion                   Property      uint16 ServicePackMinorVersion {get;set;}
SizeStoredInPagingFiles                   Property      uint64 SizeStoredInPagingFiles {get;set;}
Status                                    Property      string Status {get;set;}
SuiteMask                                 Property      uint32 SuiteMask {get;set;}
SystemDevice                              Property      string SystemDevice {get;set;}
SystemDirectory                           Property      string SystemDirectory {get;set;}
SystemDrive                               Property      string SystemDrive {get;set;}
TotalSwapSpaceSize                        Property      uint64 TotalSwapSpaceSize {get;set;}
TotalVirtualMemorySize                    Property      uint64 TotalVirtualMemorySize {get;set;}
TotalVisibleMemorySize                    Property      uint64 TotalVisibleMemorySize {get;set;}
Version                                   Property      string Version {get;set;}
WindowsDirectory                          Property      string WindowsDirectory {get;set;}
__CLASS                                   Property      string __CLASS {get;set;}
__DERIVATION                              Property      string[] __DERIVATION {get;set;}
__DYNASTY                                 Property      string __DYNASTY {get;set;}
__GENUS                                   Property      int __GENUS {get;set;}
__NAMESPACE                               Property      string __NAMESPACE {get;set;}
__PATH                                    Property      string __PATH {get;set;}
__PROPERTY_COUNT                          Property      int __PROPERTY_COUNT {get;set;}
__RELPATH                                 Property      string __RELPATH {get;set;}
__SERVER                                  Property      string __SERVER {get;set;}
__SUPERCLASS                              Property      string __SUPERCLASS {get;set;}

Jak widać powyżej właściwości, o które możemy odpytać lokalny lub zdalny system, jest sporo 🙂

Jeśli chcesz coś dodać od siebie lub masz pokrewny do opisywanego problem, to zachęcam do zostawienia komentarza poniżej.

Dodaj komentarz

Ta strona używa Akismet do redukcji spamu. Dowiedz się, w jaki sposób przetwarzane są dane Twoich komentarzy.

IT, System, Security, Management - Paweł Michalski
Informacja o prywatności

Ta strona korzysta z plików cookie, abyśmy mogli zapewnić jak najlepszą jakość treści. Informacje o plikach cookie są przechowywane w przeglądarce i wykonują takie funkcje, jak rozpoznawanie cię po powrocie do naszej witryny czy pomagają w zrozumieniu, które sekcje witryny są dla Ciebie najbardziej interesujące i przydatne. Więcej możesz przeczytać w polityce prywatności