我正在尝试获取广告用户创建的详细信息,但无法获取成员的详细信息,下面是我的脚本
$date = (Get-Date).AddDays(-7)
Get-ADUser -Filter * -Properties * |where { $_.whenCreated -ge $date } |
select Name,
MemberOf,
whenCreated,
DisplayName,
Surname,
EmployeeID,
mail| ConvertTo-Html | Out-File d:\test.html
Invoke-item d:\test.html
在 HTML 中,它为列成员提供以下输出 - “ Microsoft.ActiveDirectory.Management.ADPropertyValueCollection ”
答案1
这是因为它是一个多值属性,请尝试以下操作
date = (Get-Date).AddDays(-7)
Get-ADUser -Filter * -Properties * |where { $_.whenCreated -ge $date } |
select Name,
@{name=”MemberOf”;expression={$_.memberof -join “;”}},
whenCreated,
DisplayName,
Surname,
EmployeeID,
mail| ConvertTo-Html | Out-File D:\test.html