0 votes

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

0 votes
by (216k points)
selected by
Best answer

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

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 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 (190 points)
0 votes
1 answer

Hello, how can I define the standard Group type when I want to create a group in adaxes. If I use the button Create Group on the home screen the standard group type ... "Universal" and "Security" selected as standard. How can I configure this? Thanks, Fabian

asked Feb 28, 2023 by fabian.p (380 points)
0 votes
1 answer

Occationally Service Desk staff need to clear a DNS record when a desktop has been reimaged but is keeping the same name as loses the ability to manage its original DNS ... running in ADAXES. Can I just install the applet on the ADAXES server using powershell?

asked Jan 17, 2023 by stevehalvorson (110 points)
0 votes
1 answer

Dear Support We have a business rule in the old Adaxes 2017 that was working: Before adding a universal security group to a global security group, the group type of the ... adding a universal group to a global group? <br> Our action: Best regards Johann

asked Nov 30, 2021 by Johann Ihnen (170 points)
3,550 questions
3,241 answers
8,235 comments
547,827 users