Hostname,UserName,S...
 
Notifications
Clear all

We appreciate the contributions many of you have been able to make towards repairing the storm damage and keeping a roof over our heads. With your help we’ve been able to complete much of the critical work. There is still work to be done to secure the house and your continued support will be a huge help.

Guests have read-only access to our forums. If you wish to participate you will need to register. Be sure to activate your account from the email sent to you when you register.

[Solved] Hostname,UserName,SerialNumber and Model

7 Posts
3 Users
3 Reactions
2,715 Views
(@vespi)
Eminent Member Registered
Joined: 2 years ago
Posts: 22
Topic starter  

Hello dear community

I would like to display the following parameters on the desktop:-Hostname(computer name)
-Username
-SerialNumber
-Device model

Somehow nothing is displayed to me via the WMI query.

It returns a value via Powershell
"Get-WmiObject -Class Win32_BIOS | Select-Object -ExpandProperty SerialNumber

# Display computer name
WMI=interval:5,hide-no-result:1,text:Computer Name,namespace:root\cimv2,query:SELECT Name FROM Win32_ComputerSystem,display:%Name%

# Display user name
WMI=interval:5,hide-no-result:1,text:User Name,namespace:root\cimv2,query:SELECT UserName FROM Win32_ComputerSystem,display:%UserName%

# Display serial number
EXTERNAL=interval:10,hide-no-result:1,text:Serial Number,command:powershell.exe -NoProfile -ExecutionPolicy Bypass -File Get-SerialNumber.ps1,display:%1

# Display model
EXTERNAL=interval:10,hide-no-result:1,text:Model,command:powershell.exe -NoProfile -ExecutionPolicy Bypass -File Get-Model.ps1,display:%1

Complet:

# Desktop Info by Glenn Delahoy
# Sample configuration file
# See the manual for a full description of all options

[options]
# size and position
top=-1
right=0
bottom=0
left=-1
width=340

# font
font-face=Arial
font-size=10

# logging
log=desktopinfo.log
log-level=debugonerror

[screen-saver]
font-face=Comic Sans MS
font-size=16
centerv=1
centerh=1

[text]
noresults=<n/a>
error=[error]
null-result=<null>
unknown=Unknown
executing=<executing>
menu-export=Export
menu-reload=Reload
menu-configuration=Edit Configuration
menu-log=Open Log File
menu-manual=Read Manual
menu-about=About Desktop Info
menu-quit=Quit
nav-previous=Previous Page
nav-home=Home Page
nav-next=Next Page

[items]

# Display computer name
WMI=interval:5,hide-no-result:1,text:Computer Name,namespace:root\cimv2,query:SELECT Name FROM Win32_ComputerSystem,display:%Name%

# Display user name
WMI=interval:5,hide-no-result:1,text:User Name,namespace:root\cimv2,query:SELECT UserName FROM Win32_ComputerSystem,display:%UserName%

# Display serial number
EXTERNAL=interval:10,hide-no-result:1,text:Serial Number,command:powershell.exe -NoProfile -ExecutionPolicy Bypass -File Get-SerialNumber.ps1,display:%1

# Display model
EXTERNAL=interval:10,hide-no-result:1,text:Model,command:powershell.exe -NoProfile -ExecutionPolicy Bypass -File Get-Model.ps1,display:%1

Can you please help me?

Thank YOU!


   
Glenn
(@glenn)
Member Admin
Joined: 8 years ago
Posts: 1926
 

remove the SELECT clause in WMI items, this is implied. On my system Win32_ComputerSystem doesn't return username. You will have more success using the built in items. I don't know where to get the model from in wmi. Sometimes the OEMINFO item will work.

 

# Display computer name
HOST=interval:5,hide-no-result:1,text:Computer Name

# Display user name
USER=interval:5,hide-no-result:1,text:User Name

# Display serial number
WMI=interval:10,hide-no-result:1,text:Serial Number,namespace:root\cimv2,query:win32_BIOS,display:%SerialNumber%

# Display model
OEMINFO=interval:10,hide-no-result:1,text:Model,display:%2

 


   
(@vespi)
Eminent Member Registered
Joined: 2 years ago
Posts: 22
Topic starter  

Thank you for you reply

I tried around and found this solution 😀 

HOST=,text:Hostname: ,display:%1
USER=set:username,text:User: ,display:%1
WMI=:1,text:SN:,,query:Win32_BIOS,display:%serialnumber%
WMI=:1,text:Model:,,query:Win32_ComputerSystem,display:%Model%

Can the text that is displayed on the desktop be marked somehow so that it can then be copied? Maybe via a web link?

This post was modified 2 years ago by Vespi

   
Glenn reacted
Glenn
(@glenn)
Member Admin
Joined: 8 years ago
Posts: 1926
 

@vespi Looks good.   No the text cannot be copied.


   
(@vespi)
Eminent Member Registered
Joined: 2 years ago
Posts: 22
Topic starter  

Too bad 🙁 

How do I manage to add one empty line as a distance to the next?


   
Glenn
(@glenn)
Member Admin
Joined: 8 years ago
Posts: 1926
 

just add a blank comment item

HOST
COMMENT
USER

   
Vespi reacted
RatboyJim
(@ratboyjim)
Eminent Member Registered
Joined: 2 years ago
Posts: 22
 

I use this for vertical spacing. You can vary the height by changing the font size.

COMMENT=font-size:4,text:|


   
Glenn reacted
Glenn's Page