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

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

问题描述

我想使用 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 [用户名] 时获得的属性,如下所示:

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

专有名称
已启用
GivenName
名称
ObjectClass
ObjectGUID
SamAccountName
SID

UserPrincipalName

我们在用户帐户的说明中列出了employeeID号,这在名称重复且需要弄清楚谁是谁时很有用.我正在使用的命令是:

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约翰·杜(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天全站免登陆