Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
stuffelse
Engaged Sweeper

I have a GPO that deletes two unnecessary local user accounts we no longer need, and I need to track progress.

I can't seem to create a report or manipulate existing ones I find to simply lists computers where these users exist. The users are similarly named, for example "SampleTech" and "Sample Tech" with a space in the middle. A statement saying the username contains "Sample" would work for my needs.

I've found reports that contain what I want, but they gather far too much information and they're slow to interact with. I'm not strong enough at SQL to manipulate them to be more direct and concise.

Thanks!

1 ACCEPTED SOLUTION
Mister_Nobody
Honored Sweeper III

Try this:

Select Distinct Top 1000000 tblAssets.AssetName,
  tblAssets.IPAddress,
  tblAssets.Domain As ComputerDomain,
  tblUsers.Name As Username,
  tblUsers.Fullname,
  Case
    When tblUsers.Disabled = 1 Then 'Yes'
    Else 'No'
  End As IsDisabled,
  tblUsers.SID,
  tblAssets.AssetID
From tblAssets
  Inner Join tblUsers On tblAssets.AssetID = tblUsers.AssetID
Where tblUsers.Name Like '%Sample%'
Order By ComputerDomain,
  tblAssets.AssetName

View solution in original post

2 REPLIES 2
Mister_Nobody
Honored Sweeper III

Try this:

Select Distinct Top 1000000 tblAssets.AssetName,
  tblAssets.IPAddress,
  tblAssets.Domain As ComputerDomain,
  tblUsers.Name As Username,
  tblUsers.Fullname,
  Case
    When tblUsers.Disabled = 1 Then 'Yes'
    Else 'No'
  End As IsDisabled,
  tblUsers.SID,
  tblAssets.AssetID
From tblAssets
  Inner Join tblUsers On tblAssets.AssetID = tblUsers.AssetID
Where tblUsers.Name Like '%Sample%'
Order By ComputerDomain,
  tblAssets.AssetName

Works exactly as I want! Thank you!

Reports & Analytics

Ask about reports you're interested in and share reports you've created. Subscribe to receive daily updates of reports shared in the Community.

New to Lansweeper?

Try Lansweeper For Free

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

Try Now