powershell - 导出 Active Directory 中用户的所有属性和值

标签 powershell active-directory

在 Windows 的“Active Directory 用户和计算机”中,我可以查看所有属性及其值的列表。

我需要以某种方式导出这个值列表,以便我有一个包含属性名称的列和一个包含值的列,就像图片中一样。

enter image description here

我试着用 PowerShell 来做到这一点

Get-ADUser smith -Properties * -value | Get-Member -MemberType property | Out-File "filename.csv"

但这只是给了我一个属性名称的列表,而不是值。

如何使用 PowerShell 将属性编辑器中的所有内容导出到文件?

最佳答案

我不确定您是如何得到该代码的,因为它包含许多不必要的添加,最终导致您得不到想要的东西。

你需要做的就是

Get-ADUser smith -Properties * | Out-File "filename.csv"

关于powershell - 导出 Active Directory 中用户的所有属性和值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48209119/

相关文章:

azure - 删除 Azure Active Directory

VBA 和事件目录 : Windows group visible in manual search dialog but VBA script throws error

powershell - 获取特定 OU 及其子 OU 中的用户计数

powershell - 在弹出窗口中读取主机的最简单方法?

python - 编码 : utf-8 doesn't seem to work

powershell - 创建NuGet PowerShell脚本时,如何分辨新安装和升级之间的区别?

java - 从 Java(Web 应用程序)针对 Active Directory 2016 进行身份验证

powershell - 在 PowerShell 中将多行文本粘贴为变量不起作用

powershell - 通过多个标签查找azure资源?

arrays - 在 Powershell 中比较数组