title: Change AD user attributes of users in group
body: <p>I copied and pasted together this script that looks at all the member in a certain group, and then changes all of their company names. I would now like to expand this script to be able to ask for which attribute of the users you want to change.</p>
  
  <pre><code>Clear-Host
  
  $GPNAME = Read-Host 'Provide the Group Name here'
  #$whatwhat = Read-Host 'Which Attribute do you want to change | Put a - infront'
  $attrib = Read-Host 'Give new company name here' #This should later change to "Give new info of Attribute you want to change"
  
  $description = "-description"
  $offeece = "-office"
  $department = "-department"
  $company = "-company"
  
  $Userslist = Get-ADGroupMember $GPNAME
  
  ForEach($User in $Userslist)
  {
  $user1 = $User.name
  #Write-Host $user1
  get-aduser -filter { name -eq $User1 } | set-aduser -company $attrib
  }
  </code></pre>
  
  <p>at the end of the script i would like to change the -company with $whatwhat.
  I have tried it, but no matter how, with the - or without, with ' and " around the - or the $whatwhat, it keeps on giving me this error.</p>
  
  <pre><code>Set-ADUser : A positional parameter cannot be found that accepts argument 'newly'
  </code></pre>
  
  <p>can anyone assist my to expand this script a little bit by giving the user options to choose from, or allowing him/her to type: company or description or office</p>