cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Robert_sogica
Engaged Sweeper

Hello,

I would like to create two reports to obtain all local users and which group they belong to; one for Windows servers and another for Linux servers.

1 ACCEPTED SOLUTION
5 REPLIES 5
Mister_Nobody
Honored Sweeper II

It useless for linux but we have such query:

 

Select Top 1000000 tblassets.AssetID,
  tblassets.AssetName,
  tblLinuxSystem.OSRelease,
  tblassets.IPAddress,
  tblassets.Lastseen,
  tblassets.Lasttried,
  tblLinuxGroup.Name,
  tblLinuxGroup.GroupId,
  tblLinuxUser.UserName,
  tblLinuxUser.HomeDirectory
From tblassets
  Inner Join tblLinuxSystem On tblassets.AssetID = tblLinuxSystem.AssetID
  Inner Join tblLinuxGroup On tblassets.AssetID = tblLinuxGroup.AssetId
  Left Join tblLinuxUser On tblassets.AssetID = tblLinuxUser.AssetId And
      tblLinuxUser.UserName = tblLinuxGroup.Name
Where tblLinuxGroup.GroupId > 999 And tblLinuxGroup.GroupId < 2000 
Order By tblLinuxGroup.name

 

Thank you, this query only returns a few servers, not all of them.  I have one to list just the users, and that works ok.  I just don't know how to add the groups in the query.

Select Top 1000000 tblassets.AssetID,
tblassets.AssetName,
tblLinuxUser.UserName,
tblLinuxUser.Type,
tblLinuxUser.Comment,
tblassets.Domain,
tblassets.IPAddress,
tblassets.Description,
tblLinuxSystem.OSRelease,
tblassets.Lastseen,
tblassets.Lasttried,
tblLinuxUser.LastChanged,
tblLinuxUserLogon.Port,
tblLinuxUserLogon.IpAddress As IpAddress1,
tblLinuxUserLogon.LogonTime
From tblassets
Inner Join tblLinuxUser On tblassets.AssetID = tblLinuxUser.AssetId
Inner Join tblLinuxSystem On tblassets.AssetID = tblLinuxSystem.AssetID
Left Join tblLinuxUserLogon On tblLinuxUser.Id = tblLinuxUserLogon.Id
Where tblLinuxUser.HomeDirectory Like '/home/%'

I didn't try this one because it specified AD users, and not all of our servers are on AD domain.  The query returns non-AD servers also, however, which is just what I am looking for, thank you!