Steve Giller Posted January 11, 2017 Posted January 11, 2017 We are importing/updating assets using the asset import tool and SCCM. We use the managedBy attribute in AD to store the asset's assigned owner, and can easily import this into Service Manager. Before I do, my question is; will Service Manager recognise that the CN stored in that field is a user, or will it blindly try and shove the whole CN in there, probably returning a "too long" type error? The Wiki states "h_owned_by":"[UserName]" - when a valid Hornbill User ID (for a Full or Basic User) is passed to this field, the user is verified on your Hornbill instance, and the tool will complete the h_owned_by and h_owned_by_name columns appropriately. however the User ID is the sAMAccountName, not the full CN.
Steve Giller Posted January 13, 2017 Author Posted January 13, 2017 Any information on this? I could really do with moving it forward ...
Gerry Posted January 13, 2017 Posted January 13, 2017 Steve, It will recognise it as a user ID I believe. Gerry
Steve Giller Posted January 26, 2017 Author Posted January 26, 2017 OK Gerry, I'll run it on a test OU and open it up to the full dataset assuming it's successful.
Steve Giller Posted January 26, 2017 Author Posted January 26, 2017 It would appear that it doesn't resolve to the owner (see attached)
Guest Posted January 27, 2017 Posted January 27, 2017 Hi @DeadMeatGF The utility will not automatically strip the full CN - it does need to be passed a user ID in the format of a Hornbill User ID for this to resolve correctly. In my example, I've created a SQL View that is being queried in my utility SQL statement - and the UserName column at the source is showing the user name in the format we have stored in Hornbill: What the Wiki refers to is the fact that this is all that's needed to create the association between a user and an asset - i.e. the utility will take this, and perform a lookup within Hornbill to find the relevant user, populate the h_owned_by/h_used_by attribute with the relevant URN, and auto populate the h_owned_by_name/h_used_by_name with a users name - so that you don't have to try and create these strings/details in your SQL statement or view. This is what h_cmdb_assets table looks like after the utility has imported the above asset: I hope this clears this up! Kind Regards Bob Dickinson
Steve Giller Posted January 27, 2017 Author Posted January 27, 2017 My problem (and to be fair, it is my problem!) is that we have a mixture of sAMAccountName formats from merging with other colleges, so I can't take the CN (which is currently all I have available) and manipulate it so that we have a recognisable Hornbill account name. So taking the start of my CN (CN=steve.giller,OU=General User ...) I could create Giller_S quite easily, but (CN=matthew.peacock,OU=General User ...) would need to be converted to matthew.peacock and obviously you can't have both. Is there any chance of moving the logic from the User Import that calculates the Manager's ID into the Asset Import and applying it to the owner as that seems to work fine?
Steve Giller Posted January 30, 2017 Author Posted January 30, 2017 I've found a JOIN that I can do to pull back the sAMAccountName to match to the Service Manager UserID. However this appears to be working sporadically (see screenshot) Any ideas what I need to tweak to get this sorted, as some are working and appearing in the app as you would expect and others not, so there must be something I'm not doing quite right. In the attached screenshot, Mark has been recognised and now has assets attached, whereas Matthew (owner) and David (user) have the correct IDs but haven't resolved to give names and attach to the assets.
Guest Posted January 31, 2017 Posted January 31, 2017 Hi @DeadMeatGF, So based on your most recent post I've performed a little more testing and I may have found an issue. But just to prove this, could I ask you to see if you experience the same result as me by performing a small test: 1) Pick one of your assets above (e.g. DC023331) - and edit the SQL in your .JSON file to only be selecting that particular asset (its easier to just work with a single asset than all of them) 2) Before running the utility, delete that asset from Hornbill 3) Run the utility - there should be a single asset created (the one you have deleted in the previous step) 4) Check the asset in the Hornbill User App - the Used By and Owned By should be showing correctly. Then check the Database Direct - the h_used_by column should have a "URN" value stored e.g urn:sys:0:Barry Kearney:bmkearney 5) Back in the user app, make an amendment to one of the populated attributes e.g. Change the description. We simply want to force an update of the asset next time the utility is run 6) Run the utility again - the asset should have now been updated 7) Perform the same checks as in step (4). I have noticed on my instance that the Used By and Owned By in the user app have now disappeared, and if you check the Database, the URN format has been overwritten by just the plain user ID If you could do the same and let me know if you have similar results (which I believe you may do looking at the above screenshot), I can look into this further Kind Regards Bob
Steve Giller Posted January 31, 2017 Author Posted January 31, 2017 Check Check Check - one asset created Check - h_used_by, h_used_by_name, h_owned_by, h_owned_by_name all populated correctly Check - updated h_description field Check - one asset updated Check - h_used_by and h_owned_by contain the (correct) sAMAccountName but not the urn, h_used_by_name and h_owned_by_name contain the (correct) name (I assume they were untouched) and h_description has been updated back to the correct value. Hope that helps.
Guest Posted January 31, 2017 Posted January 31, 2017 Hi @DeadMeatGF Brilliant, thanks for doing that. It sounds like exactly the same results as me. Let me discuss this internally, and I'll get back to you ASAP. Kind Regards Bob
Steve Giller Posted February 1, 2017 Author Posted February 1, 2017 @bob_dickinson By the way - we do populate the owned and used by values from different sources (it helps us identify machines that have been "loaned" out by the assigned owner) and they both appear to suffer from the same issue.
Steve G Posted February 1, 2017 Posted February 1, 2017 Hi @DeadMeatGF, I've fixed this issue with the asset import tool, and this is now live as release v1.3.0 on our Github repository: https://github.com/hornbill/goDBAssetImport I've also added improved logging capabilities too the tool, as requested in the following post: Let me know if I can be of any more assistance! Steve
Steve Giller Posted February 1, 2017 Author Posted February 1, 2017 Excellent news! I'll get that set up for tonight's update. Thanks for the quick response.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now