Posts tagged "windows"

Create Windows user using SALTstack

The first thing i did using salt stack was creating a local windows user. Creating users on different OS builds are fully supported by using the built-in salt functions.

First create a mapping in your top.sls config which point to your Windows state directory.

Sample config in top.sls Defining 2 hostnames, one with a wildcard for matching a server group.

Content of the win_generic.sls

In this example I use pillar for securing passwords. If you don’t use pillar, just use a plain text password in the password field.
Ill write a blog article how to use Pillar in SALT.

Install git with PowerShell on Windows

With the following PowerShell function you can download and install git using PowerShell.

It downloads the latest “stable” git release to the given temp directory and installs it with default parameters.

Another and more easy way is using the package manager Chocolatey.
The Script:

How to check the SFP state on a Physical Windows Host

In the past we have had an issue with a bad batch of  SFP’s in our Windows servers. The issue occurs randomly after a couple months in production.

The answer from HP about the bad SFP’s:
“The problem is due to the Manufacturing anomaly which has been corrected now .This issue causes early life degradation of Transmit (Tx) Power, causing the affected device to fail between 6-months and 1-year from first operation, depending on operational use. Affected SFP+ Short Wave Transceivers that begin to fail, first exhibit symptoms typical to Tx power degradation followed within weeks by symptoms typical to Tx power failure.”

They could not provide us more information about the affected serial / product numbers. Only way to check those SFPs is reading the operational status with a small tool.

Tool name: qaucli.exe
Which can downloaded from: Click here
Run the .exe to get the tool installed.

Check the Status. If the status not match “normal”, replace the SFP.

I automated the checks with a little not so fancy (I know) script.

NOTE: Only tested with QLOGIC adapters. Don’t know if this also work for the Emulex ones.
For Emulex refer this: For Emulex adapters use the Emulex® OneCommand® Manager Application to view the transceivers, their status and TX power level on the PortAttribute screen.

How to install terraform on Windows

  1. Download Terraform
  2. Unzip Terraform to c:\Terraform
  3. Add terraform to your environment variables:

Test your installation typing terraform in CMD.
Your output should look like this:


Generate CPU Load with PowerShell

In some situations you need to stress your system a little (for example: to check if your monitoring is functioning properly.)

Installing some random .exe files from some anonymous websites is not always a good idea. So hereby a little script for blowing your CPU to 100%.

The script creates a nice calculation for all of your “Windows Logical Processors”

Enable safe mode Windows 8 or 10

Last week I was working on a young defect SSD powered computer running on Windows 10. Hitting the F8 key for enable the save mode while booting was almost impossible. Don’t know if the key is disabled or Microsoft reduced the time periods for pressing F8 near 0 seconds.

Enable safe mode Windows 8 or 10 with MSCONFIG

Go to your command prompt (CMD) or search for the executable called “run” and type MSCONFIG and hit enter. Switch to the boot tab and select the button “safe boot”, then reboot.

 

Enable F8 key Windows 8 or 10

To enable the F8 key. Run the command prompt (CMD) as administrator. Search for RUN or directly CMD -> right click -> Run as administrator.  And copy the following lines into the prompt and hit enter. Reboot needed:

Change back to the default settings: