4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ServerspecのテストをWindowsServerに対して実行する為の前準備

4
Posted at

WindowsServerに対して、Serverspecを実行する場合に、Windows側にWinrm(Windowsリモート管理)を有効にする必要がある。
※Serverspecの実行をWindowsでやる手順ではない。
簡単だが、設定しないとServerspecでのテスト出来ないのでメモ。

手順

psの実行ポリシー変更(デジタル署名のないスクリプトの実行許可)

※管理者権限で、powershellを起動

set-executionpolicy remotesigned -Force

下記でwinrmを有効化

ps1形式で保存して、スクリプト実行すると楽!!

winrm_enable.ps1
# リモートアクセスを有効にする
Enable-PSRemoting -Force
 
# タイムアウト設定
Set-Item -Path "WSMan:\localhost\MaxTimeoutms" 1800000
Get-Item -Path "WSMan:\localhost\MaxTimeoutms"
 
# 暗号化されていない接続を許可
Set-Item -Path "WSMan:\localhost\Service\AllowUnencrypted" "true"
Get-Item -Path "WSMan:\localhost\Service\AllowUnencrypted"
 
# Basic認証許可
Set-Item -Path "WSMan:\localhost\Service\Auth\Basic" "true"
Get-Item -Path "WSMan:\localhost\Service\Auth\Basic"

[参照]http://opcdiary.net/?p=29576

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?