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")
Powershell获取AD用户信息
原创史振宁的技术博客 博主文章分类:ActiveDirectory ©著作权
文章标签 powershell 文章分类 运维
上一篇:MacOS 10导入信任证书
下一篇:Exchange删除邮件

-
C# Asp.Net 企业微信获取当前用户信息网页授权 企业微信
-
PowerShell 获取AD域用户属性
1、获取指定用户的所有属性。
AD ci Server 用户信息 -
Powershell 修改AD用户属性
Powershell 脚本批量修改AD用户属性
PowerShell AD