0

I have created a user creation script using powershell and everything works except the attribute "ipPhone"

Can anyone tell my why i Can't add the following line?:

$Mobile = Read-Host " xxxx " 
$ipPhone = Read-Host " xxx" 

New-ADUser -ipPhone "$ipPhone"

It works for

-Mobile "$Mobile"

But it dosent work for ipPhone? Do I need to use Set-ADuser instead?

Help with Attribute

1 Answer 1

2

Cmdlet New-ADUser does not have a parameter called ipPhone.
You can set it, but then use

-OtherAttributes @{'ipPhone' = $ipPhone}

If you use Set-ADUSer, you will need to do

-replace @{'ipPhone' = $ipPhone}
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! -OtherAttributes @{'ipPhone' = $ipPhone} worked. Thank you so much
@JM1337dk Thanks for the feedback. Being new to the platform, please allow me to pint you to the tour where amongst other interesting stuff, you can read how to mark a question 'done' if an answer solved your problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.