use powershell to edit proxyadresses in user account in Active Directory

Welcome Forums General PowerShell Q&A use powershell to edit proxyadresses in user account in Active Directory

Viewing 2 reply threads
  • Author
    • #269573
      Topics: 1
      Replies: 0
      Points: 12
      Rank: Member


      We have integrated office365 in AD, unfortunatelly when adding a new user and email adress for him I must to edit manually proxyadresses field in atribute editor, is very frustrating and takes a long time ;).

      Below is the code to make it faster, the code must be executed in the order shown below.

      I would like to make the task even easier and here’s a question for you

      Is possible to make in powershell a text box so when I enter a login user (e.g. john.smith) in a filed and hit enter or ok button the following code will be executed and the variable I enter will replace john.smith variable in the code below



      Thank you in advance for your help 🙂

    • #269576
      Topics: 5
      Replies: 170
      Points: 656
      Helping Hand
      Rank: Major Contributor

      If you must have a text box, you’ll need to use a Windows Form object.  See System.Windows.Forms  PoshGUI can help you make a simple form.  If you are ok with just prompting inside the shell, you can use Read-Host

    • #269582
      Topics: 16
      Replies: 1855
      Points: 3,568
      Helping Hand
      Rank: Community Hero

      Yes. Read-Host is a basic prompt, but it’s free text so you need to validate they are putting the correct information in. In this case, you would just do a Get-ADUser to find the user. One you you have the user, then that can be used in subsequent commands. The Set-ADUser should be a single command, no need to do 3 separate commands. Note that this is not test and -WhatIf is added to validate before you execute the commands in any environment.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.