我有几个需要调查的 IIS 6 网站。我需要检查的项目之一是 AllowAnonymous。我需要知道它是真还是假。我找到了这段代码:
$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 放入我的报告的变量中?