syg_hira's tech-work memo

某人材サービス会社の情報共有インフラ担当のおぼえがきです。MicrosoftのEnterprise製品多め。

2012-04-09から1日間の記事一覧

Invoke-Commandでリモート実行した処理の終了ステータス、戻り値の取得

実行結果を正常=True、エラー=Falseで取得する場合 $Ret = Invoke-Command -ComputerName RemoteComputer -ScriptBlock { hostname ; $? } 実行結果を、ExitCode(任意の数字)で取得する場合 $Ret = Invoke-Command -ComputerName RemoteComputer -ScriptBl…

MSFC(フェールオーバークラスタ)の管理 with PowerShell(修正版)

Import-Module -Name failoverclusters $clusterGroup = Get-ClusterGroup -Cluster ClusterName -Name ClusterGroupName if($clusterGroup.ownerNode -eq 'PrimaryNode') { Write-Host 'Cluster is healthy, move cluster group' Move-ClusterGroup -Cluste…

タスク(タスクスケジューラ)を、PowerShellで実行する(修正版)

#Run Registerd Task $TaskService = New-Object -ComObject Schedule.Service $TaskService.Connect('ServerName') $RootFolder = $TaskService.GetFolder('\') $Task=$RootFolder.GetTask('TaskName') $Task.Run(1) #wait for task termination do { write…