Function get-info {
foreach ($line in Get-Content $args[0]) {
$a = Get-ADUser -Filter {samaccountname -eq $line} -Properties DisplayName,CN,samaccountname | select DisplayName,CN,samaccountname
if ($a -eq $null){
Write-Output "---"
}
else{
Write-Output $a
}
}
}
get-info("D:\1.txt")
ADユーザー情報を取得するためのPowershell
おすすめ
転載: blog.51cto.com/magic3/2608866
おすすめ
ランキング