I am trying to run a PS script and get the following error (snipped):-

"Cannot convert the "130978519257589890" value of type "Softerra.Adaxes.Adsi.AdsLargeInteger" to type "System.Double"

How do I convert this attribute?

I have tried converting like this (and get the same convert error):-

[System.Double]$Value = $Value

Note: I'm not sure if I can instead fetch the attribute value as a System.Double type by tweaking the ADSI Get command:-

$Value = $targetPC.Get($targetProperty)

Thanks

by (1.6k points)

1 Answer

by (216k points)
Best answer
0 votes

Hello,

To convert a value of type Softerra.Adaxes.Adsi.AdsLargeInteger to type System.Double, you can use the following method:

$Value = [System.Double]::Parse($targetPC.Get($targetProperty))

By the way, is your ultimate goal to represent the property as a System.Date structure? If so, you can use the following method:

$propertyValue = $targetPC.Get($targetProperty)
$datetime = [DateTime]::FromFiletime([Int64]::Parse($propertyValue))
by (1.6k points)
0

Many thanks!

Yes, you're right we're trying to pull and display an epoch time. I was using the following PS command, but will also try your solution!

$TimeStamp      = [timezone]::CurrentTimeZone.ToLocalTime(([datetime]'1/1/1970').AddSeconds($Value))

Related questions

We would like to use a script to copy the rules of a ‘Membership type = rule-based’ group and add them to another group. Is this possible? Do you have a script available? Thanks

asked Oct 6, 2025 by DRiVSSi (360 points)
0 votes
1 answer

Hi, I was able to activate the shared folder object type as I browse through a webinterface. Now I face the issue that I am not able to search it via the websearch. Is it possible to add it somehow to the searchable objects? Thanks in advance!

asked Sep 2, 2025 by Marcel Büttinghaus (60 points)
0 votes
1 answer

I'm wanting to modify the subject of the approval email that is sent to an approver so it stands out better. What I would like is to add the name of the user ... , %name% or anything else related to name is that of the person being emailed the approval.

asked Mar 14, 2025 by matt_nz (20 points)
0 votes
1 answer

Hello, I'm wondering why i'am missing Domain-DNS object type. Running latest version 3.16.21906.0 (64 bit). I'm running with domain admin & adaxes service ... -custom-commands-scheduled-reports-and-scheduled-tasks-s394.htm This is my Object Type list:

asked Apr 1, 2024 by PeterS (40 points)
0 votes
1 answer

I’m looking for a way to take a unique number from Adaxes and use part of it to create an employee ID for the AD attribute field.

asked Dec 25, 2023 by cewilson (300 points)
0 votes
1 answer