2016-08-02 37 views
-1

Power Shell Scriptを使用してIIS設定を取得することは可能ですか?私が/取得AAスクリプトを使用して情報の下にチェックするために探していますPowershellスクリプトを使用してIIS設定を確認する

  1. チェックWindows認証が
  2. Windows認証有効になっている場合、Windows認証プロバイダは(ネゴシエート、NTLM)
  3. チェック正しくリストされている場合詳細設定 - >カーネルモードを有効にする

答えて

0

はい、これはPowerShellですべて可能です。

オンラインサンプルと例の多く

は、Windows認証の詳細設定の使用についての情報を取得するために(IIS) Administration Cmdlets in Windows PowerShell

、特にGet-WebConfigurationGet-WebConfigurationProperty

を見あります

$windowsAuthFilter = "/system.WebServer/security/authentication/windowsAuthentication" 

$winKernel = (Get-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -location 'Default Web Site' -filter "$windowsAuthFilter" -name "useKernelMode").Value 
$winKernel 
$winProviders = Get-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -location 'Default Web Site' -filter "$windowsAuthFilter/providers" -name "." 
$winProviders.Collection | Format-Table value 
+0

試行: インポートモジュールのWeb管理 cd IIS: IIS:\> Get-WebConfiguration -Filter "System.WebServer/Securit y /認証/ */* "-Recurse |どこで{$ _。有効-eq $真} | Get-WebConfiguration:「IIS:\> Get-WebConfiguration」という用語は、コマンドレット、関数、スクリプトファイル、または操作可能な名前として認識されませんプログラム。名前の綴りを確認するか、パス が含まれていた場合は、パスが正しいことを確認してから、もう一度やり直してください。 – Joseph

+0

IISコマンドレットをインストールするには、 'Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerManagementTools'を実行します。古いWindowsバージョンの場合は、GUIを使用してインストールします。 –

+0

以下のコードはうまく動作しますが、Windows認証が有効かどうかは出力に表示されません。 Get-WebConfiguration system.webServer/security/authentication/windowsAuthentication/* 'IIS:\ sites \ Default Web Site' -Recurse |フォーマットリスト – Joseph

0

以下は匿名認証とWindows認証を読むための答えです:

$anonAuthFilter = "/system.WebServer/security/authentication/AnonymousAuthentication" 
$windowsAuthFilter = "/system.WebServer/security/authentication/windowsAuthentication" 

$value = 'false' 
$AppName = "test" 

$anonAuth = Get-WebConfigurationProperty -filter $anonAuthFilter -name Enabled -location $AppName 
Write-Host $anonAuth.Value 


$winAuth = Get-WebConfigurationProperty -filter $windowsAuthFilter -name Enabled -location $AppName 
Write-Host $winAuth.Value 

@Peterハーンドルフ はまだのための任意の手掛かりを見つけることができませんでした

チェックWindows認証[詳細設定] - > [オンになっているカーネルモードを有効にし、NTLMなどの

チェックチェック有効プロバイダと

ネゴシエート
+0

私は私の答えにいくつかのサンプルコードを追加しました –

関連する問題