Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't clear warranty using Set-DrmmDeviceWarranty #38

Open
JonathanBullerBP opened this issue Oct 31, 2023 · 9 comments
Open

Can't clear warranty using Set-DrmmDeviceWarranty #38

JonathanBullerBP opened this issue Oct 31, 2023 · 9 comments

Comments

@JonathanBullerBP
Copy link

We're trying to clear some incorrect warranty data, using the API you can pass "null" to the endpoint to clear the date. Using this module it doesn't work, just returning an error 400.

@aaronengels
Copy link
Owner

aaronengels commented Nov 1, 2023

I would pass an empty string. Let me know if that works or not.

@JonathanBullerBP
Copy link
Author

JonathanBullerBP commented Nov 1, 2023

Hi, have just tried this:

set-drmmdevicewarranty -deviceuid $DeviceUID -warranty ""
{
    "warrantyDate":  ""
}
The remote server returned an error: (400) Bad Request.```

@aaronengels
Copy link
Owner

I meant to try $null or put a space in the string ;-)

@JonathanBullerBP
Copy link
Author

No problem - I've tried putting a space in the string, an empty string, $null and nothing and it all returns a 400.

@aaronengels
Copy link
Owner

Can you raise a ticket with Datto support? Maybe we can't clear the warranty. As a workaround, you could put in a date you can exclude.

@JonathanBullerBP
Copy link
Author

I spoke to them yesterday - they advised me to use Postman to interact with the API and test, by setting the body of the POST request as:

{
  "warrantyDate": null
}

it clears the warranty information.

@aaronengels
Copy link
Owner

That's good it works with Postman. I will create a test machine and see why sending "null" does not work.

@JonathanBullerBP
Copy link
Author

I've gotten it working temporarily - https://github.com/JonathanBullerBP/DattoRMM/blob/master/functions/Set-DrmmDeviceWarranty.ps1

I put it on a separate switch to avoid data loss but this could also just work if the date value is set to null.

@aaronengels
Copy link
Owner

Thank you, I'll add your code to the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants