首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在域上报告用户登录TimeStamps

在域上报告用户登录TimeStamps
EN

Stack Overflow用户
提问于 2019-11-19 18:00:22
回答 1查看 41关注 0票数 0

StackoverFlow!我在找我的代码帮助。它的目的是拿出列出的域名,并向我报告所有用户在域名上的登录时间邮票。

代码语言:javascript
复制
Get_ADUser -Filter * _SearchBase "dc=<nhtool>,dc=<local>" -ResultPageSize 0 -Prop CN,samaccountname,lastLogonTimestamp |
    Select CN,samaccountname,@{n="lastLogonDate";e={[datetime]::FromFileTime($_.lastLogonTimestamp)}} |
    Export-CSV -NoType "D:\TEMP\<UserTest.csv>"

我得到的错误是:

"Get_ADUser : The term 'Get_ADUser' is not recongnized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, of if a path was included, verify that the path is correct and try again. 2) At line:1 Char1: + Get_ADuser -Filter * _Searchbase "dc=,nhtool>,dc=<.local>" -ResultPag..... +Categoryinfo :ObjectNotFound (get_ADuser:String_ [], CommandNotFoundException +FullyQualifiedErrorID : CommandNotFoundException

任何帮助都将是非常感谢的,因为我的新的Powershell!

EN

回答 1

Stack Overflow用户

发布于 2019-11-19 18:32:16

谢谢大家的帮助,"<“函数是抛出我的代码的原因。这是正确的密码,谢谢!

代码语言:javascript
复制
Get-ADUser -Filter * -SearchBase "dc=nhtool,dc=local" -ResultPageSize 0 -Prop CN,samaccountname,lastLogonTimestamp | Select CN,samaccount,@{n="lastLogonDate";e={[datetime]::FromFileTime($_.lastLogonTimestamp)}} |
Export-CSV -NoType "D:\temp\UserTest.csv"
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58940204

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档