MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/PowerShell/comments/lwvwcv/powershell_scripts_for_beginners/gpkz0ig/?context=3
r/PowerShell • u/Trojan_Mcadex01 • Mar 03 '21
https://docs.microsoft.com/en-us/powershell/scripting/samples/collecting-information-about-computers?view=powershell-7.1
21 comments sorted by
View all comments
3
When you run:
Get-CimInstance -ClassName Win32_ComputerSystem -Property UserName
You get a load of other information that doesn't have any values. The only value showing is for Username (which is not surprising given the script.)
What would you add to output the values for all the other items listed:
PS C:\Users\Me PC> Get-CimInstance -ClassName Win32_ComputerSystem -Property UserName AdminPasswordStatus : BootupState : ChassisBootupState : KeyboardPasswordStatus : PowerOnPasswordStatus : PowerSupplyState : PowerState : FrontPanelResetStatus : ThermalState : Status : Name : MyUsername PowerManagementCapabilities : PowerManagementSupported : Caption : Description : InstallDate : CreationClassName : NameFormat : PrimaryOwnerContact : PrimaryOwnerName : Roles : InitialLoadInfo : LastLoadInfo : ResetCapability : AutomaticManagedPagefile : AutomaticResetBootOption : AutomaticResetCapability : BootOptionOnLimit : BootOptionOnWatchDog : BootROMSupported : BootStatus : ChassisSKUNumber : CurrentTimeZone : DaylightInEffect : DNSHostName : Domain : DomainRole : EnableDaylightSavingsTime : HypervisorPresent : InfraredSupported : Manufacturer : Model : NetworkServerModeEnabled : NumberOfLogicalProcessors : NumberOfProcessors : OEMLogoBitmap : OEMStringArray : PartOfDomain : PauseAfterReset : PCSystemType : PCSystemTypeEx : ResetCount : ResetLimit : SupportContactDescription : SystemFamily : SystemSKUNumber : SystemStartupDelay : SystemStartupOptions : SystemStartupSetting : SystemType : TotalPhysicalMemory : UserName : MyUsername\Me PC WakeUpType : Workgroup : PSComputerName : CimClass : root/cimv2:Win32_ComputerSystem CimInstanceProperties : {Caption, Description, InstallDate, Name…} CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties
9 u/doog36 Mar 03 '21 Change property from 'username' to * 4 u/TheGift1973 Mar 03 '21 Beautiful.Thank you for this.Very new to all things PS, so thanks for the assist
9
Change property from 'username' to *
4 u/TheGift1973 Mar 03 '21 Beautiful.Thank you for this.Very new to all things PS, so thanks for the assist
4
Beautiful.
Thank you for this.
Very new to all things PS, so thanks for the assist
3
u/TheGift1973 Mar 03 '21
When you run:
You get a load of other information that doesn't have any values. The only value showing is for Username (which is not surprising given the script.)
What would you add to output the values for all the other items listed: