Concatenate Command

Hi everyone, I need a hand. With some help I created a script that creates an AD user from a text file. I need to concatenate the 3 “Set-ADUser” so that all 3 are executed. One at a time it works. Can you help me? Thank you

New-ADUser @userParams -PassThru | 
            #Set-ADUser -Replace @{pager = $($_.pager)} 
            Set-ADUser -Replace @{carLicense = $($_.HomePhone)}
            #Set-ADUser -Replace @{otherMailbox = $($_.otherMailbox)}



Actually the example #3 in the help for the cmdlet Set-AdUser explains it quite exactly how to do more than one replace …

Please always read the help for the cmdlets you’re about to use completely including the examples to learn how to use them.

1 Like