我有幾個IIS 6網站,我需要調查。我需要檢查的項目之一是AllowAnonymous。我需要知道它是真是假。我發現這段代碼:如何確定使用PowerShell在IIS 6中是否啓用了匿名訪問?
$a = gwmi -Namespace root\MicrosoftIISv2 -Class IIsWebServerSetting -ComputerName
$ServerName -Impersonation Impersonate -Authentication PacketPrivacy |
Select-object AllowAnonymous.AllowAnonymous
這給了我這樣的:
PS> $a | gm
TypeName: Selected.System.Management.ManagementObject
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
AllowAnonymous.AllowAnonymous NoteProperty AllowAnonymous.AllowAnonymous=null
如何獲得NoteProperty成我的報告變量?