On Thu, 22 Mar 2012 21:35:07 +0000, lmargita wrote:
>I have some VBA that creates new user accounts. Mailboxes are creating but there is no Primary SMTP. In 2003 if you set the PrincipalUser and mailNickname it would set the Primary for you. Anyone know that call for this? ' Update User Record
Exchange 2003 used the Recipient Update Service to do that. There's no
such thing in Exchange 2007 or 2010. Use Powershell to create the user
and mailbox:
http://blogs.msdn.com/b/powershell/archive/2008/07/25/invoking-powershell-from-vbscript-com.aspxhttp://powershell.com/cs/blogs/tips/archive/2009/05/29/calling-powershell-from-vbscript.aspx Or VBS from Powershell:
http://powershell.com/cs/blogs/tips/archive/2009/06/03/calling-vbscript-from-powershell.aspx > Set oUser = oOU.Create("user", "cn=" & FullName)
> oUser.Put "cn", FullName
> oUser.Put "SamAccountName", FullName
> oUser.Put "userPrincipalName", FullName & "@pbmhmr.com"
> oUser.Put "givenName", gname
> oUser.Put "sn", sname
> oUser.Put "displayName", FullName
> oUser.Put "simpleDisplayName", FullName
> oUser.Put "mail", MailAlias & "@pbmhmr.com"
> oUser.Put "mailNickname", MailAlias
> oUser.Put "description", ID
> oUser.Put "ScriptPath", "Slogic.bat"
> oUser.Put "legacyExchangeDN", "/o=" & Organization & "/ou=" & AdminGroup & "/cn=Recipients/cn=" & MailAlias
> oUser.Put "mDBUseDefaults", "TRUE"
> oUser.Put "homeMDB", "CN=" & MDBName & ",CN=Databases,CN=" & AdminGroup & ",CN=Administrative Groups,CN=" & Organization & _
> ",CN=Microsoft Exchange,CN=Services,CN=Configuration," & DomainDN
> oUser.Put "homeMTA", "CN=Microsoft MTA,CN=" & Server & ",CN=Servers,CN=" & AdminGroup & ",CN=Administrative Groups,CN=" & Organization & _
> ",CN=Microsoft Exchange,CN=Services,CN=Configuration," & DomainDN
> oUser.Put "msExchHomeServerName", "/o=" & Organization & "/ou=" & AdminGroup & "/CN=Configuration/CN=Servers/CN=" & Server
> oUser.Put "msExchRecipientDisplayType", "1073741824"
> oUser.Put "msExchRecipientTypeDetails", "1"
> oUser.Put "msExchPoliciesIncluded", "{CAF8E0C1-FCD9-48EC-A76E-6D9C7AB75AAF},{26491CFC-9E50-4857-861B-0CB8DF22B5D7}"
> oUser.Put "textEncodedORAddress", "X400:C=us;A=;P=" & Organization & ";O=Exchange;S=" & sname & ";G=" & gname & ";"
> oUser.Put "showInAddressBook", "CN=Default Global Address List,CN=All Global Address Lists,CN=Address Lists Container," & _
> "CN=" & Organization & ",CN=Microsoft Exchange,CN=Services,CN=Configuration," & DomainDN
> oUser.Put "proxyAddresses", "smtp:" & Alias & "@pbmhmr.com"
>
> oUser.SetInfo
> oUser.GetInfo
>
>
>
---
Rich Matheisen
MCSE+I, Exchange MVP
--- Rich Matheisen MCSE+I, Exchange MVP
Need to support users over the internet?
click here try our remote control online beta