Jump to content

SCCM Import - Last Logged In user not populating


Recommended Posts

Hello,

According to the SCCM instructions, the Last Logged In User field simply requires a Username in order for it to be populated against the Computer assets. Using the SQL I can see that the username is being pulled in (Microsoft SQL Server Management Studio).

image.thumb.png.537973787ff1b80762de5d0068d61916.png


This field I then using the SCCM Import config... but when running the import this field doesn't get populated in Hornbill... but all the other fields do.
image.png.05159f20b7b8445c4cad97d9e1164599.png


There are also no error messages in the SCCM Import log file.

Can someone assist in helping me to find out why this field is not being populated with the username data from SCCM?

Thanks,

Samuel

Link to comment
Share on other sites

Hi @samwoo,

A couple of the user ID fields (owned_by and used_by) are converted, behind-the-scenes, to a more involved unique identifier.

This is not the case for last_logged_on_user, but then I can't find anywhere that this should be the case.

Could you please run the following SQL in the Admin section Home > System > Data > Data Direct :

SELECT h_pk_asset_id, h_last_logged_on_user FROM h_cmdb_assets_computer WHERE h_last_logged_on_user IS NOT NULL

and see what data is in the results.

  • Thanks 1
Link to comment
Share on other sites

2 minutes ago, SamS said:

Hi @samwoo,

A couple of the user ID fields (owned_by and used_by) are converted, behind-the-scenes, to a more involved unique identifier.

This is not the case for last_logged_on_user, but then I can't find anywhere that this should be the case.

Could you please run the following SQL in the Admin section Home > System > Data > Data Direct :


SELECT h_pk_asset_id, h_last_logged_on_user FROM h_cmdb_assets_computer WHERE h_last_logged_on_user IS NOT NULL

and see what data is in the results.

Hi @SamS,

I have just run the script. I can see that the usernames pulling in from SCCM are in there, but I can also see other names which starts off with urn:sys:0:<Name Name>:<Username>, I checked these records and the Last Logged On user was manually set via Asset Manager not SCCM.

So the conversion from username to urn:sys:0:name:username isn't working?

Thanks,

Samuel

Link to comment
Share on other sites

For info this is where I read it:
https://wiki.hornbill.com/index.php/Database_Asset_Import

AssetTypeFieldMapping

  • Maps data in to the type-specific Asset record, so the same rules as AssetGenericFieldMapping
  • For the computer asset class:
    • "h_last_logged_on_user":"[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_last_logged_on_user column with an appropriate URN value for the user.
Link to comment
Share on other sites

Hi @samwoo,

I've updated (and released the binary to) the CSV Asset Import script with the fix.

The owner of the DB Asset Import script has a notification waiting with the fix in it as well. Expect a release early in the new year. IF I manage to compile that particular binary myself, then I will provide you with that binary via sFTP.

  • Thanks 1
Link to comment
Share on other sites

Hi @samwoo,

That's been fixed in v1.7.1 of the database asset import utility, which can be downloaded here. This was actually working as expected for new assets being imported, it was pre-existing assets that were not being updated correctly, which has been rectified. Let me know how you get on with it.

Cheers,
Steve

Link to comment
Share on other sites

31 minutes ago, Steve G said:

Hi @samwoo,

That's been fixed in v1.7.1 of the database asset import utility, which can be downloaded here. This was actually working as expected for new assets being imported, it was pre-existing assets that were not being updated correctly, which has been rectified. Let me know how you get on with it.

Cheers,
Steve

Thanks for getting back to me on this. I have tried the new version, however I am getting the following error message:

[ERROR] Error Decoding Configuration File: json: cannot unmarshal object into Go struct field sqlImportConfStruct.AssetTypes of type []main.assetTypesStruct

I then switched back to the old version of the exe and it worked, then switched back to the new one and got the above error message again. I did this  to check that the JSON hasn't changed since.

Thanks,

Samuel

Link to comment
Share on other sites

Hi @samwoo,

I'm unable to replicate that issue :( What version of the asset import tool were you using before this attempt? That error suggests you are on an older version of the tool where the AssetTypes property in the JSON config was a flat object, whereas in v1.5.0 or above the config layout has changed so that this is an array.

Thanks,

Steve

Link to comment
Share on other sites

2 minutes ago, Steve G said:

Hi @samwoo,

I'm unable to replicate that issue :( What version of the asset import tool were you using before this attempt? That error suggests you are on an older version of the tool where the AssetTypes property in the JSON config was a flat object, whereas in v1.5.0 or above the config layout has changed so that this is an array.

Thanks,

Steve

I'm on --- XMLMC Database Asset Import Utility V1.4.2 ----

Which makes sense since i haven't seen that 1.5.0 has been released! Silly me. I will have a look and see how the new JSON config looks and amend accordingly.

Thanks,

Samuel

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...