csvde导出计算机/用户信息

#导出计算机信息
csvde -l "cn,objectclass,description" -r "objectClass=computer" -d "ou=server,ou=admin,dc=testj,dc=com" -f d:\computerss.txt -U
$computers = select-string -path d:\computerss.txt -Pattern "objectclass","organizationalunit" -NotMatch
foreach ($computer in $computers)
{
$computer.Line.Split("""")[2].Split(",")[2] |Out-File D:\computername.txt

}
Remove-Item d:\computerss.txt


#只导出用户信息
csvde -l "cn,objectclass,description" -r "(&(objectcategory=person)(objectClass=user))" -d "ou=server,ou=admin,dc=testj,dc=com" -f d:\users.txt -U
gc d:\users.txt

posted on 2013-05-06 21:30  momingliu11  阅读(1356)  评论(0编辑  收藏  举报