Jump to content

Conversion from Hornbill Date Format to "accountExpires" AD attribute??


Recommended Posts

Hello all,

I'm trying to automate some of our automated account update tickets that we have passed from our HR system into HB. When a ticket comes in we'd like to send along the details
via ITOM and have it update the AD record. At the moment dates come out of HB in this format: 

2024-04-18T03:00:00.000Z

The AD attribute "accountExpires" only takes a Int64 value, and while we can use the string utils to reduce the HB format down to Generalised Time Format, I can't work out a way
of converting it further using the tools available inside the process designer. Has anyone run into this problem before? I'd imagine other people with AD integration are using Hornbill
to update user records including this expiry field?

Many thanks,

Ben

Link to comment
Share on other sites

Hi @Ben Maddams,

As per the docs, the AccountExpires input parameter to the ITOM operation expects a datetime string in the format: YYYY-MM-DD HH:MM:SS. The code in the background does the conversion of that into a PS DateTime Object, for passing in to the AD operation, so you don't have to do any Hornbill-side Int64 conversion: https://docs.hornbill.com/itom-packages/activedirectoryusermanagement/update

Cheers,

Steve

 

Link to comment
Share on other sites

@Steve G

Hi Steve,

Thanks for the response, attempting to pass the AD updater package the proper format, but if I just take the value ouput from the date picker (e.g 2024-01-01) and try
and stick a generic 00:00:00 at the end so it is accepted, with a preceeding space using the string utilities, Hornbill always removes the preceeding space. I've tried the
concat tools and using a "space" seperator (which gets ignored), wedging a custom variable containing just a space in it between the date and time strings, (also gets
ignored), doing a replace of "00:00:00" with " 00:00:00" on my final string (again, gets ignored), running out of ideas now.

Is there any way to get the string utilities to recognise preceeding spaces in anything?

Many thanks,

Ben

Link to comment
Share on other sites

  • 3 weeks later...

Hi @Ben Maddams,

Apologies for the late response, must've missed this tag.

I've had a look in the code, and the operation actually supports either a date stamp in the YYYY-MM-DD format, or a full datetime stamp in the YYYY-MM-DD HH:MM:SS format. So no need to concatenate 00:00:00 on to the end :)

I can see that the docs could (should!) make this clear, so I'll make sure this gets updated for the next ITOM content pack release.

Cheers,

Steve

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...