appending text to automate domain name change and alias

Welcome Forums General PowerShell Q&A appending text to automate domain name change and alias

Viewing 1 reply thread
  • Author
    Posts
    • #241970
      Participant
      Topics: 1
      Replies: 0
      Points: -9
      Rank: Member

      Hi, I’m want make bulk changes using below script to change primary domain (the new domain) and make alias for old domain.  My csv has usernname, proxyaddress, proxyaddress2:

      there is error at below:

      Please assist. thanks

      • This topic was modified 6 months, 2 weeks ago by kounzo95.
      • This topic was modified 6 months, 2 weeks ago by kounzo95.
      • This topic was modified 6 months, 2 weeks ago by kvprasoon. Reason: code formatting
      • This topic was modified 6 months, 2 weeks ago by kvprasoon.
    • #242021
      Participant
      Topics: 1
      Replies: 59
      Points: 590
      Helping Hand
      Rank: Major Contributor

      Hello kounzo95,
      Welcome to PowerShell.org forum.
      Please read Read Me Before Posting! You’ll be Glad You Did! and make sure to format your code property going forward.

      From the script it looks like you are operating with the collection of usernames ( $users.proxyaddres ) not specific username that you have inside your foreach loop ( $user).

      Try changing $users.proxyaddress to $user.

      Also I would move the domain definition outside of Foreach loop. Right now you are initializing $domain variable for each user.

      Hope that helps.

Viewing 1 reply thread
  • The topic ‘appending text to automate domain name change and alias’ is closed to new replies.