使用powershell的export-csv导出特定的字段
我正尝试使用Powershell从Active Directory 2003中导出一些用户信息的列表。 到目前为止,我能够使用这样的东西显示特定的属性列表: if ( (Get-PSSnapin -Name Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue) -eq $null ) { Add-PsSnapin Quest.ActiveRoles.ADManagement } get-qaduser -company "Company","Consultant" ` -enabled -DontUseDefaultIncludedProperties -IncludedProperties 'givenName','sn','telephoneNumber','mail','company' ` | sort-object ` | format-table givenname,sn,company,telephonenumber,mail ` 但是,如果我尝试将输出pipe道输出到export-csv,而不是format-table,我得到每个域对象的所有属性。 如果我做了如下的事情: | format-table givenname,sn,company,telephonenumber,mail ` | export-csv -Delimiter `t -NoTypeInformation -Path c:\scripts\adexport.csv 我得到正确数量的行没有数据,除了一些标识符(这是有道理的 – 因为对象没有被传入到export-csv,只是一行文本)。 如何将特定字段导出到文件? 我正在使用Quest的ActiveDirectory powershell CMDLETs( http://www.quest.com/powershell/activeroles-server.aspx […]