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
os:windows:wincheck:index.html [2018/02/14 01:34]
kurihara
os:windows:wincheck:index.html [2018/05/13 23:19] (current)
kurihara
Line 14: Line 14:
 </sxh> </sxh>
  
-==== Fabric Remote 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== ==Cmd.exe==
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
Line 22: Line 30:
  
 ==PowerShell.exe== ==PowerShell.exe==
-This isn't work well. Why? Please tell me. 
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
-$ fab -H xx.xx.xx.xx -u USER -p PASSWORD --set shell=False --no-pty -- $PSVersionTable +$ 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 --set shell=False, pty=False -- $PSVersionTable+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 66: Line 79:
 def netstat_rn(): def netstat_rn():
     run("netstat -rn", shell=False, pty=False)     run("netstat -rn", shell=False, pty=False)
 +
 +#------------------------------------------------------------------
 +# wincheck.test_netconnection:host,port
 +#------------------------------------------------------------------
 +@task
 +def test_netconnection(host,port):
 +    """test_netconnection(host,port)"""
 +    run('PowerShell.exe -Command $ProgressPreference="SilentlyContinue', shell=False, pty=False)
 +    run("PowerShell.exe -Command Test-NetConnection %s -Port %s" (host,port), shell=False, pty=False)
 +
  
  
Line 91: Line 114:
 @task @task
 def net_user_active(user): def net_user_active(user):
-   """ make user active from disable"""+    """ make user active from disable"""
     run("net user %s /active" % user, shell=False, pty=False)     run("net user %s /active" % user, shell=False, pty=False)
  


os/windows/wincheck/index.html.1518539670.txt.gz · Last modified: 2018/02/14 01:34 by kurihara