由于GE使用的是Windows2003+Powershell2.0, 所以某些命令无法使用,比如想取lastLogon和lastLogonTimestamp这两个属性,在Powershell3.0下可以直接用以下命令实现:
Get-ADComputer -Filter * -SearchBase "OU=Computers,OU=Hangzhou - China,OU=TCS - China,OU=TCS - China,DC=apac,DC=TCS,DC=com" -Properties * | select lastLogon, lastLogonTimestamp 
 
但是在Powershell2.0环境下只能曲线救国:
Get-ADComputer -Filter * -SearchBase "OU=COMPUTERS,OU=RESTRICTED,OU=CHINA,DC=tcsgegdc,DC=com" | Get-ADComputer -Properties name, lastLogon, lastLogonTimestamp | select name, @{name="LastLogon"; express={[DateTime]::FromFileTime($_.LastLogon)}},@{name="LastLogontimestamp"; express={[DateTime]::FromFileTime($_.LastLogontimestamp)}} 

相关文章:

  • 2022-12-23
  • 2021-07-01
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2021-12-27
猜你喜欢
  • 2021-08-28
  • 2022-12-23
  • 2022-12-23
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案