Windows Management Framework 3.0 ベータ版がリリースされています。
Download: WMF3 Beta - Microsoft Download Center - Download Details(英語版です)
既に、Windows Server 2008 R2 や Windows 7 には WMF 2.0 相当の機能がインストールされていますが、WMF 3.0 Beta をインストールすることで、新しい Windows Server "8" と同等の管理フレームワークを実装することができます。
なお、インストールするには事前に以下をインストールしておく必要があるの注意しましょう。
さらに、一旦英語環境に変更しておく必要がありますので、これも注意しましょう。
なので、本番の運用環境にインストールするのは厳しいと思います。コマンドレットや PowerShell スクリプトの仕様なんかも変更されているので、テスト環境を使用していただくことを強くお勧めします。
では、簡単にどんなものがインストールされるかをご紹介します。
Windows PowerShell 3.0
待ちに待った Windows PowerShell 3.0 です。PowerShell 3.0 によって何ができるようになるかというと.... ※ 詳しくは What's New in Windows PowerShell 3.0 を参照してください。
待ちに待った Windows PowerShell 3.0 です。PowerShell 3.0 によって何ができるようになるかというと....
※ 詳しくは What's New in Windows PowerShell 3.0 を参照してください。
PS C:\> Get-Command -Module PSScheduledJob
Capability Name ModuleName ---------- ---- ---------- Cmdlet Add-JobTrigger PSScheduledJob Cmdlet Disable-JobTrigger PSScheduledJob Cmdlet Disable-ScheduledJob PSScheduledJob Cmdlet Enable-JobTrigger PSScheduledJob Cmdlet Enable-ScheduledJob PSScheduledJob Cmdlet Get-JobTrigger PSScheduledJob Cmdlet Get-ScheduledJob PSScheduledJob Cmdlet Get-ScheduledJobOption PSScheduledJob Cmdlet New-JobTrigger PSScheduledJob Cmdlet New-ScheduledJobOption PSScheduledJob Cmdlet Register-ScheduledJob PSScheduledJob Cmdlet Remove-JobTrigger PSScheduledJob Cmdlet Set-JobTrigger PSScheduledJob Cmdlet Set-ScheduledJob PSScheduledJob Cmdlet Set-ScheduledJobOption PSScheduledJob Cmdlet Unregister-ScheduledJob PSScheduledJob
この他、いろいろとアップデートされていますので、詳しくは What's New in Windows PowerShell 3.0 を参照してください。
WMI
Script Geek には欠かせない WMI(Windows Management Instrumentation)ですが、これもアップデートされました。
WinRM
前出の CIM はあくまでもオブジェクトモデルであり、これだけで管理が行えるわけではありません。PowerShell や各種コマンドの要求を受け入れるサービスが必須です。CIM に対応したインターフェース標準として WBEM(Web-Based Enterprise Management)というものがあり、その実装として普及しているのが WS-Man(Web Service Management)です。でもって、WS-Man の MS 実装版が WinRM(Windows Remote Management)ということになります(疲れますね)。
WinRM は以前のバージョンとくらべて、接続性が大きく改善されています。この改善が、PowerShell 3.0 の「再接続可能なセッション」を実現しています。
Windows PowerShell Web Service(WPWS)
※この機能、Windows Server 2008 R2 に提供されています??恥ずかしながら見つけられませんでした...。
その名称から容易に想像できますが、PowerShell の要求を受け付ける Web Service が提供されます。インターフェースが ODATA なので、どんなクライアントからでも接続が可能だというメリットがあります。
このサービスの面白いところは、WPWS をゲートウェイとして別のコンピューターの WinRM に接続できる点です。つまり、DMZ にこのサービスを立てておけば、社内のサーバーに接続して自宅から管理が行えます。PowerShell 3.0 でコマンドレットが 2300 にまで増えたので、管理のし甲斐があるってもんです。
標準では、ブラウザからアクセス可能なGUIが提供されています。もちろん、スマートフォンからのアクセスも可能です。
Server Manager CIM Provider
Windows Server "8" のサーバーマネージャーから、Windows Server 2008 R2 SP1 および Windows Server 2008 SP2 のサーバーマネージャーに接続するための CIM プロバイダーです。WMF 3.0 をインストールし、さらに、Enable-PSRemoting コマンドレットでリモートからの接続を許可すると、Windows Server "8" から Windows Server 2008/2008 R2 のサーバーマネージャーを操作できるようになります。
PS C:\Users\Administrator> Enable-PSRemoting WinRM Quick Configuration Running command "Set-WSManQuickConfig" to enable this machine for remote management through WinRM service. This includes: 1. Starting or restarting (if already started) the WinRM service 2. Setting the WinRM service type to auto start 3. Creating a listener to accept requests on any IP address 4. Enabling firewall exception for WS-Management traffic (for http only). Do you want to continue? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Yes WinRM has been updated to receive requests. WinRM service type changed successfully. WinRM service started. WinRM has been updated for remote management. Created a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this machine. WinRM firewall exception enabled. Confirm Are you sure you want to perform this action? Performing operation "Set-PSSessionConfiguration" on Target "Name: microsoft.powershell SDDL: O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD). This will allow selected users to remotely run Windows PowerShell commands on this computer". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Yes Confirm Are you sure you want to perform this action? Performing operation "Set-PSSessionConfiguration" on Target "Name: microsoft.powershell.workflow SDDL: O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD). This will allow selected users to remotely run Windows PowerShell commands on this computer". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y Confirm Are you sure you want to perform this action? Performing operation "Set-PSSessionConfiguration" on Target "Name: microsoft.powershell32 SDDL: O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD). This will allow selected users to remotely run Windows PowerShell commands on this computer". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y Confirm Are you sure you want to perform this action? Performing operation "Set-PSSessionConfiguration" on Target "Name: microsoft.ServerManager SDDL: O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD). This will allow selected users to remotely run Windows PowerShell commands on this computer". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y PS C:\Users\Administrator>
PS C:\Users\Administrator> Enable-PSRemoting
WinRM Quick Configuration Running command "Set-WSManQuickConfig" to enable this machine for remote management through WinRM service. This includes: 1. Starting or restarting (if already started) the WinRM service 2. Setting the WinRM service type to auto start 3. Creating a listener to accept requests on any IP address 4. Enabling firewall exception for WS-Management traffic (for http only).
Do you want to continue? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Yes WinRM has been updated to receive requests. WinRM service type changed successfully. WinRM service started.
WinRM has been updated for remote management. Created a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this machine. WinRM firewall exception enabled.
Confirm Are you sure you want to perform this action? Performing operation "Set-PSSessionConfiguration" on Target "Name: microsoft.powershell SDDL: O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD). This will allow selected users to remotely run Windows PowerShell commands on this computer". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Yes
Confirm Are you sure you want to perform this action? Performing operation "Set-PSSessionConfiguration" on Target "Name: microsoft.powershell.workflow SDDL: O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD). This will allow selected users to remotely run Windows PowerShell commands on this computer". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
Confirm Are you sure you want to perform this action? Performing operation "Set-PSSessionConfiguration" on Target "Name: microsoft.powershell32 SDDL: O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD). This will allow selected users to remotely run Windows PowerShell commands on this computer". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
Confirm Are you sure you want to perform this action? Performing operation "Set-PSSessionConfiguration" on Target "Name: microsoft.ServerManager SDDL: O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD). This will allow selected users to remotely run Windows PowerShell commands on this computer". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y PS C:\Users\Administrator>