Jump to content

Asset Import from Intune


Recommended Posts

Hi,

I'm looking to get the h_owned_by field populated for mobile phones from our Intune environment

However, userDisplayName give "Firstname Lastname" and userPrincipalName gives the email address of the user

Is it possible in the json file to trim userPrincipalName to give the name part before the @ symbol?

That would then match with our Hornbill user IDs and populate the name

Thanks

Link to comment
Share on other sites

Hi @Everton1878,

The asset import template functionality supports all the functions available in the Sprig template package, so you could use the trimSuffix, replace, regex etc functions to manipulate your data at template level: https://masterminds.github.io/sprig/strings.html

An example of using replace could be:

"h_owned_by": "{{ .userPrincipalName | replace "@yourdomainname.onmicrosoft.com" "" }}",

 This would remove @yourdomainname.onmicrosoft.com from the userPrincipalName being mapped into your target field.

Hope this helps,

Steve

  • Like 1
Link to comment
Share on other sites

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
×
×
  • Create New...