Closed apollo753 closed 3 years ago
Yep, this can be done using a modified version of the module.
Please see the newly created SCCM folder under the root of this Git:
%Windir%\Sysnative\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -Command ".\Get-DellWarranty.ps1 -ApiKey xxxxx -ApiSecret xxxxx"
Replacing xxxxx with your key and secret without any quotations or anythingYou can then deploy it out to assets to run the script. One benefit of this approach is it keeps the API key and Secret from being stored directly on the client device.
To have it picked up by SCCM within the hardware inventory, you will need to amend your Hardware Inventory classes within your default client settings.
Please let me know if this works for you.
I just tried this and I can't get it to work. Do I also need a new psm1 file? Before putting this in SCCM I am trying to execute on my PC first.
Putting the api key as before it works fine see below
Thank you for you help on this!
I think I can see the issue here.
The SCCM script is a stripped down version of the module and does not have any switches apart from the -ApiKey and -ApiSecret and shows no output upon completion due to being run in the background by SCCM. By using these switches, it doesn't store the API information on the local machine by design, to avoid any issues with security of the key.
It looks to be that the .ps1 ran successfully in your first screenshot before it was ran with the -show tag, which left the authentication call to use a blank API and Secret.
Please remove any entries from HKLM:\Software\WARRANTY and re-run the first command using just the -ApiKey and -ApiSecret switches as a test.
If the registry is populated after this, then the script has run successfully.
Okay it works in the SCCM image during the OSD. I assumed it did not work because the system was asking for the key. But I just looked on a deployed system that I was testing and the registry is branded. I only need this done once so it is perfect, when the api changes I will just update the SCCM task sequence. Thank you so much for your help!
No worries! Glad I was able to help!
I will try to keep this up to date if Dell changes their API, as that happened with a previous version of this module. I have also created a new Git repo for the SCCM deployable version of this script at https://github.com/connochio/Powershell.SCCM for any future development or issues :)
Connochio
Is it possible to automate the install of your Dell Warranty Check? I would like to create an SCCM package to deploy this to our PCs on our network.
Instead of asking for the api key and secret key could this not be a one line entry or read from a text file?
Thank you Dave