Skip to content

PowerShell Module to interact with Lansweeper Database

License

Notifications You must be signed in to change notification settings

EvotecIT/PSLansweeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PSLansweeper - PowerShell Module

PSLansweeper is small module (about 80 lines of code) that interacts with Lansweeper SQL Database. It does need direct access to SQL.

Changelog

Usage

Import-Module PSLansweeper

$Test = Get-LansweeperReport -SqlInstance "LANSWEEPER.AD.EVOTEC.XYZ" -Report WindowsAutomaticUpdateSettingsAudit
$Test | Format-Table *

$Test = Get-LansweeperReport -SqlInstance "LANSWEEPER.AD.EVOTEC.XYZ" -Report WindowsAutomaticUpdateSettingsAudit,MicrosoftPatchTuesdayAuditJuly2019
$Test.WindowsAutomaticUpdateSettingsAudit | Format-Table -AutoSize
$Test.MicrosoftPatchTuesdayAuditJuly2019 | Format-Table -AutoSize

Example 1

Get-LansweeperReport -SqlInstance "LANSWEEPER.AD.EVOTEC.XYZ" -Report SoftwareLicenseKeyOverview | Format-Table -Autosize
Get-LansweeperReport -SqlInstance "LANSWEEPER.AD.EVOTEC.XYZ" -Report InstalledWindowsUpdates | Format-Table -Autosize

Image

Example 2

Get-LansweeperReport -SqlInstance "LANSWEEPER.AD.EVOTEC.XYZ" -Report AdobeJulySecurityUpdateVulernabilityAudit

Image

Example 3

Get-LansweeperReport -SqlInstance "LANSWEEPER.AD.EVOTEC.XYZ" -Report ComputerProcessorInformation,AllServerTypes

Image

To install

Following way uses PowerShellGallery to install module. When I publish modules to PSGallery those modules are optimized for speed (minified)

Install-Module -Name PSLansweeper -AllowClobber -Force

Force and AllowClobber aren't really nessecary but they do skip errors in case some appear (like conflict with other modules).

And to update

Update-Module -Name PSLansweeper

That's it. Whenever there's new version you simply run the command and you can enjoy it. Remember, that you may need to close, reopen PowerShell session if you have already used module before updating it.

The important thing is if something works for you on production, keep using it till you test the new version on a test computer. I do changes that may not be big, but big enough that auto-update will break your code. For example, small rename to a parameter and your code stops working! Be responsible!

Credits

  • Marcus Dean created LansweeperPS PowerShell module which does similar thing. He's also inspiration for this little project as per this Reddit thread.

3rd Party Notices

  • All SQL code available in Reports folder is copied from Lansweeper Report or Lansweeper Community Forum. This means that all SQL content is work of someone else. They made those reports. I just made them easily available in this PowerShell Module.