I tried that first.

$MailboxName = "rob_campb...@centraltechnology.net"

$dllpath = "C:\Program Files\Microsoft\Exchange\Web 
Services\1.0\Microsoft.Exchange.WebServices.dll"
[void][Reflection.Assembly]::LoadFile($dllpath)

$fcPropset  = new-object 
Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties)

$service = new-object 
Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2007_SP1)
$uri=[system.URI] "https://sdccas-ve1.cbc.cts/ews/exchange.asmx";
$service.Url = $uri

#$service.TraceEnabled = $true
$del = $service.getdelegates($mailboxname,$true)


$del.delegateuserresponses[0].delegateuser.userid.displayname
$del.delegateuserresponses[0].delegateuser.userid.sid
$del.delegateuserresponses[0].delegateuser.userid.primarysmtpaddress
$del.delegateuserresponses[0].delegateuser.permissions

$id = $del.delegateuserresponses[0].delegateuser.userid.sid


$service.RemoveDelegates($mailboxname,$id)



[PS] C:\Users\rob_campbell\desktop\scripts\ews>./ews_test2.ps1
Backes, Brian
S-1-5-21-1962634860-262949948-1847928074-122817
brian_bac...@ctsinc.biz


CalendarFolderPermissionLevel : Reviewer
TasksFolderPermissionLevel    : Reviewer
InboxFolderPermissionLevel    : None
ContactsFolderPermissionLevel : None
NotesFolderPermissionLevel    : None
JournalFolderPermissionLevel  : None

DelegateUser    :
Result          : Error
ErrorCode       : ErrorDelegateNoUser
ErrorMessage    : The delegate does not map to a user in the Active Directory.
ErrorDetails    : {}
ErrorProperties : {}


Then:



$MailboxName = "rob_campb...@centraltechnology.net"

$dllpath = "C:\Program Files\Microsoft\Exchange\Web 
Services\1.0\Microsoft.Exchange.WebServices.dll"
[void][Reflection.Assembly]::LoadFile($dllpath)

$fcPropset  = new-object 
Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties)

$service = new-object 
Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2007_SP1)
$uri=[system.URI] "https://sdccas-ve1.cbc.cts/ews/exchange.asmx";
$service.Url = $uri

#$service.TraceEnabled = $true
$del = $service.getdelegates($mailboxname,$true)


$del.delegateuserresponses[0].delegateuser.userid.displayname
$del.delegateuserresponses[0].delegateuser.userid.sid
$del.delegateuserresponses[0].delegateuser.userid.primarysmtpaddress
$del.delegateuserresponses[0].delegateuser.permissions

$id = $del.delegateuserresponses[0].delegateuser.userid.primarysmtpaddress


$service.RemoveDelegates($mailboxname,$id)


Backes, Brian
S-1-5-21-1962634860-262949948-1847928074-122817
brian_bac...@ctsinc.biz


CalendarFolderPermissionLevel : Reviewer
TasksFolderPermissionLevel    : Reviewer
InboxFolderPermissionLevel    : None
ContactsFolderPermissionLevel : None
NotesFolderPermissionLevel    : None
JournalFolderPermissionLevel  : None

DelegateUser    :
Result          : Success
ErrorCode       : NoError
ErrorMessage    :
ErrorDetails    : {}
ErrorProperties : {}





-----Original Message-----
From: Michael B. Smith [mailto:mich...@smithcons.com]
Sent: Friday, February 05, 2010 12:49 PM
To: MS-Exchange Admin Issues
Subject: RE: Orphaned delegates (was RE: Suppress OOF to Distribution Lists)

You should be able to use a SID, according to 
http://msdn.microsoft.com/en-us/library/bb856564(EXCHG.80).aspx

Have you tried that?

Regards,

Michael B. Smith
Consultant and Exchange MVP
http://TheEssentialExchange.com

-----Original Message-----
From: Campbell, Rob [mailto:rob_campb...@centraltechnology.net]
Sent: Friday, February 05, 2010 1:39 PM
To: MS-Exchange Admin Issues
Subject: RE: Orphaned delegates (was RE: Suppress OOF to Distribution Lists)

FYI, I've played with it enough to get it to produce a list of the delegates, 
and their delegated permissions on the folders, and I've been able to remove a 
delegate. The only identity parameter it seems to accept for the delegate to 
remove is PrimarySmtpAddress, which makes it pretty well worthless for trying 
to remove an orphan delegate.



-----Original Message-----
From: Michael B. Smith [mailto:mich...@smithcons.com]
Sent: Thursday, February 04, 2010 9:52 AM
To: MS-Exchange Admin Issues
Subject: Orphaned delegates (was RE: Suppress OOF to Distribution Lists)

I looked into this, and while I didn't write a solution (yet), it's actually 
pretty easy to do now with EWS.

Use get-mailbox to get a list of Exchange aliases, call the EWS API 
GetDelegate() to retrieve the list of delegates on that mailbox, search for the 
alias returned to see if it's still valid, if not (using ADSI or the new AD 
module cmdlets); call the EWS API RemoveDelegate() to remove the bad delegate.

Lather, rinse, repeat.

Regards,

Michael B. Smith
Consultant and Exchange MVP
http://TheEssentialExchange.com


-----Original Message-----
From: John Cook [mailto:john.c...@pfsf.org]
Sent: Friday, January 29, 2010 4:37 PM
To: MS-Exchange Admin Issues
Subject: RE: Suppress OOF to Distribution Lists

I think Lefkovics has a new gig. I'm sure my friends in Redmond have someone 
keeping an eye on the list. I actually asked them about the orphaned delegates 
thing at the stump the experts session at the Connections Vegas event, lots of 
shaking of heads, no love.......I was hoping for a PoSh solution.

John W. Cook
Systems Administrator
Partnership For Strong Families
315 SE 2nd Ave
Gainesville, Fl 32601
Office (352) 393-2741 x320
Cell     (352) 215-6944
Fax     (352) 393-2746
MCSE, MCTS, MCP+I, A+, N+, VSP4, VTSP4


-----Original Message-----
From: Michael B. Smith [mailto:mich...@smithcons.com]
Sent: Friday, January 29, 2010 4:27 PM
To: MS-Exchange Admin Issues
Subject: RE: Suppress OOF to Distribution Lists

I know Neil Hobson and Simon Butler (both Exchange MVPs from the UK) also read 
and respond on this list. I don't know if they are attending or not. William 
Lefkovics used to read and respond on this list, but I've not seen him respond 
here in a long time; I'm pretty sure he's not going (I believe I read that on 
Facebook, but I could be wrong). KevinM has rejoined Microsoft, so he'll be 
there, but not as an MVP. He and the other MSFT employees that read this list 
tend to operate in "stealth mode", for fairly obvious reasons.

-----Original Message-----
From: John Cook [mailto:john.c...@pfsf.org]
Sent: Friday, January 29, 2010 4:11 PM
To: MS-Exchange Admin Issues
Subject: RE: Suppress OOF to Distribution Lists

Hopefully you're not the only one monitoring this list......you're just the 
most helpful!

John W. Cook
Systems Administrator
Partnership For Strong Families
315 SE 2nd Ave
Gainesville, Fl 32601
Office (352) 393-2741 x320
Cell     (352) 215-6944
Fax     (352) 393-2746
MCSE, MCTS, MCP+I, A+, N+, VSP4, VTSP4


-----Original Message-----
From: Michael B. Smith [mailto:mich...@smithcons.com]
Sent: Friday, January 29, 2010 4:10 PM
To: MS-Exchange Admin Issues
Subject: RE: Suppress OOF to Distribution Lists

You need to pass that along to another MVP. With Exchange 2010 just released, 
there wasn't enough new content for me to justify the trip this year. :-(

-----Original Message-----
From: John Cook [mailto:john.c...@pfsf.org]
Sent: Friday, January 29, 2010 4:06 PM
To: MS-Exchange Admin Issues
Subject: RE: Suppress OOF to Distribution Lists

Feel free to bitchslap someone in the Office or Exchange team at the MVP Summit 
and tell them to fix it! It's nearly as bad as trying to get rid of orphaned 
calendar delegates!

John W. Cook
Systems Administrator
Partnership For Strong Families
315 SE 2nd Ave
Gainesville, Fl 32601
Office (352) 393-2741 x320
Cell     (352) 215-6944
Fax     (352) 393-2746
MCSE, MCTS, MCP+I, A+, N+, VSP4, VTSP4


-----Original Message-----
From: Michael B. Smith [mailto:mich...@smithcons.com]
Sent: Friday, January 29, 2010 4:02 PM
To: MS-Exchange Admin Issues
Subject: RE: Suppress OOF to Distribution Lists

Pretty much. I've never experienced the Outlook ones really working.

-----Original Message-----
From: John Cook [mailto:john.c...@pfsf.org]
Sent: Friday, January 29, 2010 2:51 PM
To: MS-Exchange Admin Issues
Subject: RE: Suppress OOF to Distribution Lists

So I see the options there but now I have to ask does this override the 
settings in OLK(07) if I check the allow none? Is it an all or nothing 
proposition?

John W. Cook
Systems Administrator
Partnership For Strong Families
315 SE 2nd Ave
Gainesville, Fl 32601
Office (352) 393-2741 x320
Cell     (352) 215-6944
Fax     (352) 393-2746
MCSE, MCTS, MCP+I, A+, N+, VSP4, VTSP4


-----Original Message-----
From: John Cook [mailto:john.c...@pfsf.org]
Sent: Friday, January 29, 2010 2:41 PM
To: MS-Exchange Admin Issues
Subject: RE: Suppress OOF to Distribution Lists

2007 SP1, I'll look into that, thx mikey! ;-)

John W. Cook
Systems Administrator
Partnership For Strong Families
315 SE 2nd Ave
Gainesville, Fl 32601
Office (352) 393-2741 x320
Cell     (352) 215-6944
Fax     (352) 393-2746
MCSE, MCTS, MCP+I, A+, N+, VSP4, VTSP4


-----Original Message-----
From: Michael B. Smith [mailto:mich...@smithcons.com]
Sent: Friday, January 29, 2010 2:40 PM
To: MS-Exchange Admin Issues
Subject: RE: Suppress OOF to Distribution Lists

You don't say what version of Exchange...but in 2007/2010, the properties of 
the Remote Domains are the places where you should control this.

-----Original Message-----
From: John Cook [mailto:john.c...@pfsf.org]
Sent: Friday, January 29, 2010 2:32 PM
To: MS-Exchange Admin Issues
Subject: RE: Suppress OOF to Distribution Lists

So is there ANY way to suppress OOFs to lists like these? Even if I set my OOF 
(Olk2007) to not send to outside recipients it still does.

John W. Cook
Systems Administrator
Partnership For Strong Families
315 SE 2nd Ave
Gainesville, Fl 32601
Office (352) 393-2741 x320
Cell     (352) 215-6944
Fax     (352) 393-2746
MCSE, MCTS, MCP+I, A+, N+, VSP4, VTSP4


-----Original Message-----
From: Michael B. Smith [mailto:mich...@smithcons.com]
Sent: Friday, January 29, 2010 1:51 PM
To: MS-Exchange Admin Issues
Subject: RE: Suppress OOF to Distribution Lists

To the best of my knowledge, that registry value only applies to Exchange 2003.

See here for Exchange 2007: 
http://technet.microsoft.com/en-us/library/bb629517(EXCHG.80).aspx

From: Miller Bonnie L. [mailto:mille...@mukilteo.wednet.edu]
Sent: Friday, January 29, 2010 1:28 PM
To: MS-Exchange Admin Issues
Subject: Suppress OOF to Distribution Lists

Someone at our helpdesk did not get an OOF from another person today, I'm 
trying to figure out why.  After some testing, I'm finding that an OOF message 
from Person B does NOT go to person A if person A sends to a DL that contains 
person B.

So, I did a quick search and see there is this ability to suppress OOFs to 
distribution lists 
(http://technet.microsoft.com/en-us/library/aa997729(EXCHG.80).aspx), but I do 
NOT have it configured-this value does not exist in the server's registry.

Exchange 2007 Ent SP1 RU9 on WS03 SP2 R2 all roles on one server.

Any ideas?  Do I just need to add the "SuppressOOFsToDistributionLists" value, 
set it to 0, and recycle Exchange services to make it start working?  Is there 
a good reason that one would NOT want OOFs to go back to users sending to DLs?

Thanks,
-Bonnie



CONFIDENTIALITY STATEMENT: The information transmitted, or contained or 
attached to or with this Notice is intended only for the person or entity to 
which it is addressed and may contain Protected Health Information (PHI), 
confidential and/or privileged material. Any review, transmission, 
dissemination, or other use of, and taking any action in reliance upon this 
information by persons or entities other than the intended recipient without 
the express written consent of the sender are prohibited. This information may 
be protected by the Health Insurance Portability and Accountability Act of 1996 
(HIPAA), and other Federal and Florida laws. Improper or unauthorized use or 
disclosure of this information could result in civil and/or criminal penalties.
 Consider the environment. Please don't print this e-mail unless you really 
need to.





CONFIDENTIALITY STATEMENT: The information transmitted, or contained or 
attached to or with this Notice is intended only for the person or entity to 
which it is addressed and may contain Protected Health Information (PHI), 
confidential and/or privileged material. Any review, transmission, 
dissemination, or other use of, and taking any action in reliance upon this 
information by persons or entities other than the intended recipient without 
the express written consent of the sender are prohibited. This information may 
be protected by the Health Insurance Portability and Accountability Act of 1996 
(HIPAA), and other Federal and Florida laws. Improper or unauthorized use or 
disclosure of this information could result in civil and/or criminal penalties.
 Consider the environment. Please don't print this e-mail unless you really 
need to.



CONFIDENTIALITY STATEMENT: The information transmitted, or contained or 
attached to or with this Notice is intended only for the person or entity to 
which it is addressed and may contain Protected Health Information (PHI), 
confidential and/or privileged material. Any review, transmission, 
dissemination, or other use of, and taking any action in reliance upon this 
information by persons or entities other than the intended recipient without 
the express written consent of the sender are prohibited. This information may 
be protected by the Health Insurance Portability and Accountability Act of 1996 
(HIPAA), and other Federal and Florida laws. Improper or unauthorized use or 
disclosure of this information could result in civil and/or criminal penalties.
 Consider the environment. Please don't print this e-mail unless you really 
need to.





CONFIDENTIALITY STATEMENT: The information transmitted, or contained or 
attached to or with this Notice is intended only for the person or entity to 
which it is addressed and may contain Protected Health Information (PHI), 
confidential and/or privileged material. Any review, transmission, 
dissemination, or other use of, and taking any action in reliance upon this 
information by persons or entities other than the intended recipient without 
the express written consent of the sender are prohibited. This information may 
be protected by the Health Insurance Portability and Accountability Act of 1996 
(HIPAA), and other Federal and Florida laws. Improper or unauthorized use or 
disclosure of this information could result in civil and/or criminal penalties.
 Consider the environment. Please don't print this e-mail unless you really 
need to.





CONFIDENTIALITY STATEMENT: The information transmitted, or contained or 
attached to or with this Notice is intended only for the person or entity to 
which it is addressed and may contain Protected Health Information (PHI), 
confidential and/or privileged material. Any review, transmission, 
dissemination, or other use of, and taking any action in reliance upon this 
information by persons or entities other than the intended recipient without 
the express written consent of the sender are prohibited. This information may 
be protected by the Health Insurance Portability and Accountability Act of 1996 
(HIPAA), and other Federal and Florida laws. Improper or unauthorized use or 
disclosure of this information could result in civil and/or criminal penalties.
 Consider the environment. Please don't print this e-mail unless you really 
need to.





CONFIDENTIALITY STATEMENT: The information transmitted, or contained or 
attached to or with this Notice is intended only for the person or entity to 
which it is addressed and may contain Protected Health Information (PHI), 
confidential and/or privileged material. Any review, transmission, 
dissemination, or other use of, and taking any action in reliance upon this 
information by persons or entities other than the intended recipient without 
the express written consent of the sender are prohibited. This information may 
be protected by the Health Insurance Portability and Accountability Act of 1996 
(HIPAA), and other Federal and Florida laws. Improper or unauthorized use or 
disclosure of this information could result in civil and/or criminal penalties.
 Consider the environment. Please don't print this e-mail unless you really 
need to.





**************************************************************************************************
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.
**************************************************************************************************







**************************************************************************************************
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. 
**************************************************************************************************




Reply via email to