powershell - 如何使用powershell在Notes字段中附加文本
问题描述
我正在尝试Notes
使用以下脚本更新字段
Set-Group -Identity "DLName" -Notes "Comment" -ErrorAction Stop
如果上面的脚本已经有任何内容,则替换它的内容。Notes
我想在备注字段中追加新数据。请帮我解决一下这个。
解决方案
Here you go:
$group = Get-AdGroup "DLName" -Properties info
$notes = $group.info
$notes += " Comment"
Set-AdGroup $group -Replace @{info = $notes}
Bear in mind that Notes (LDAP attribute name info) is a single-valued attribute, so don't forget to add whitespaces or line breaks when appending values.
推荐阅读
- botframework - 有什么方法可以连接本地运行的代码和微软团队的频道进行交流。基本上是一个机器人?
- ios - iOS应用程序中未定义的符号_GULResetLogger
- c++ - 如何使用 gmock(Google Mock)模拟模板类?
- c# - 数据未保存在 SQL Server (ASP.NET) 中
- typescript - 带有打字稿快照的泛型
- testing - 非技术人员的测试工具和指南
- webpack - Rails 6 + webpack + turbolinks:在第一页加载时不起作用
- c# - 为 Cosmos 客户端编写单元测试时出错(无法转换列表
到任务 > ) - powershell - 使用部分键入的命令启动新的 powershell 窗口
- vue.js - 如何在Vue js的方法中获取计算的属性数据?