Discussion:
msExchRequireAuthToSendTo
(too old to reply)
Dedicated_Dad
2005-12-23 15:23:01 UTC
Permalink
Hi all.

I need a bit o' scripting help with an Exchange 2003 initiative.

I need to set the "accept messages from" attribute (properties-exchange
general-delivery restrictions-message restrictions-accept messages:) to
"authenticated users only" in order to prevent certain folks from using
internet mail.

I believe I've found the attribute -- I think it's "msExchRequireAuthToSendTo"

I need to know:
(1) do I have the right attribute
(2) can I set this by a script
(3) If so, and I do, will it accomplish the same as clicking the box manually
(4) can someone tell me how to script to read in a .csv list of accounts and
set this attribute

Thanks and happy holidays!

Alan
Onion
2006-01-10 02:15:03 UTC
Permalink
Yes, you should be able to do this with a script.

(1) do I have the right attribute:
Yes I believe so

(2) can I set this by a script:
Yes

(3) If so, and I do, will it accomplish the same as clicking the box manually:
Yes

(4) can someone tell me how to script to read in a .csv list of accounts and
set this attribute:
-See Example Read Arguments from a Text File:
http://www.microsoft.com/technet/scriptcenter/scripts/misc/input/msinvb01.mspx
-See Example Modify User Accout Address Attributes:
http://www.microsoft.com/technet/scriptcenter/scripts/ad/users/modify/usmdvb27.mspx
-Read text file for user, find user in AD in order to get DN, perform
GetObject on user DN, Put the value of TRUE into 'msExchRequireAuthToSendTo',
setinfo to save, move to next user... Wait a little while for Exchange
server to get change and the user should no longer be able to get Internet
email, additionally by default I don't think the sender will get a reply
stating that the message was not recieved. The user will still be able to
send Internet email.
Post by Dedicated_Dad
Hi all.
I need a bit o' scripting help with an Exchange 2003 initiative.
I need to set the "accept messages from" attribute (properties-exchange
general-delivery restrictions-message restrictions-accept messages:) to
"authenticated users only" in order to prevent certain folks from using
internet mail.
I believe I've found the attribute -- I think it's "msExchRequireAuthToSendTo"
(1) do I have the right attribute
(2) can I set this by a script
(3) If so, and I do, will it accomplish the same as clicking the box manually
(4) can someone tell me how to script to read in a .csv list of accounts and
set this attribute
Thanks and happy holidays!
Alan
Dedicated_Dad
2006-01-10 04:11:02 UTC
Permalink
Thanks for the reply!

I had actually previously sorted this one out -- I ended up using a slightly
different method -- I read the member list from a security group and set it
this way...

I found out the hard way that this value could only be set on the DN - the
"UserObj" method wouldn't work. Don't understand why -- I used the exact
same script to set other values with no issue but this one required the DN --
but I digress...

I'll post the script when I can - currently can't log on to this site from
work b/c the infosec people have blocked access to MSN passport logons in
order to kill the "messenger" app...

Thansk again!

DD
Dedicated_Dad
2006-01-10 21:50:02 UTC
Permalink
As promised, here's what I did...
REM ================================================
Set objGroup = GetObject _
("LDAP://cn=GroupName,ou=OhYouName,dc=COMPANY,dc=com")
objGroup.GetInfo

arrMemberOf = objGroup.GetEx("member")

For Each strMember in arrMemberOf
Set objUser = GetObject _
("LDAP://"+strMember)
objUser.msExchRequireAuthToSendTo = TRUE
objUser.SetInfo

Next
wscript.echo "Done!"
REM ================================================

Loading...