Showing results for 
Show  only  | Search instead for 
Did you mean: 
Engaged Sweeper

Currently no function is available to have lansweeper natively discover the serial numbers or any other information regarding Dell docking stations. My solution is a bit lengthy, but it got the results I needed. 

TL:DR end result is a custom field titled "Docking Station" being filled with the serial number of the docking station plugged in to that computer that day. 

1. You need to have "Dell Command Monitor" installed on dell laptops. It will do forced restart on silent install so the "norestart" is necessary since the data we need will be compiled without reboot.

This is the deployment I set up for that:

<Name>32Dell Command Monitor</Name>
<MSIParameters>/i /qn /norestart</MSIParameters>
<Command>msiexec.exe /q /i "{PackageShare}\Installers\Dell\Command_Monitor_x64.msi" /norestart</Command>
<Conditions />
<Name>Registry Script</Name>
<Command>powershell.exe -executionpolicy unrestricted -file "{PackageShare}\Scripts\DockRegistry.ps1"</Command>
<Conditions />

2. The powershell script that I have running on the second step calls the new information that is now available through the install of command monitor, and creates a registry key with the relevant data. Computer Name, Current User, Dock Service Tag.


$output = Get-CimInstance -Namespace root\dcim\sysman -ClassName DCIM_Chassis | Where-Object {$_.Name -eq "WD19TB"} | select Tag,Name | ForEach-Object {
$computer = $_.Name
$computerInfo = Get-WmiObject -Class Win32_ComputerSystem
$userInfo = Get-WmiObject -Class Win32_ComputerSystem | Select-Object UserName
'ComputerName' = $computerInfo.Name
'User' = $userInfo.UserName
'Tag' = $_.Tag
$output | ForEach-Object {
New-Item -Path "HKLM:\Software\ReportValues" | Out-Null
New-ItemProperty -Path "HKLM:\Software\ReportValues" -Name "ComputerName" -Value $_.ComputerName -PropertyType String -Force
New-ItemProperty -Path "HKLM:\Software\ReportValues" -Name "User" -Value $_.User -PropertyType String -Force
New-ItemProperty -Path "HKLM:\Software\ReportValues" -Name "DockST" -Value $_.Tag -PropertyType String -Force

3. I then created a registry scan for the "Report Values\DockST" so that I get the service tag of the dock as a value in the lansweeper database.

(The next part is messing with the lansweeper DB which is frowned upon by the devs. So always backup before doing anything even if it's this basic.) 

4. This only works if you have the lansweeper DB on a true SQL instance since you need to run a script against the DB.

This script takes the result from the Registry scan and plugs it in to first Custom field for an asset if it has an entry.

UPDATE dbo.tblAssetCustom
SET dbo.tblAssetCustom.Custom1 = dbo.tblRegistry.value
FROM dbo.tblAssetCustom INNER JOIN dbo.tblRegistry
ON dbo.tblAssetCustom.AssetID = dbo.tblRegistry.AssetID
WHERE tblRegistry.Regkey LIKE '%ReportValues%'

When I confirmed it worked I just changed the display name for the field to "Dock Service Tag".

Now that all of this is put together, and you know where to find everything. One thing that can be done is to attach the powershell script to the event 9002 which is the event for when a thunderbolt device is attached. Then set the db copy job to go off after scans.

Engaged Sweeper II

Dell Docking station scanning should absolutely be included natively in LanSweeper.  Maybe LS should follow this guy's lead.  Any update in the last 14 months since he posted this?  How can we use LanSweeper for our asset management if it can't manage all our assets, and docking stations are an important part of that.  I'd like it to include not only Docking Station serial & model numbers, but also its firmware revision, and both its NIC & Audio driver versions in the asset info.

Lansweeper Tech Support
Lansweeper Tech Support

Hello there!

That's an impressive workaround, indeed. Before running custom database scripts on your database, we do highly recommend taking a backup first:

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now