title: Checking mailbox attribute and adding value if null
body: <p>I want to check an attribute of all mailboxes in an organisation; if the value is null then I want to add an attribute (email address)</p>
  
  <pre><code>get-mailbox -Organization test.me.net |
  if (-ForwardingSmtpAddress -eq {})
  {
  Set-Mailbox -DeliverToMailboxAndForward $true -ForwardingSmtpAddress admin@test.me.net
  }
  </code></pre>
  
  <p>the error message I am getting is...</p>
  
  <p>The term 'if' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling
   of the name, or if a path was included, verify that the path is correct and try again.
  At C:\Scripts\smtpaddress.ps1:2 char:3
  + if &lt;&lt;&lt;&lt;  (-ForwardingSmtpAddress -eq {})
      + CategoryInfo          : ObjectNotFound: (if:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException</p>
  
  <p>any ideas how I can resolve this?</p>
  
  <p>Thanks for reading, Colm</p>