Runbook Automation - RBA - Setting the AccountExpires Date field in AD
In an Active Directory RBA integration, when setting the user data for the AccountExpires attribute you will need to convert your date into a Windows File Time format. If you try and set your date attribute with a string "YYYY-MM-DD" or "MM/DD/YYYY" you will get this error: "The attribute syntax specified to the directory service is invalid.To overcome this issue I had to create a Powershell Activity, that runs before my AD Account Create, and runs a Powershell command to get the date in Windows File Time format. The command is this:
(Get-Date 12/25/2012).ToFileTime() **Merry Christmas**
You can use the activity.output to get a response similar to this:
129067992000000000
This is the value you set in the userdata for attributes such as AccountExpires.
https://www.servicenow.com/community/in-other-news/runbook-automation-rba-setting-the-accountexpires-date-field-in/ba-p/2294342