Scripts are used in the One Identity Manager to monitor and maintain data consistency and customer business logic in the database. Scripts can be used to:
One Identity Manager scripts are written in VB.Net syntax, which allows all VB.Net functions to be used. The values to be edited are given as preprocessor instructions.
|
NOTE: You can find detailed examples for syntax and usage of scripts on the installation medium in the directory QBM\dvd\AddOn\SDK\ScriptSamples. |
You can use scripts in:
You should never use the VB.Net functions Msgbox and Inputbox on servers. Use the functions VID_Write2Log, RaiseMessage or AppData.Instance.RaiseMessage.
Time stamps, such as insert dates or modification dates, are stored in the database with the respective UTC. The object layer transforms this time data into the currently valid time zone data when an object is loaded. The user, therefore, sees all the values in local time. When an object is saved the current time zone data is transformed into UTC data.
|
NOTE: The use of DateTime.Now in scripts must be critically tested. It is better to use DateTime.UTCNow than DateTime.Now to display the value to users. |
It is not recommended to convert dates, in non-U.S. notation, from type "String" to type "DateTime" in scripts:
Value = CDate("31.12.2014")
This always causes a problem if the script is running on a U.S. system. In the best case, you are sent an error message like "Cast from string...to type Date is not valid". In the worst case the wrong date is returned as month and day are swapped (3.12.2014 becomes 12.3.2014).
If possible, you should avoid a string conversion altogether in this case. The type "DateTime" provides several functions for this purpose. For the example above, that would be:
Value = new DateTime(2014, 12, 31)
If the data type "String" however, should be used then the ISO date notation should be applied as it is always converted correctly:
Value = CDate("2014-12-31")
Value = CDate("2014-12-31 15:22:12")
The complicated version is to input the language code format for the date:
Value = DateTime.Parse("12.31.2014", new CultureInfo("en-US"))
Value = DateTime.ParseExact("12.31.2014", "mm.dd.yyyy", CultureInfo.InvariantCulture)
© 2023 One Identity LLC. ALL RIGHTS RESERVED. Feedback Terms of Use Privacy