powershell - 从电话号码中获取其他字段
问题描述
我想从 AD 用户属性中的其他字段电话号码中获取值。但是,我正在获取Microsoft.ActiveDirectory.Management.ADPropertyValueCollection
CSV 文件。
Get-ADUser -Filter {(emailaddress -like "*@domaina.com" -and Enabled -eq $true -and sAMAccountName -like "MSS*") -or (emailaddress -like "*@domainb.com" -and Enabled -eq $true -and sAMAccountName -like "MRP*")} -SearchBase "OU=Company,DC=contoso,DC=local" -SearchScope Subtree -Properties * ,otherTelephone | Select-Object givenName, sn, displayname,TelephoneNumber,HomePhone,othertelephone,mobile, ipphone, Fax , physicaldeliveryofficename,title,mail |Export-CSV -Path "C:\list.csv" -NoTypeInformation -Encoding UTF8
谢谢,
解决方案
我想这是 ADPropertyValueCollection,您可以尝试使用选择的自定义属性打开它,例如
| Select-Object ..., @{ Name=”OtherTelephone”; Expression={$_.otherTelephone.exactPropertyYouLookingFor}, ...
推荐阅读
- wordpress - 下载 Bitbucket 存储库,但保证文件名为 master.zip
- node.js - 如何在 Mocha 测试之前运行 Koa 服务器?
- reactjs - 如何使变量具有未知类型或分配“电影”?
- mysql - 如何返回每个日期的套数
- javascript - 使用 Redux 进行组件验证
- macos - 任意点击即可完成 macOS 终端进程
- typescript - 包装远程模式时重命名参数
- r - 如何在 rblast 中运行 blastp?
- github - 将 PHP 代码从 github 部署/重新部署到 GCP Compute Engine LAMP Stack 的最佳方式 [Google 点击部署]
- php - 计算 SQL 语句中的行数并存储在 PHP 变量中