This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh -L 任意のポート番号:RDPするサーバーのIP:3389 踏み台サーバー | |
# Ex) ssh -L 33389:10.1.0.1:3389 user@10.1.0.2 | |
# このコマンドを実行後、「localhost:33389」に対しRDP接続することで10.1.0.2経由で10.1.0.1にRDPすることができる。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start compmgmt.msc /computer=サーバー名 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#********************************** | |
# 監視URLを指定してください。 | |
#********************************** | |
$Urls = New-Object System.Collections.Generic.List[string] | |
$Urls.Add("https://test1.co.jp") | |
$Urls.Add("https://test2.co.jp") | |
#********************************** | |
# メールの送信情報を設定してください。 | |
#********************************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$HostServers=@("HostSvr1","HostSvr2","HostSvr3","HostSvr4","HostSvr5") | |
foreach($HostServer in $HostServers){ | |
Get-vm -ComputerName $HostServer | Where-Object {$_.ReplicationHealth -ne "NotApplicable"} | Where-Object {$_.ReplicationHealth -ne "Normal"} | ForEach-Object{ | |
$attempts=3 | |
$sleepInSeconds=60 | |
do | |
{ | |
try |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 期限切れ状態を取得。 | |
# 期限切れの場合は「通知」という文字列が現れるので、resultが0以外になる。 | |
$result = (cscript //Nologo C:\Windows\System32\slmgr.vbs /dli | Where-Object{$_ -Like "*通知*" }).length | |
if($result -ne 0) | |
{ | |
slmgr -rearm | |
Restart-Computer -Force | |
} | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome" /v "ExternalProtocolDialogShowAlwaysOpenCheckbox" /t "REG_DWORD" /d "1" /f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM Powershellで「dir cert:\LocalMachine\My」を実行し、証明書の拇印を取得して下記に設定する。 | |
REM 新しいもの(差し替えるもの)と古いもの(差し替えられるもの)の両方の捺印が必要。 | |
set OldThumbprint="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
set NewThumbprint="YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" | |
set pfxFileName="ssl.pfx" | |
certutil -f -p パスワード -importpfx "WebHosting" "%~dp0%pfxFileName%" | |
cd %windir%\system32\inetsrv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace LineNotifyForFamily | |
{ | |
public static class LineNotify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Dim mFrom | |
Dim mTo | |
Dim SmtpSvr | |
mFrom = "From@From.com" | |
mTo = "To@To.com" | |
SmtpSvr = "SmtpServer" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET FLD=%~dp0 | |
SET TXT_DEADLOCK=DeadLock.txt | |
If not Exist %FLD% mkdir %FLD% | |
del %FLD%\%TXT_DEADLOCK% | |
bcp "SELECT * FROM sys.fn_xe_file_target_read_file('C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\DeadLock*.xel', 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\DeadLock*.xem', null, null)" queryout "%FLD%\%TXT_DEADLOCK%" -T -c |
NewerOlder