$a=Read-Host "请输入要查询的用户"
Get-Aduser -identity $a  -Properties * | Select-Object SamAccountName,Name,DisplayName,memberof,SID,homeDirectory,DistinguishedName,Created,PasswordLastSet,@{n="lastLogonDate";e={[datetime]::FromFileTime($_.lastLogonTimestamp)}}

Get-ADPrincipalGroupMembership $a | Select-Object Name |Format-Table -Property * -AutoSize  #格式化输出结果

相关文章:

  • 2021-12-04
  • 2022-12-23
  • 2021-04-14
  • 2021-04-18
  • 2021-10-13
  • 2021-12-14
  • 2021-06-08
  • 2021-11-17
猜你喜欢
  • 2022-12-23
  • 2021-07-31
  • 2022-12-23
  • 2021-12-14
  • 2021-07-21
  • 2022-12-23
  • 2021-07-16
相关资源
相似解决方案