cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tdewar1
Engaged Sweeper
We have been using the "computers not seen in 30 days" report to help us clean computers that no longer exisit from AD. But, keeping Lansweeper and AD in sync can be a bit of a chore. Is there a way Lansweeper knows of PCs that are no longer in AD? Is that tracked anywhere?
5 REPLIES 5
HarkinsIT
Champion Sweeper
OK, that makes sense. I think I can get the hang of this. 🙂

Thanks for the assistance.
-Chris
Hemoco
Lansweeper Alumni
the getdate function return the current date, so you can use something like this

SELECT 
tblComputers.Computername,
tblComputers.Lastseen,
tblComputers.Username
FROM
tblComputers
WHERE
tblComputers.Lastseen < getdate()-30
Cobra7
Champion Sweeper
A very basic script would be this:


SELECT TOP 100 PERCENT
tblComputers.Computername,
tblComputers.Lastseen,
tblComputers.Username
FROM
tblComputers
WHERE
tblComputers.Lastseen < '10/05/08'


Of course the problem is that it has a date in it that would have to be changed each time it was run. I know little more SQL than a wombat, but it is a start.

You may find that the SQL builder isn't that bad once you get used to it.

Also if you want to save the report you need to have the top line "SELECT TOP 100 PERCENT ". The report builder puts in only "SELECT" so that took me a while to figure out as well. Another tip is if you have more than one table, you need to link them. You drag the Computername from one table to Computername in the other. Report builder will then make a line. This lets the SQL script know how to merge.

Best of luck.
HarkinsIT
Champion Sweeper
I just became a Premium user today, mainly because of the ability to add custom reports. Honestly, I was hoping the report builder would be a little easier to use, but since my SQL experience is a bit limited, I'm having some difficulties.

I would like to create the report referenced in this topic. I have launched the report builder and located the field "lastchanged" in table "tblADcomputers" and when I view data, I can see the info. How in the heck do I make a usable report out of this?

I apologize for my inexperience, but I think that as soon as I see how a couple of these reports are made, I'll catch on to it pretty quickly.

Thanks.
-Chris
Hemoco
Lansweeper Alumni
This is not tracked because of the historical data needed.
but maybe you can create a query and use the field "lastchanged" in table "tblADcomputers"