PSLansweeper
is small module (about 80 lines of code) that interacts with Lansweeper SQL Database. It does need direct access to SQL.
- 0.0.1 - 2019.07.13
- First Release (draft)
- 0.0.3 - 2019.07.14 - Blog post with description: https://evotec.xyz/using-lansweeper-with-powershell-to-your-advantage/
- First Public release
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
Get-LansweeperReport -SqlInstance "LANSWEEPER.AD.EVOTEC.XYZ" -Report SoftwareLicenseKeyOverview | Format-Table -Autosize
Get-LansweeperReport -SqlInstance "LANSWEEPER.AD.EVOTEC.XYZ" -Report InstalledWindowsUpdates | Format-Table -Autosize
Get-LansweeperReport -SqlInstance "LANSWEEPER.AD.EVOTEC.XYZ" -Report AdobeJulySecurityUpdateVulernabilityAudit
Get-LansweeperReport -SqlInstance "LANSWEEPER.AD.EVOTEC.XYZ" -Report ComputerProcessorInformation,AllServerTypes
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).
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!
- Marcus Dean created LansweeperPS PowerShell module which does similar thing. He's also inspiration for this little project as per this Reddit thread.
- 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.