Mass-Removing Alias Addresses

2009-06-12 Thread John Hornbuckle
We're an Exchange 2007 shop, and a number of our users have aliases that are no 
longer needed. For a time, we needed mail addressed to either 
u...@taylor.k12.fl.us or u...@exchange.taylor.k12.fl.us to go to the user. But 
that transition period is over, and we no longer need the 
@exchange.taylor.k12.fl.us addresses/aliases.

Is there a an easy way to remove those from my users' accounts, or do I have to 
go in one by one and do it?



John Hornbuckle
MIS Department
Taylor County School District
318 North Clark Street
Perry, FL 32347

www.taylor.k12.fl.us





NOTICE: Florida has a broad public records law. Most written communications to 
or from this entity are public records that will be disclosed to the public and 
the media upon request. E-mail communications may be subject to public 
disclosure.


~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
~ http://www.sunbeltsoftware.com/Ninja~



RE: Mass-Removing Alias Addresses

2009-06-12 Thread Campbell, Rob
Powershell can do that.  

-Original Message-
From: John Hornbuckle [mailto:john.hornbuc...@taylor.k12.fl.us] 
Sent: Friday, June 12, 2009 9:17 AM
To: MS-Exchange Admin Issues
Subject: Mass-Removing Alias Addresses

We're an Exchange 2007 shop, and a number of our users have aliases that are no 
longer needed. For a time, we needed mail addressed to either 
u...@taylor.k12.fl.us or u...@exchange.taylor.k12.fl.us to go to the user. But 
that transition period is over, and we no longer need the 
@exchange.taylor.k12.fl.us addresses/aliases.

Is there a an easy way to remove those from my users' accounts, or do I have to 
go in one by one and do it?



John Hornbuckle
MIS Department
Taylor County School District
318 North Clark Street
Perry, FL 32347

www.taylor.k12.fl.us





NOTICE: Florida has a broad public records law. Most written communications to 
or from this entity are public records that will be disclosed to the public and 
the media upon request. E-mail communications may be subject to public 
disclosure.


~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
~ http://www.sunbeltsoftware.com/Ninja~


**
Note: 
The information contained in this message may be privileged and confidential 
and 
protected from disclosure.  If the reader of this message is not the intended  
recipient, or an employee or agent responsible for delivering this message to  
the intended recipient, you are hereby notified that any dissemination,   
distribution or copying of this communication is strictly prohibited. If you  
have received this communication in error, please notify us immediately by  
replying to the message and deleting it from your computer. 
**



~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
~ http://www.sunbeltsoftware.com/Ninja~



RE: Mass-Removing Alias Addresses

2009-06-12 Thread John Hornbuckle
I thought it might.

My PS skills are weak, though...



-Original Message-
From: Campbell, Rob [mailto:rob_campb...@centraltechnology.net] 
Sent: Friday, June 12, 2009 10:25 AM
To: MS-Exchange Admin Issues
Subject: RE: Mass-Removing Alias Addresses

Powershell can do that.  

-Original Message-
From: John Hornbuckle [mailto:john.hornbuc...@taylor.k12.fl.us] 
Sent: Friday, June 12, 2009 9:17 AM
To: MS-Exchange Admin Issues
Subject: Mass-Removing Alias Addresses

We're an Exchange 2007 shop, and a number of our users have aliases that are no 
longer needed. For a time, we needed mail addressed to either 
u...@taylor.k12.fl.us or u...@exchange.taylor.k12.fl.us to go to the user. But 
that transition period is over, and we no longer need the 
@exchange.taylor.k12.fl.us addresses/aliases.

Is there a an easy way to remove those from my users' accounts, or do I have to 
go in one by one and do it?



John Hornbuckle
MIS Department
Taylor County School District
318 North Clark Street
Perry, FL 32347

www.taylor.k12.fl.us





NOTICE: Florida has a broad public records law. Most written communications to 
or from this entity are public records that will be disclosed to the public and 
the media upon request. E-mail communications may be subject to public 
disclosure.


~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
~ http://www.sunbeltsoftware.com/Ninja~


**
Note: 
The information contained in this message may be privileged and confidential 
and 
protected from disclosure.  If the reader of this message is not the intended  
recipient, or an employee or agent responsible for delivering this message to  
the intended recipient, you are hereby notified that any dissemination,   
distribution or copying of this communication is strictly prohibited. If you  
have received this communication in error, please notify us immediately by  
replying to the message and deleting it from your computer. 
**



~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
~ http://www.sunbeltsoftware.com/Ninja~



NOTICE: Florida has a broad public records law. Most written communications to 
or from this entity are public records that will be disclosed to the public and 
the media upon request. E-mail communications may be subject to public 
disclosure.


~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
~ http://www.sunbeltsoftware.com/Ninja~



Re: Mass-Removing Alias Addresses

2009-06-12 Thread James Rankin
Sounds like an Obi-Wan Kenobi moment... :-)

2009/6/12 John Hornbuckle john.hornbuc...@taylor.k12.fl.us

 I thought it might.

 My PS skills are weak, though...



 -Original Message-
 From: Campbell, Rob [mailto:rob_campb...@centraltechnology.net]
 Sent: Friday, June 12, 2009 10:25 AM
 To: MS-Exchange Admin Issues
 Subject: RE: Mass-Removing Alias Addresses

 Powershell can do that.

 -Original Message-
 From: John Hornbuckle [mailto:john.hornbuc...@taylor.k12.fl.us]
 Sent: Friday, June 12, 2009 9:17 AM
 To: MS-Exchange Admin Issues
 Subject: Mass-Removing Alias Addresses

 We're an Exchange 2007 shop, and a number of our users have aliases that
 are no longer needed. For a time, we needed mail addressed to either
 u...@taylor.k12.fl.us or u...@exchange.taylor.k12.fl.us to go to the user.
 But that transition period is over, and we no longer need the @
 exchange.taylor.k12.fl.us addresses/aliases.

 Is there a an easy way to remove those from my users' accounts, or do I
 have to go in one by one and do it?



 John Hornbuckle
 MIS Department
 Taylor County School District
 318 North Clark Street
 Perry, FL 32347

 www.taylor.k12.fl.us





 NOTICE: Florida has a broad public records law. Most written communications
 to or from this entity are public records that will be disclosed to the
 public and the media upon request. E-mail communications may be subject to
 public disclosure.


 ~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
 ~ http://www.sunbeltsoftware.com/Ninja~



 **
 Note:
 The information contained in this message may be privileged and
 confidential and
 protected from disclosure.  If the reader of this message is not the
 intended
 recipient, or an employee or agent responsible for delivering this message
 to
 the intended recipient, you are hereby notified that any dissemination,
 distribution or copying of this communication is strictly prohibited. If
 you
 have received this communication in error, please notify us immediately by
 replying to the message and deleting it from your computer.

 **



 ~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
 ~ http://www.sunbeltsoftware.com/Ninja~



 NOTICE: Florida has a broad public records law. Most written communications
 to or from this entity are public records that will be disclosed to the
 public and the media upon request. E-mail communications may be subject to
 public disclosure.


 ~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
 ~ http://www.sunbeltsoftware.com/Ninja~



~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
~ http://www.sunbeltsoftware.com/Ninja~

RE: Mass-Removing Alias Addresses

2009-06-12 Thread John Hornbuckle
I'll just wait until you've got it ironed out...

;-)



-Original Message-
From: Campbell, Rob [mailto:rob_campb...@centraltechnology.net] 
Sent: Friday, June 12, 2009 10:51 AM
To: MS-Exchange Admin Issues
Subject: RE: Mass-Removing Alias Addresses

I need another cup of coffee.

To do one mailbox:

$mbx = Get-mailbox mailbox id
$addrs = $mbx.emailaddresses |? {$_.smtpaddress -notlike 
*...@exchange.taylor.k12.fl.us}
Set-mailbox $mbx -emailaddresses $addrs
}



-Original Message-
From: Campbell, Rob [mailto:rob_campb...@centraltechnology.net] 
Sent: Friday, June 12, 2009 9:45 AM
To: MS-Exchange Admin Issues
Subject: RE: Mass-Removing Alias Addresses

Correction:

Get-mailbox |% {
$addrs = $_.emailaddresses |? {$_.smtpaddress -notlike 
*...@exchange.taylor.k12.fl.us}
Set-mailbox $_ -emailaddresses $addrs
}



To do one mailbox:

$mbx = Get-mailbox 
$addrs = $mbx.emailaddresses |? {$_.smtpaddress -notlike 
*...@exchange.taylor.k12.fl.us}
Set-mailbox $mbx -emailaddresses $addrs
}

-Original Message-
From: Campbell, Rob [mailto:rob_campb...@centraltechnology.net] 
Sent: Friday, June 12, 2009 9:36 AM
To: MS-Exchange Admin Issues
Subject: RE: Mass-Removing Alias Addresses

You'll need to test on a sample (do the get-mailbox on a single mailbox first) 
and check the results, but this should work:

Beware of wrappage

Get-mailbox |% {
$addrs = $_.emailaddresses |? {$_.smtpaddress -notlike 
*...@exchange.taylor.k12.fl.us}
Set-mailbox -emailaddresses $addrs
}

-Original Message-
From: John Hornbuckle [mailto:john.hornbuc...@taylor.k12.fl.us] 
Sent: Friday, June 12, 2009 9:17 AM
To: MS-Exchange Admin Issues
Subject: Mass-Removing Alias Addresses

We're an Exchange 2007 shop, and a number of our users have aliases that are no 
longer needed. For a time, we needed mail addressed to either 
u...@taylor.k12.fl.us or u...@exchange.taylor.k12.fl.us to go to the user. But 
that transition period is over, and we no longer need the 
@exchange.taylor.k12.fl.us addresses/aliases.

Is there a an easy way to remove those from my users' accounts, or do I have to 
go in one by one and do it?



John Hornbuckle
MIS Department
Taylor County School District
318 North Clark Street
Perry, FL 32347

www.taylor.k12.fl.us





NOTICE: Florida has a broad public records law. Most written communications to 
or from this entity are public records that will be disclosed to the public and 
the media upon request. E-mail communications may be subject to public 
disclosure.


~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
~ http://www.sunbeltsoftware.com/Ninja~


**
Note: 
The information contained in this message may be privileged and confidential 
and 
protected from disclosure.  If the reader of this message is not the intended  
recipient, or an employee or agent responsible for delivering this message to  
the intended recipient, you are hereby notified that any dissemination,   
distribution or copying of this communication is strictly prohibited. If you  
have received this communication in error, please notify us immediately by  
replying to the message and deleting it from your computer. 
**



~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
~ http://www.sunbeltsoftware.com/Ninja~


**
Note: 
The information contained in this message may be privileged and confidential 
and 
protected from disclosure.  If the reader of this message is not the intended  
recipient, or an employee or agent responsible for delivering this message to  
the intended recipient, you are hereby notified that any dissemination,   
distribution or copying of this communication is strictly prohibited. If you  
have received this communication in error, please notify us immediately by  
replying to the message and deleting it from your computer. 
**



~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
~ http://www.sunbeltsoftware.com/Ninja~


**
Note: 
The information contained in this message may be privileged and confidential 
and 
protected from disclosure.  If the reader of this message is not the intended  
recipient, or an employee or agent responsible for delivering this message to  
the intended recipient, you are hereby notified that any dissemination,   
distribution or copying of this communication is strictly prohibited. If you  
have received this communication in error, please notify us immediately

RE: Mass-Removing Alias Addresses

2009-06-12 Thread Campbell, Rob
That should be it.

If you run into any problems with it, contact me off-list.

-Original Message-
From: John Hornbuckle [mailto:john.hornbuc...@taylor.k12.fl.us] 
Sent: Friday, June 12, 2009 9:53 AM
To: MS-Exchange Admin Issues
Subject: RE: Mass-Removing Alias Addresses

I'll just wait until you've got it ironed out...

;-)



-Original Message-
From: Campbell, Rob [mailto:rob_campb...@centraltechnology.net] 
Sent: Friday, June 12, 2009 10:51 AM
To: MS-Exchange Admin Issues
Subject: RE: Mass-Removing Alias Addresses

I need another cup of coffee.

To do one mailbox:

$mbx = Get-mailbox mailbox id
$addrs = $mbx.emailaddresses |? {$_.smtpaddress -notlike 
*...@exchange.taylor.k12.fl.us}
Set-mailbox $mbx -emailaddresses $addrs
}



-Original Message-
From: Campbell, Rob [mailto:rob_campb...@centraltechnology.net] 
Sent: Friday, June 12, 2009 9:45 AM
To: MS-Exchange Admin Issues
Subject: RE: Mass-Removing Alias Addresses

Correction:

Get-mailbox |% {
$addrs = $_.emailaddresses |? {$_.smtpaddress -notlike 
*...@exchange.taylor.k12.fl.us}
Set-mailbox $_ -emailaddresses $addrs
}



To do one mailbox:

$mbx = Get-mailbox 
$addrs = $mbx.emailaddresses |? {$_.smtpaddress -notlike 
*...@exchange.taylor.k12.fl.us}
Set-mailbox $mbx -emailaddresses $addrs
}

-Original Message-
From: Campbell, Rob [mailto:rob_campb...@centraltechnology.net] 
Sent: Friday, June 12, 2009 9:36 AM
To: MS-Exchange Admin Issues
Subject: RE: Mass-Removing Alias Addresses

You'll need to test on a sample (do the get-mailbox on a single mailbox first) 
and check the results, but this should work:

Beware of wrappage

Get-mailbox |% {
$addrs = $_.emailaddresses |? {$_.smtpaddress -notlike 
*...@exchange.taylor.k12.fl.us}
Set-mailbox -emailaddresses $addrs
}

-Original Message-
From: John Hornbuckle [mailto:john.hornbuc...@taylor.k12.fl.us] 
Sent: Friday, June 12, 2009 9:17 AM
To: MS-Exchange Admin Issues
Subject: Mass-Removing Alias Addresses

We're an Exchange 2007 shop, and a number of our users have aliases that are no 
longer needed. For a time, we needed mail addressed to either 
u...@taylor.k12.fl.us or u...@exchange.taylor.k12.fl.us to go to the user. But 
that transition period is over, and we no longer need the 
@exchange.taylor.k12.fl.us addresses/aliases.

Is there a an easy way to remove those from my users' accounts, or do I have to 
go in one by one and do it?



John Hornbuckle
MIS Department
Taylor County School District
318 North Clark Street
Perry, FL 32347

www.taylor.k12.fl.us





NOTICE: Florida has a broad public records law. Most written communications to 
or from this entity are public records that will be disclosed to the public and 
the media upon request. E-mail communications may be subject to public 
disclosure.


~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
~ http://www.sunbeltsoftware.com/Ninja~


**
Note: 
The information contained in this message may be privileged and confidential 
and 
protected from disclosure.  If the reader of this message is not the intended  
recipient, or an employee or agent responsible for delivering this message to  
the intended recipient, you are hereby notified that any dissemination,   
distribution or copying of this communication is strictly prohibited. If you  
have received this communication in error, please notify us immediately by  
replying to the message and deleting it from your computer. 
**



~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
~ http://www.sunbeltsoftware.com/Ninja~


**
Note: 
The information contained in this message may be privileged and confidential 
and 
protected from disclosure.  If the reader of this message is not the intended  
recipient, or an employee or agent responsible for delivering this message to  
the intended recipient, you are hereby notified that any dissemination,   
distribution or copying of this communication is strictly prohibited. If you  
have received this communication in error, please notify us immediately by  
replying to the message and deleting it from your computer. 
**



~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
~ http://www.sunbeltsoftware.com/Ninja~


**
Note: 
The information contained in this message may be privileged and confidential 
and 
protected from disclosure.  If the reader of this message is not the intended  
recipient, or an employee or agent

Re: Mass-Removing Alias Addresses

2009-06-12 Thread Eric Woodford
Mine is a bit more complicated, but it was written to work against Exchange
2003 first. The following function Remove_LegacyAddress takes 2 entries, a
mailbox object and a string for the dead domain.

You'd use it something like:
$deaddomain = exchange.taylor.k12.fl.us
$mbxes = get-mailbox -resultsize unlimited | ?{$_.emailaddresses -match
$deaddomain}

ForEach ($mbx in $mbxes) {
   Remove_LegacyAddress $mbx $deadDomain
}

###
function Remove_LegacyAddress ($u, [string]$deadDomain) {
 if ($u -is [array]) {
  $mdn = $u[0].distinguishedname
 } else {
  $mdn = $u.distinguishedname
 }
 $mldapStr = LDAP://+$mdn ldap://+$mdn/
 $mldap = [adsi]$mldapstr
 $pa = $mldap.proxyaddresses
 Before: +$U.displayname
 $pa
 $BlankAddr = @()
 foreach ($addr in $PA) {
  if ($addr -notmatch $DeadDomain ) {
   $blankaddr += $addr
  }
 }
 #Find out if NO primary SMTP
 $x = $blankaddr -match SMTP:
 if ($x.length -ne 0) {
  $y = $blankaddr -cmatch SMTP:
  if ($y.length -eq 0) {
   No Primary SMTP
   #$x
   $tempAddr = @()
   $a = $x[0].replace(smtp:,SMTP:)
   $tempAddr += $a
   foreach ($Addr in $blankAddr) {
if ($addr -notmatch $a) {
 $tempaddr += $addr
}
   }
   $blankaddr = $tempAddr
  }
 }
 Write-Host  
 Write-Host After:
 if ($pa -eq $blankaddr) {
   - no change
 } else {
  $blankaddr
  $mldap.proxyaddresses = $blankaddr
  $mldap.setinfo()
 }
}

#

On Fri, Jun 12, 2009 at 7:50 AM, Campbell, Rob 
rob_campb...@centraltechnology.net wrote:

 I need another cup of coffee.

 To do one mailbox:

 $mbx = Get-mailbox mailbox id
 $addrs = $mbx.emailaddresses |? {$_.smtpaddress -notlike *@
 exchange.taylor.k12.fl.us}
 Set-mailbox $mbx -emailaddresses $addrs
 }



 -Original Message-
 From: Campbell, Rob [mailto:rob_campb...@centraltechnology.net]
  Sent: Friday, June 12, 2009 9:45 AM
 To: MS-Exchange Admin Issues
 Subject: RE: Mass-Removing Alias Addresses

 Correction:

 Get-mailbox |% {
 $addrs = $_.emailaddresses |? {$_.smtpaddress -notlike *@
 exchange.taylor.k12.fl.us}
 Set-mailbox $_ -emailaddresses $addrs
 }



 To do one mailbox:

 $mbx = Get-mailbox
 $addrs = $mbx.emailaddresses |? {$_.smtpaddress -notlike *@
 exchange.taylor.k12.fl.us}
 Set-mailbox $mbx -emailaddresses $addrs
 }

 -Original Message-
 From: Campbell, Rob [mailto:rob_campb...@centraltechnology.net]
 Sent: Friday, June 12, 2009 9:36 AM
 To: MS-Exchange Admin Issues
 Subject: RE: Mass-Removing Alias Addresses

 You'll need to test on a sample (do the get-mailbox on a single mailbox
 first) and check the results, but this should work:

 Beware of wrappage

 Get-mailbox |% {
 $addrs = $_.emailaddresses |? {$_.smtpaddress -notlike *@
 exchange.taylor.k12.fl.us}
 Set-mailbox -emailaddresses $addrs
 }

 -Original Message-
 From: John Hornbuckle [mailto:john.hornbuc...@taylor.k12.fl.us]
 Sent: Friday, June 12, 2009 9:17 AM
 To: MS-Exchange Admin Issues
 Subject: Mass-Removing Alias Addresses

 We're an Exchange 2007 shop, and a number of our users have aliases that
 are no longer needed. For a time, we needed mail addressed to either
 u...@taylor.k12.fl.us or u...@exchange.taylor.k12.fl.us to go to the user.
 But that transition period is over, and we no longer need the @
 exchange.taylor.k12.fl.us addresses/aliases.

 Is there a an easy way to remove those from my users' accounts, or do I
 have to go in one by one and do it?



 John Hornbuckle
 MIS Department
 Taylor County School District
 318 North Clark Street
 Perry, FL 32347

 www.taylor.k12.fl.us





 NOTICE: Florida has a broad public records law. Most written communications
 to or from this entity are public records that will be disclosed to the
 public and the media upon request. E-mail communications may be subject to
 public disclosure.


 ~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
 ~ http://www.sunbeltsoftware.com/Ninja~



 **
 Note:
 The information contained in this message may be privileged and
 confidential and
 protected from disclosure.  If the reader of this message is not the
 intended
 recipient, or an employee or agent responsible for delivering this message
 to
 the intended recipient, you are hereby notified that any dissemination,
 distribution or copying of this communication is strictly prohibited. If
 you
 have received this communication in error, please notify us immediately by
 replying to the message and deleting it from your computer.

 **



 ~ Ninja Email Security with Cloudmark Spam Engine Gets Image Spam ~
 ~ http://www.sunbeltsoftware.com/Ninja~



 **
 Note:
 The information contained in this message may be privileged and
 confidential and
 protected from disclosure