syg_hira's tech-work memo

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

2012-01-01から1年間の記事一覧

検証サーバの論理構成

設定のTips 各サーバのメモリは、Dynamic Memoryを有効化して動的に割り当てる。スタートアップメモリ&最小メモリは、Win2003:512MB,Win2008:1024MBに設定。Windows 2008 Storage Server は、Dynamic Memoryに対応しないため、2048MBを割り当て。 iSCSIで使…

検証用サーバのHW構成(修正版)

自宅の検証用サーバの構成。総額8万円ぐらいでDIYしている。 CPU Xeon E3-1220LV2(3M Cache,2.30GHz,TPD=17W) Motherboard Intel Server Board S1200BTS Memory DDR3 ECC UDIMM 8GB x2 Phisical Disk0 SSD SAMSUNG SSD 830 120GB Phisical Disk1 HDD Western…

Windows転送ツール 異なる言語間での環境移行(修正版)

個人PCのWindows XP,7,8環境移行に便利な、Windows転送ツール。私は英語版のWindowsを日本語化して利用していますが、一時的に日本語OSの入ったPCに環境を移したりすることがある。Windows 転送ツールは、同じ言語版のOSでしか環境の移行ができないが、レジ…

Optimize(compact) VHD with PowerShell 3.0(修正版)

Windows Server 2012でHyper-V3.0環境を稼働中。 ディスク容量が足りなくなってきたので、VHDの最適化を行う。 PreCompact.exeにパスを通してある環境で、下記のようなスクリプトを実行 Mount-VHD -Path <VHD File Path> Get-Partition | Where-Object { $_.diskid -like "*</vhd>…

Road to MCSA Windows Server 2012 & 勉強方法

資格取得のストラテジー マイクロソフト認定ソリューション アソシエイト (MCSA) 会社のインフラ系技術者の昇進必須条件として、MCSA Windows Server 2012 が追加された。 MCSA Win Srv 2012日本語版試験は、2012年11月上旬にリリース予定。 私が勉強できる…

Disable/Enable Windows Firewall command on Active Directory deployed environment (Updated)

netsh advfirewall set allprofile state on netsh advfirewall set allprofile state offOn Active Directory deployed environment, you should disable "All Profile"(It's including Domain, Public and Private profile) to allow all connection.

0x8007139F exception in installing SQL Server 2008 R2 on MSFC(修正版)

SQL Server 2008 R2クラスタをインストールすると、エラー発生。 クラスター リソース 'SQL Server Agent' をオンラインにできませんでした。エラー: グループまたはリソースは要求した操作を実行するのに適切な状態ではありません。 (HRESULT からの例外: 0…

ディスクの管理コンソールのビューが最新の状態でないため...(修正版)

SSD(SAMSUNG SSD 830 256GB)を移設。 移設前:デスクトップPCでUSB→SATA変換アダプタ接続、初期化 移設後:Dell E4300のドライブベイに入れてSATAで接続コンピューターの管理→ディスクの管理、でディスクは見えているが、ドライブ文字が割り当てられていない…

Run SQL Server Maintenance Plan from command line (Updated)

You can run "SQL Server Maintenance Plan" with DTExec.exe.When you create maintenance plan, the "Job" is created in SQL Server by SQL Server Management Studio automatically.The "Job" has the "Step", the "Step" has command line property. Yo…

Source=Msinstaller, ID=11310

I had encounted error when installing SQL Server Management Studio with SQL Server 2008 R2 Developer on domain controller. It may be a issue of Windows Installer Component. I had to do this steps to complete installation. msiexec /unreg ms…

Disable and enable ipv6 Interfaces on Windows Server 2008 R2(修正版)

ネットワークアダプタのプロパティで、IPv6を無効にしても、6to4などのトンネルインターフェースは有効なまま。 ホスト自体はIPv6のアドレスを持ったままになってしまう。 実害はほとんどないと思うが、IPv6のアドレスを管理するのが面倒、ということもある…

Get Windows service properties (Updated)

This command get get windows services properties with TSV. DisplayName Name Status(Stopped or Running) StartMode(Auto, Manual or Disabled) StartName(Service Account) Get-Service | sort-object DisplayName |ForEach-Object -Process{$Filter="N…

get displayname, name, status, startupmode(startup type) and 'log on as' of windows services (Updated)

Get-Service | sort-object DisplayName |ForEach-Object -Process{$Filter="Name='$($_.Name)'";$Service=(Get-WmiObject Win32_Service -filter $Filter);$("$($Service.DisplayName)`t$($Service.Name)`t$($_.Status)`t$($Service.StartMode)`t$($Service…

Disable and enable ipv6 Tunnel Interfaces on Windows Server 2008 R2

トンネルインターフェースを選択的に有効化・無効化する場合は、下記のコマンドを実行。 IPv6をまるっと無効化する場合は、こちらを参照 # Disable netsh interface ipv6 isatap set state disablednetsh interface ipv6 6to4 set state disablednetsh inter…

タスクスケジューラのタスク状態を取得

コマンド単発実行 schtasks /query /s サーバ名 /tn タスク名 Powershellでプロパティ取得、schtasksを呼び出すお手軽バージョン。 $Task = (schtasks /query /s サーバ名 /tn "タスク名" /v /fo csv | ConvertFrom-Csv) $Task.前回の結果 0 $Task.状態 準備…

イベントログからユニークなイベントIDとメッセージを抽出

どんなエラーが発生しているか確認するため、イベントID1つにつき1件だけピックアップ。 Get-WinEvent -Path 'D:\work\hoge1.evtx','D:\work\hoge2.evtx' | where {$_.Level -eq 2} | Sort-Object -Unique ID | fl

PowerShell実行ポリシー変更

$Cred = Get-Credential -Credential 'domain\TaskUser'Invoke-Command -ComputerName ServerName -Credential $Cred -ScriptBlock { `Get-ExecutionPolicy -List; `$Ret = Read-Host -Prompt '実行ポリシーを変更します(Hit Any Key)'; `Set-ExecutionPolic…

リモートサーバから、IISのWebサイト構成

複数のサーバに、メンテナンス画面用サイトを構成するためのセットアップスクリプト。 #----------#新規作成robocopy \\SourceRepositoryServer\C$\SourceDirectory \\WebServer\C$\Sites\Maintenance /S /E /R:0 /W:0Invoke-Command -ComputerName $Compute…

telnet でHTTPブラウズ(ロードバランサーでWebアプリ死活監視してるときの動作)

ロードバランサーに、Dynamics CRMのサーバをぶら下げる。 ロードバランサーからのノード死活監視は、http://hoge.local/Tenant/main.asp にアクセスさせて、HTTP 401エラーを読ませることにした。 このときのHTTP Request/Responseをtelnetで見てみる。 tel…

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…

blog立ち上げ

仕事でWindows PowerShellを使ったサーバ管理系スクリプトをいろいろ作成している。 実務で自分が使ったテクノロジーとテクニックを再利用するため、blogに書き残すことにした。