Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate Machine Key using Power shell

Tags:

powershell

I am trying to generate machine key to share between a few machine, after a quick google search i found this article KB 2915218, Appendix A .

  1. I copied the code and save as .ps1 extension which i believe is power shell extension.
  2. Open power shell
  3. Move to the location of the file
  4. run the script.

PS E: ./Generate-MachineKey -validation sha1

It runs fine but it doesn't output the keys. Any reason why? Am i doing something wrong in Powershell?

Thanks,

like image 408
Valter Avatar asked Mar 04 '15 03:03

Valter


People also ask

How do I generate a machine key?

On IIS, click on your website. On Features View double click on the Machine Key Icon as shown in the figure. Then click on Generate Key on the right panel as shown in the figure. New Validation Key and Decryption Key will be produced on the respective textboxes as shown in the figure.

What is machine key?

A machine key tightly secures gears, cams, sprockets, pulleys and other parts to the drive shaft in a power transmission and transmits torque from the main shaft to connected parts. A tapered machine key is used for easy assembly and removal.


1 Answers

The script contains a function so you'll have to first load the script and then run the function for it to work.

First we'll have to load the file, i called my ps1 "MachineKey" so this is how i load it

PS E:\> . .\MachineKey.ps1

Once i've loaded the file if i want to run the function called "Generate-MachineKey" i have to type this in afterwards

PS E:\> Generate-MachineKey -validationAlgorithm SHA1
like image 166
Bluecakes Avatar answered Oct 21 '22 04:10

Bluecakes