Asked By Steven V
18-Mar-10 11:15 AM
Hi All,
I need a PS Scipt that scans my AD for users with the EmployeeID filled out
and that uses the number within that field to set a secondairy SMTP address
as in: "<EmployeeID>@somedomain.com"
Scrounging for bits and pieces on this and other forums I came up with:
Get-Mailbox -ResultSize Unlimited -Filter {employeeID -eq "<number>"} |
foreach {
$user = get-user $_
$email = "{0}@somedomain.com" -f $user.employeeID
$_.EmailAddresses+= $email
$_
} | Set-Mailbox
(I know, it should not be "-eq", it should be something else ...)
btw: I am running AD 2003 R2 and Exchange 2007 sp1 and completely new to
Powershell.
Thanks in advance for any tips and tricks!
Best regards,
Steven
--
Sorry ''bout that, I thought you said "Powersmell" ...