FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


os:windows:wincheck:index.html



Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
os:windows:wincheck:index.html [2018/02/01 22:58]
kurihara
os:windows:wincheck:index.html [2018/02/22 23:29]
kurihara [How to Check to Use Fabric]
Line 1: Line 1:
 [[:index.html#OS Management|Top#OS Management]] [[:index.html#OS Management|Top#OS Management]]
-====== Windows Check (wincheck.py)=====+====== Windows Check with Fabric (wincheck.py)=====
  
 $FHHOME/fabfile/wincheck.py $FHHOME/fabfile/wincheck.py
Line 7: Line 7:
 \\ \\
  
-===== Operation =====+===== Operation with Fabric =====
  
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
Line 14: Line 14:
 </sxh> </sxh>
  
-==== RefRemote Shell Commands ====+\\ 
 +==== How to Check to Use Fabric in Windows ==== 
 +<sxh bash toolbar:false gutter:false> 
 +$ ssh user01@xx.xx.xx.xx hostname 
 +$ ssh user01@xx.xx.xx.xx "PowerShell.exe -Command Get-Host" 
 +</sxh> 
 + 
 +\\ 
 +==== Fabric one-line Task Examples ==== 
 +==Cmd.exe==
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
 $ fab -H xx.xx.xx.xx -u USER -p PASSWORD --shell="Cmd.exe /C" --no-pty -- hostname $ fab -H xx.xx.xx.xx -u USER -p PASSWORD --shell="Cmd.exe /C" --no-pty -- hostname
 $ echo xx.xx.xx.xx | fab auth.winpro --shell="Cmd.exe /C" --no-pty  -- ipconfig /all $ echo xx.xx.xx.xx | fab auth.winpro --shell="Cmd.exe /C" --no-pty  -- ipconfig /all
 +</sxh>
 +
 +==PowerShell.exe==
 +<sxh bash toolbar:false gutter:false>
 +$ fab -H xx.xx.xx.xx -u USER -p PASSWORD --shell="" --no-pty -- "PowerShell.exe -Command Get-Host"
 +$ fab -H xx.xx.xx.xx -u USER -p PASSWORD --shell="PowerShell.exe -Command" auth.wintib  --no-pty -- Get-Host
 +</sxh>
 +
 +<sxh bash toolbar:false gutter:false>
 +## This isn't work well. Why? Please tell me.
 +$ fab -H xx.xx.xx.xx -u USER -p PASSWORD --shell="" --no-pty -- "PowerShell.exe -Command $PSVersionTable"
 +$ fab -H xx.xx.xx.xx -u USER -p PASSWORD --shell="PowerShell.exe -Command" auth.wintib  --no-pty -- $PSVersionTable
 </sxh> </sxh>
  
Line 26: Line 47:
  
 <sxh python toolbar:false gutter:false> <sxh python toolbar:false gutter:false>
-import sys+import sys, os
 from fabric.api import * from fabric.api import *
 from fabric.contrib import files from fabric.contrib import files


os/windows/wincheck/index.html.txt · Last modified: 2018/05/13 23:19 by kurihara