Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我从我们的 Exchange 服务器获得了一个带有标识值的脚本输出:Identity: Domain.com/OU/GivenName Surname
如何从值中删除 Domain.com/OU/?
正则表达式不是我的强项!
:/
非常感谢!!!!
您可以使用Split-Pathcmdlet 仅获取名称:
Split-Path
Split-Path 'Domain.com/OU/GivenName Surname' -Leaf
我还会尝试通过检查 Identity 是否具有 Name 属性来获取名称:
$obj.Identity.Name