If you have access to the source code of mbconn.exe or in fact any tool that can remotely connect a mailbox to an active directory user account without using that poor WMI method, please please please I beg you send it to me. I am under at least 5 different NDAs at this point in time including several for Windows Operating System Source Code access (that’s right, I can look at any program that ships with any current MS OS but can’t get the source for one silly little exe).
My intent is simply to write a nice GOOD command line tool to do reconnects. That’s it. Actually I would possibly just wrap the capability into exchmbx. Depends on what that code looks like. 😉
So PLEASE send me that source if you have access. I know there are MS people galore scanning this blog. I beg you! If you don’t feel comfortable mailing it to me, I will be in Redmond at the end of September, I can pick it up in person. 🙂
joe
Joe,
I wrote a script along with a good friend – Guy Teverovsky, that does just that. It allows you to scan an OU for Exchange recipients, prompt you to choose which server and which mbx store to use, and reconnects them to it. Are you interested?
Thanks Daniel, I assume you mean you are doing this with WMI as I do not believe this capability has been exposed to scripts in other ways. Is that the case?
If it is using WMI, I am familiar with it and have written scripts to use it, it is terribly limited.
If it doesn’t use WMI, I would love to see it.
Hey Joe! I just stumbled across this — now this is probably a waste of time, but I’ve just found it after waiting for my laptop to quietly chug away searching for *mailbox*.vbs, so here it is – some quick and dirty VB Script for linking Exchange 5.5 mailboxes to user accounts. Don’t know if this will help (probably not, as you’re the AD/ Exchange/ ADSI king, but as far as I’m aware it’s not using WMI 😉
‘ Script links user accounts to mailboxes
‘
‘
Option explicit
const DOMAIN=”NT4DOM”
const NT_SERVER=”NT4DC01″
const EXCHANGE_SERVER=”NT4DC01″
const EXCHANGE_SITE=”UK”
const EXCHANGE_ORGANISATION=”EX55″
const ADS_SID_HEXSTRING=1
const ADS_SID_WINNT_PATH=5
dim objDomain,objExBase,objUser,objMailbox,objSid,objSidHex
dim strExcPath,strAlias
strExcPath=”LDAP://”&EXCHANGE_SERVER&”/CN=Recipients,OU=”&EXCHANGE_SITE&”,O=”&EXCHANGE_ORGANISATION
set objSid=createObject(“ADsSID”)
set objDomain=getObject(“WinNT://”&DOMAIN)
set objExBase=getObject(strExcPath)
objDomain.filter=array(“user”)
On error resume next
for each objUser in objDomain
strAlias=objUser.name
set objMailbox=objExbase.getObject(“organizationalPerson”,”cn=”&strAlias)
if err.number0 then
err.clear
else
objSid.setAs ADS_SID_WINNT_PATH,”WinNT://”&DOMAIN&”/”&strAlias&”,user”
objSidHex=objSid.getAs(ADS_SID_HEXSTRING)
objMailBox.put”Assoc-NT-Account”,objSidHex
objMailBox.setInfo
end if
next
wscript.echo”Script finished.”