gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 20:32:37 27 4
gpt4 key购买 nike

在 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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com