Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Powershell将辅助电话号码添加到Active Directory_Powershell_Active Directory - Fatal编程技术网

使用Powershell将辅助电话号码添加到Active Directory

使用Powershell将辅助电话号码添加到Active Directory,powershell,active-directory,Powershell,Active Directory,我正在尝试向ActiveDirectory用户添加辅助电话号码 我是在和你的朋友一起做这件事的 定速调节器 财产 根据我在网上发现的情况,应该使用add参数完成,但这不会将辅助电话号码添加到active directory 我可以添加一个电话号码和一个手机号码。但不是次要的 这是我的密码 get-aduser -filter "wWWHomepage -eq $($Line.Webpage)" | Set-ADUser -Add @{otherTelephone=$i.OfficePhoneNu

我正在尝试向ActiveDirectory用户添加辅助电话号码

我是在和你的朋友一起做这件事的

定速调节器

财产

根据我在网上发现的情况,应该使用add参数完成,但这不会将辅助电话号码添加到active directory

我可以添加一个电话号码和一个手机号码。但不是次要的

这是我的密码

get-aduser -filter "wWWHomepage -eq $($Line.Webpage)" | Set-ADUser -Add @{otherTelephone=$i.OfficePhoneNumberSecondary } 

$userobject = get-aduser -filter "wWWHomepage -eq $($Line.Webpage)" -Properties OtherTelephone

$OtherTelephone = $userobject.OtherTelephone

Write-host $userobject has been overwritten with $OtherTelephone as Current OtherTelephone
$I是csv的一部分,我从中导入用户


如何使用powershell向Active Directory添加额外的电话号码?

您的自定义属性的属性语法是什么?我的自定义属性是$I.OfficePhoneNumbers。其次,如果我理解您的意思,第一次使用AD和powershell,我是一个SQL SERVER男孩。这将为active Directory添加另一个电话号码我的意思是:如果您使用的active Directory用户和计算机启用了高级功能,您在自定义属性OtherPhone的属性编辑器中看到了什么?这就是我无法检查的问题。我在网上找到的添加新电话号码的东西是这个-添加{otherTelephone='555-222-1111','555-222-3333';otherMobile='555-222-9999'}您的语法是正确的,因此$i.OfficePhoneNumberSecondary可能有问题。在get aduser上面添加这一行。。。要查看发生了什么:将Host Secondary写入set:+$i.OfficePhoneNumberSecondary