r/Lansweeper • • Jul 08 '19

Lansweeper Powershell Modules

Are there any widely available Powershell modules for querying the Lansweeper databases? I am starting to make my own currently, but if there's already something available I don't want to waste my time. Google tells me no but it's worth asking.

Would Lansweeper Powershell modules interest anybody if I fleshed it out more? In the current iteration (which is maybe a weekend of work) it can pull info from the Assets table by searching an identifier such as name or IP address, and return all the object's properties from the table. Using that info it can also return basic tables showing anything from the assets table (picture below).

If this is useful, I plan to flesh it out a lot more and add the ability to do actual reporting by pulling info from many more tables and creating an object that contains essentially all the info you'd be able to see from a computer or user's page in Lansweeper.

If something similar already exists tho I'd love to know about it tho because the main purpose of making this module is to do my job easier. And what's easier than using someone else's tools?

The pictures, needless to say, are from a LAN in a lab environment.

10 Upvotes

13 comments sorted by

2

u/MadBoyEvo Jul 09 '19

This is cool idea. Please make it open source on GiThub so we fan help if needed :-) and publish on psgallery :-)

1

u/deanm11345 Jul 09 '19

Thank you :) And will do! I'm going to spend the week working on it I think so I can get the most basic functions down, then repost here and on the Powershell subreddit linking to the Github so as I work on it more, hopefully I can get some community help.

I was really just curious if I posted here and there was already a ready made solution

1

u/jaqian Jul 08 '19

You should probably x-post to PowerShell.

2

u/deanm11345 Jul 08 '19

Will do! I appreciate it, kind of new to actually posting on Reddit.

2

u/jaqian Jul 08 '19

No problem, it can take time to get used to it but we're a friendly bunch for the most part :)

1

u/SoulAssassin808 Jul 09 '19

Could you explain a bit more about your use case for this? Any reason you use powershell instead of a Lansweeper report or direct database SQL query?

2

u/deanm11345 Jul 09 '19 edited Jul 09 '19

So personally, I want to be able to do what the guy below said and use the reports for automation :) currently to use the information from reports in Powershell I have to create and download the report in LS, download the data into a csv, and get it into a way that it works with Powershell. Personally, I hate loading info from csv's as well.

Right now I can pull super useful info from LS, and I can automate whatever I want with PS. The goal is to combine those two.

Edit: To answer the other part of your question, this is because I don't know SQL very well myself and have no desire to try to structure a SQL query every time I want some info. The module actually does get the information by using dbatools to query the LS SQL database tho!

1

u/MadBoyEvo Jul 09 '19

Plenty of reasons. Automation based on LS reports?

1

u/SoulAssassin808 Jul 09 '19

I see. I'm still very new to powershell. Do you have a specific goal in mind? Or just trying to see what's possible?

2

u/MadBoyEvo Jul 09 '19

Well, I wrote a lot of different PowerShell modules. From ones that allow creating Word documents, Excel documents, HTML dynamic dashboards to those that allow creating AD, Office 365 and other documentation.

Here's my GitHub repo: https://github.com/EvotecIT/ and my blog https://evotec.xyz/hub/ to give you an idea what I'm "working" on.

So I could use Lansweeper module to get Workstation, get antivirus status, get hardware information, get servers data without asking each and every computer in AD with PowerShell and using what's already is stored in LS.

You could easily use LS report and based on it's finding do some actions, set triggers, and so on. You could further manipulate that data with PowerShell or even double-check it with PowerShell.

1

u/SoulAssassin808 Jul 09 '19

Sounds cool, I'll definitely check out the links.

0

u/[deleted] Jul 09 '19

[deleted]

1

u/deanm11345 Jul 10 '19

I'd love the help man! I'll be making a new post with more details and a link to the Github later this week. I'm working on finishing the basic functions as well as code beautification (I'm definitely still learning) before getting some input. I'm going to open source it because not only would I love the tool to be available to all, but I guarantee that somebody with more talent than myself could add a LOT of functionality.