modify script
hi,
i use ps script data:
get-qaduser -sizelimit 0 -searchroot 'domain.com/ou/ou1test' -includedproperties samaccountname,name,title,parentcontainer,streetaddress,telephonenumber,manager | sort-object -property samaccountname | select samaccountname,name,title,parentcontainer,streetaddress,telephonenumber,manager | export-csv e:\data.csv -encoding unicode
in data.csv in manager column have
cn=john johnson ,ou=sales ,ou=hq,ou=company ,dc=domain ,dc=ru
but need only
john johnson
help me please modify script.
thanks in advanced
try this:
get-qaduser -sizelimit 0 -searchroot 'domain.com/ou/ou1test' -includedproperties ` samaccountname,name,title,parentcontainer,streetaddress,telephonenumber,manager | ` sort-object -property samaccountname | ` select samaccountname,name,title,parentcontainer,streetaddress,telephonenumber,` @{n='manager';e={($_.manager -split ',')[0] -replace 'cn='}} | ` export-csv e:\data.csv -encoding unicode
grant ward, a.k.a. bigteddy
what's new in powershell 3.0 (technet wiki)
network live audit - powershell script
Windows Server > Windows PowerShell
Comments
Post a Comment