Remove MBX:0 attribute from ProxyAddresses via Powershell?
Guys,
Trying to apply a managed folder policy but I'm getting a number of errors stating that the proxy address MBX:0 is already in use. I know you can use ADSI edit to remove the entry from the list but I wanted a way to do it through powershell.
What I have works on an array I create myself but when I run it against the proxyaddress array in AD it's telling me it's a "read only" property?
$user = Get-QADObject -Identity "XXXX"
ForEach($i in $user.ProxyAddresses)
{
if($i -match "MBX:0")
{
$user.ProxyAddresses = $user.ProxyAddresses | ?{$_ -ne "MBX:0"}
}
}
Anthony
December 22nd, 2011 10:15am
Hi akcorr,
If you use ADSI edit to remove the proxy address MBX:0 , can you remove it?
If so, I think you can use these commands to remove it:
$Users=Get-User
foreach ($user in $Users)
{
$adsiUser = [ADSI]"LDAP://$($User.OriginatingServer)/$($User.DistinguishedName)";
$adsiUser.proxyaddresses.remove("MBX:0");
$adsiUser.SetInfo()
}
Thanks,
Evan Liu
TechNet Subscriber Support
in forum
If you have any feedback on our support, please contact
tngfb@microsoft.com Evan Liu
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
December 23rd, 2011 3:43am
Hi akcorr,
If you use ADSI edit to remove the proxy address MBX:0 , can you remove it?
If so, I think you can use these commands to remove it:
$Users=Get-User
foreach ($user in $Users)
{
$adsiUser = [ADSI]"LDAP://$($User.OriginatingServer)/$($User.DistinguishedName)";
$adsiUser.proxyaddresses.remove("MBX:0");
$adsiUser.SetInfo()
}
Thanks,
Evan Liu
TechNet Subscriber Support
in forum
If you have any feedback on our support, please contact
tngfb@microsoft.com Evan Liu
TechNet Community Support
December 23rd, 2011 11:37am
Hi akcorr,
How about the issue, any updates?
Thanks,
Evan Liu
TechNet Subscriber Support
in forum
If you have any feedback on our support, please contact
tngfb@microsoft.com Evan Liu
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
December 26th, 2011 8:29pm
Hi akcorr,
How about the issue, any updates?
Thanks,
Evan Liu
TechNet Subscriber Support
in forum
If you have any feedback on our support, please contact
tngfb@microsoft.com
Evan Liu
TechNet Community Support
Thank you my friend!!! That worked!! You just saved me a hand from a ton of GUI clicks :)Anthony
January 4th, 2012 4:24pm