Forum Discussion

dwmoreau's avatar
dwmoreau
Copper Contributor
Jun 18, 2020
Solved

New to Powershell - Moving Values Between Attributes

Hello,   I am new to these forums and Power Shell in general so please bare with my newness ๐Ÿ™‚   I think I will start with a little bit of history since since it may help as I maybe missing somet...
  • AndySvints's avatar
    AndySvints
    Jun 19, 2020

    dwmoreau,

    My bet, in my code snippet I did not get all needed user attributes with Get-ADUser.

    By default get ad user gets 10 user attributes and otherFacsimileTelephoneNumber is not one of them.

    Try this:

    Get-ADUser myTestUser -Properties otherFacsimileTelephoneNumber | %{Set-ADObject -Ident
    ty $_.DistinguishedName -Replace @{pager=$_.otherFacsimileTelephoneNumber | select -First 1} -Clear otherFacsimileTeleponeNumber }

    Also keep in mind that the snippet I am providing can be used for one as well as for all users:

    Get-ADUser -filter * -Properties otherFacsimileTelephoneNumber | #... everything else

     

    Hope that helps.

Resources