批量导出AD账号
Get-ADuser -searchbase ' OU=User,OU=Compay1,DC=Domain,DC=COM ' -filter * -Properties * | Select-Object Name,SID, Created,PasswordLastSet,@{n="lastLogonDate";e={[datetime]::FromFileTime($_.lastLogonTimestamp)}} | Export-CSV Accountlist.csv -NoTypeInformation -Encoding UTF8
Get-ADUser -filter * -SearchBase 'OU=Managed,DC=contoso,DC=com' -Properties *| select DistinguishedName,EmailAddress,EmployeeID,Name,SamAccountName,userAccountControl | export-csv C:\Users\test\Desktop\Allusers.csv
本文转自学海无涯博客51CTO博客,原文链接http://blog.51cto.com/549687/1734634如需转载请自行联系原作者
520feng2007