iT邦幫忙

0

Powershell Script to export Active Directory users to CSV 中文亂碼處理方式及數字補零

尼克 2017-07-19 16:04:1726274 瀏覽

Powershell Script to export Active Directory users to CSV

  1. CSV檔案中文會亂碼:請使用上面Powershell 的程式,最後一段加入-encoding utf8 字樣,即可達成匯出中文字不會亂碼。
     #Export CSV report
     Export-Csv -Path $csvfile -NoTypeInformation -encoding utf8
  1. EXCEL直接打開完成的CSV會出現數字沒有補零的問題:原始檔案數字 0010 結果EXCEL中僅顯示 10 ,如何讓前面零出現
    解決方法以EXCEL 2010為範例:
    開始EXCEL –>資料—>從文字檔—>選擇要匯入的檔案
    2.1
    http://ithelp.ithome.com.tw/upload/images/20170719/20011825avG1lQy7mJ.png
    2.2
    http://ithelp.ithome.com.tw/upload/images/20170719/20011825L4TtTk3oAr.png
    2.3
    http://ithelp.ithome.com.tw/upload/images/20170719/20011825zucWgIh5kw.png

完成後收工。
資料同步於。


圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言