一品网
  • 首页

批量导出AD用户最好一次登录时间


批量导出AD用户的最后一次登录时间

import-csv -path c:\test.csv |%{get-aduser $_.SamAccountName -Properties lastlogon} | select SamAccountName, @{n="Lastlogon";e={[datetime]::FromFileTime($_.lastlogon)}} | export-csv c:\time.csv -NoTypeInformation -encoding "utf8"

时间年份是1601的用户是一次都没有登录过

CSV文件格式如下

SamAccountName

user1

user2

user3

powershell

相关


linux版powershell中,tab补全,linux外部命令参数名,的模块介绍

Windows Terminal (Preview)治好了cmd,powershell的癌症

走进winrm ---powershell远程连接的4个安全级别,详解

linux版powershell安装教程(.net core版)

powershell读写磁盘变量(对象序列化)

powershell玩转SQL SERVER所有版本

Powershell编程基础-003-脚本的绝对路径及所在的目录

powershell中使用Get-FileHash计算文件的hash值

Windows Powershell – “Running scripts is disabled on this system”

powershell 自定义快捷键F7搜索弹窗展示历史记录

powershell 自定义tab键下拉菜单智能提示

如何去除PowerShell 更新提示

标签

一品网 冀ICP备14022925号-6