I am trying to get a report that pulls PCs without a localuser account. I can get this one to find devices that have the account, but using 'Not Like' just lists all the other accounts on the devices.
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblUsers.Name,
tblUsers.Fullname,
tblUsers.Accounttype,
tblUsers.Disabled,
tblUsers.Lockout,
tblUsers.PasswordChangeable,
tblUsers.PasswordExpires,
tblUsers.PasswordRequired,
tblUsers.SID,
tblUsers.Status,
tblUsers.BuildInAdmin,
tblUsers.Lastchanged,
tblAssetCustom.Model
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblUsers On tblAssets.AssetID = tblUsers.AssetID
Where tblUsers.Name = 'localuser' And tblAssetCustom.Model Like 'Think%' And
tblAssetCustom.State = 1
Order By tblAssets.Domain,
tblAssets.AssetName,
tblUsers.Name