Using Powershell to update a license key RRS feed

  • General discussion

  • Hello Scripting Guys, 

    I have a licensed program and it has expired. We have received the new license and rather go to each machine that has the program installed, which is 283 machines, I would like to deploy a script that deletes the old key and then copies and pastes the new key in the program files folder. The new key is on a network share while the old key is on the local machine in the program files folder. 

    I am a novice at Powershell but slowly learning the ropes. So, how would I go about writing this script? 

    • Changed type Bill_Stewart Monday, January 4, 2016 1:39 PM
    • Moved by Bill_Stewart Monday, January 4, 2016 1:39 PM This is not "scripts on demand"
    Wednesday, December 2, 2015 5:05 PM

All replies

  • Please start by reading the following post from right at the top of this forum:

    This forum is for scripting questions rather than script requests

    Also, this isn't a third-party software support forum. For help with a vendor's product, please consult with that vendor.

    -- Bill Stewart [Bill_Stewart]

    Wednesday, December 2, 2015 5:07 PM
  • Sorry I thought I was asking a scripting question. I wasn't requesting someone write a script for me. I'll do as you say. 
    Thursday, December 3, 2015 3:35 PM
  • if it's just a file replacement I would start by saving the old license file and new license file paths as variables, run a get-filehash on each, and compare the hashes. run a remove-item on the old one if it doesn't match then copy down the new one.

    You'll probably also want to make sure the program isn't currently running (check get-process) and as stated above check with the third party vendor/their documentation to see if there's anything else that needs to be done besides just replacing that license file (e.g. activating the license file, restarting services/computer, etc)

    once you've checked with the vendor and have a script, post it up here if you're still encountering problems or have specific script-related questions

    Thursday, December 3, 2015 4:31 PM