Custom Data Windows Modern

C
Carmadi
PT. SATYA AMARTA PRIMA

Hi team,

I want to try creating custom data to display a list of USBs installed on the Windows device, but the USB list still doesn't appear. The following are the settings I use:
BUILD TYPE : STDOUT
STDOUT : c:\windows\sysnative\windowspowershell\v1.0\powershell.exe Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^USB' } | select-string "COM"
Data Type: String

Are there any of my settings that are wrong?

a year ago
Windows
ANSWERS
RC
Raymond Chan Diamond Contributor
a year ago

Have you checked (e.g. in a remote control session or directly on your device screen) the output of your command "c:\windows\sysnative\windowspowershell\v1.0\powershell.exe Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^USB' } | select-string "COM" on youtr targeted device i?

Are there long strings of output in your test(s)?

If the output is null, Is there a possibility that the specified path for powershell.exe is incorrect?

Also, have you tried using other simple command to try out the custom-data mechanism on your device(s)?

C
Carmadi
a year ago

Hi Raymond,

I have tried testing via send script  Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^USB' } | select-string "COM" and the results appear.

I also tried the custom data test as in the soti documentation https://www.soti.net/mc/help/v2024.0/en/console/reference/dialogs/devicesettings/custom_data__windows_modern.html, I created custom data to display bitlocker status c:\windows\sysnative\windowspowershell\v1.0\powershell.exe manage-bde -status | Findstr Conversion, and it works.

After I tried and looked at the script structure, I tried to combine it with the script to display the USB list. c:\windows\sysnative\windowspowershell\v1.0\powershell.exe Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^USB' } | select-string "COM". and it doesn't work.

the conclusion is that when I try send script Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^USB' } | select-string "COM" it works. How do I display the results in custom data?

ZC
Zafer Cigdem
a year ago

Hi Carmadi,

I did not face this kind of request yet, but just fyi, you may also check out whether to get this information from "Registry Editor" ;regedit.

I saw something from microsoft page as : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB

So you may check out something like:

Registry hive: HKEY_LOCAL_MACHINE

 

Key path: SYSTEM\CurrentControlSet\Enum\USB\

I hope it helps. Thank you

 

C
Carmadi
a year ago

Hi Zafer,

Can the information be displayed using custom data on Soti?

ZC
Zafer Cigdem
a year ago
C
CKMOD@SOTI
a year ago

Hi Carmadi,
 
Thanks for posting on SOTI Pulse, Thanks Raymond and Zafer
for responding to the post, your expertise and willingness to help are greatly appreciated!
 
Have you had an opportunity to test the suggested solutions by Raymond and Zafer and has it successfully addressed your query?
 
If not, or If you have any additional questions or concerns, please don't hesitate to reach out. We're dedicated to providing assistance and support.

C
Carmadi
a year ago

I have tried the suggestions above but they still cannot answer my problem.

Is it true that custom data in modern Windows cannot produce long script results? I tried sending the script Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^USB' } | select-string "COM" to a modern windows device and the output appears. after that I tried to enter the script in custom data and it didn't work.