Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Re-home Exchange Mailbox for users

Status
Not open for further replies.

btnet

MIS
Oct 30, 2002
54
US

Any ideas on why this errors out on the first userobj.put line?

This is running on Windows 2003 server with Exchange 2003

'Connects to the AD
Set UserObj = GetObject("WinNT://DC1/testuser")

UserObj.put "HomeMDB", "CN=DB1,CN=SG2,CN=InformationStore,CN=REX1,CN=Servers,CN=USAGROUP,CN=Administrative Groups,CN=USA,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=USAGROUP,DC=LOCAL"

UserObj.put "HomeMTA", "CN=DB1,CN=SG2,CN=InformationStore,CN=REX1,CN=Servers,CN=USAGROUP,CN=Administrative Groups,CN=USA,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=USAGROUP,DC=LOCAL"

UserObj.put "msExchHomeServerName", "/o=USA/ou=USAGROUP/cn=Configuration/cn=Servers/cn=EX1"

UserObj.SetInfo

Set UserObj = Nothing
 
The error I receive is
Error 0x8000500f

 
Since you reference the user object via the WinNT provider and that you in turn assign the path of LDAP provider, it would be bound to fail. If testuser is the user's sAMAccountName, and DC1 be the netbios domain name, you've to translate the name first and bind to it via LDAP provider. Something like this.
[tt]
dim suser, snbdom, otrans, suserdn

[blue]'givens
suser="testuser"
snbdom="DC1"[/blue]

set otrans=createobject("nametranslate")
with otrans
.init 3,""
.set 3,snbdom & "\" & suser
end with
suserdn=otrans.get(1)

set UserObj=getobject("LDAP://" & suserdn)
'continue the script to build the functionality...
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top