如何显示“描述"任何用户帐户中的属性? [英] How to display "Description" attribute in any user's account?

查看:16
本文介绍了如何显示“描述"任何用户帐户中的属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 Get-ADUser cmdlet 来确定禁用了哪些帐户.

I want to use the Get-ADUser cmdlet to determine who's accounts are disabled.

描述"没有显示任何用户帐户中的属性.

The "Description" attribute in any user's account is not showing up.

是否只有在执行 Get-ADUser [username] 时获得的属性,如下所列:

Is it only the attributes that you get when you do Get-ADUser [username], as listed here:

专有名称
已启用
名字
姓名
对象类
对象GUID
山姆帐户名称
SID
姓氏
用户主体名称

我们在用户帐户的描述中列出了员工 ID 号,这在我们有重复姓名并需要弄清楚谁是谁时很有帮助.我使用的命令是:

DistinguishedName
Enabled
GivenName
Name
ObjectClass
ObjectGUID
SamAccountName
SID
Surname
UserPrincipalName

We list the employeeID number in the description of the user account and that's helpful when we have duplicate names and need to figure out who's who. The command I'm using is:

Get-ADUser -SearchBase "OU=ou,OU=ou,OU=ou,DC=dc,DC=dc,DC=dc" -Filter {Enabled -eq $false} | FT SamAccountName,Name,Description

一个人的结果将如下所示:

and the results for one person would look like this:

SamAccountName 名称 描述
------------------------- -------- ---------------
john.doe 约翰·多伊


只是一个空白点,甚至没有 <>就像你列出了不存在的东西一样.

SamAccountName          Name                   Description
-------------------------          --------                   ---------------
john.doe                          John Doe


Just a blank spot, not even <> like if you listed something that doesn't exist.

这告诉我 Powershell 命令确认该属性存在,只是不会从 AD 帐户的信息中获取它.

That tells me the Powershell command acknowledges the attribute exists, just won't grab it from the AD Account's info.

推荐答案

听起来它不是 get-aduser 显示的默认属性之一.因此,为了获得此信息,您必须明确告诉它显示 description 属性.因此:

Sounds like it is not one of the default properties that get-aduser displays. Hence in order to get this information you have to explicitly tell it to display the description property. Hence:

Get-ADUser -Properties description -SearchBase "OU=ou,OU=ou,OU=ou,DC=dc,DC=dc,DC=dc" -Filter {Enabled -eq $false} | FT SamAccountName,Name,Description

这篇关于如何显示“描述"任何用户帐户中的属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆