【发布时间】:2018-05-13 14:21:40
【问题描述】:
我正在尝试使用 PowerShell 自动创建 AD 用户。
这是代码:
创建广告用户
New-ADUser -Name $DisplayName `
-SamAccountName $SamAccountName `
-GivenName $FirstName `
-Surname $LastName `
-DisplayName $DisplayName `
-AccountPassword (ConvertTo-SecureString $Password -AsPlainText -Force) `
-Enabled $true `
-PasswordNeverExpires $False `
-ChangePasswordAtLogon $True `
-UserPrincipalName $UserPrincipalName `
-EmailAddress $PrimaryEmailAddress `
-OtherAttributes @{'proxyAddresses' = $proxyAddressesEmailMandatory} `
-OtherAttributes @{'ipPhone' = $UserExtension} `
属性“proxyAddress”是必需的,因此我们可以在本地 AD 和 Azure AD 之间进行 Azure AD 同步。
但是现在,我们正在尝试将 FreePBX 与本地 AD 连接起来。为了实现这一点,我们需要有“ipPhone”属性。
在我添加最后一行之前,脚本运行良好。
我可以看到问题出在哪里,但我不知道如何解决它。提供示例的帮助将不胜感激。
【问题讨论】:
标签: powershell active-directory office365