/build/static/layout/Breadcrumb_cap_w.png

Create a report with all assets, connected to one special user

Hello,

I``m  new in Kace scripting and I want to create a report for a special user, with all conneted assets and I´ve no idea how to start. Can you give me a hint.

We like to know the computer (name, service tag, hardware etc.) and all the assests. I´tried to use the report assist, but i failed. For the sql version my knowledge is to bad.


0 Comments   [ + ] Show comments

Answers (1)

Posted by: Hobbsy 2 years ago
Red Belt
0

po0naQQzstZvLLSEXQdforrnyH8BBKpwP2i9VK9qXkASwbPVz1tBW4mkYyArw4UyJpTnYIof8DX41AZM6HENoAAAAASUVORK5CYII=

Try this report code

Select

    DISTINCTUSER.USER_NAME,

    ASSET_TYPE.NAME asASSET_TYPE,

    ASSET_CLASS.NAMEas SUB_TYPE,

    ASSET.NAME,

    as1.NAME AsLOCATION

From

    (ASSET ASSET InnerJoin

    ASSET_TYPEASSET_TYPE On ASSET.ASSET_TYPE_ID = ASSET_TYPE.ID) Inner Join

    USER USER OnASSET.OWNER_ID = USER.ID Inner Join

    ASSET as1 Onas1.ID = ASSET.LOCATION_ID

    LEFT JOINORG1.ASSET_CLASS ASSET_CLASS

          ON(ASSET.ASSET_CLASS_ID = ASSET_CLASS.ID)

WHERE ((ASSET.ASSET_TYPE_ID = 5)

OR (ASSET.ASSET_TYPE_ID = 10201)

OR (ASSET.ASSET_TYPE_ID = 10204)

OR (ASSET.ASSET_TYPE_ID = 10202)

OR (ASSET.ASSET_TYPE_ID = 10206)

OR (ASSET.ASSET_TYPE_ID = 10207)

OR (ASSET.ASSET_TYPE_ID = 10208)

OR (ASSET.ASSET_TYPE_ID = 10209)

OR (ASSET.ASSET_TYPE_ID = 10217)

OR (ASSET.ASSET_TYPE_ID = 10219)

OR (ASSET.ASSET_TYPE_ID = 10222)) 

Order By

    USER.USER_NAME,ASSET_TYPE.NAME,LOCATION


You will need to make sure you haver every possible asset type added in, so that's the lines starting OR (ASSET in the WHERE Statement and if you want to run this for only a sibngle user then you will also need to add to the WHERE statement to include something like WHERE USER.USER_NAME = "John Smith"

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ