![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Create user with mailbox I'm trying to create users with mailboxes using vbscript. I do have code which does this, but the problem lies with the number of E mail addresses that are being automatically generated. The mail server will accept mail for domains: a.mydomain.org b.mydomain.org c.mydomain.org mydomain.org and my newly created user has email addresses created for all those domains, ie: TestUser01@xxxxxx TestUser01@xxxxxx and so on, but this isn't what I want. I need to be able to specify a single address for each newly created user. To achieve this, I've tried adding a line in my user creation script that specifies a single mail address, such as : objUser.PutEx ADS_PROPERTY_UPDATE, "proxyAddresses", Array("SMTP: TestUser01@xxxxxx") but although the script runs without error, and the user gets created, they cannot login via OWA. If I leave the previously mentioned line out, then user creation works,and the new user can get their mail via OWA. However they have the extra unwanted mail addresses. Could anyone tell me how to achieve the effect I want? The script I'm using follows, although word wrapping may make it look a bit odd. Regards, Richard /**********************/ Const ADS_PROPERTY_UPDATE = 2 Set objOU = GetObject("LDAP://ou=AutoCreated, dc=mydomain, dc=local") Set objUser = objOU.Create("User", "cn=01TestUser") objUser.Put "sAMAccountName", "01TestUser" objUser.Put "givenName", "TestFirstName01" objUser.Put "sn", "TestLastName01" objUser.Put "displayName", "TestDisplayName" objUser.Put "msExchHomeServerName", "/o=First Organization/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=MAIL" objUser.Put "mail", "TestUser01@xxxxxx" objUser.Put "mailnickname", "TestUser01" objUser.Put "homeMDB", "CN=Mailbox Store Unlimited,CN=First Storage Group,CN=InformationStore,CN=MAIL,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=mydomain,DC=local" objUser.Put "mDBUseDefaults", TRUE 'this line causes problems objUser.PutEx ADS_PROPERTY_UPDATE, "proxyAddresses", Array("SMTP: TestUser01@xxxxxx") objUser.Put "displayNamePrintable", "TestUser01" objUser.SetInfo objUser.Put "userPrincipalName", "TestUser01@xxxxxx" objUser.SetPassword "abcdefg" objUser.AccountDisabled = FALSE objUser.SetInfo |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Create user with mailbox On Sun, 10 Aug 2008 13:37:14 +0100, richard@xxxxxx wrote: Quote: >To achieve this, I've tried adding a line in my user creation script that specifies a single mail >address, such as : > >objUser.PutEx ADS_PROPERTY_UPDATE, "proxyAddresses", Array("SMTP: TestUser01@xxxxxx") > It seems the space matters. Using ("SMTP:TestUser01@xxxxxx" instead of ("SMTP: TestUser01@xxxxxx" fixes the problem. Richard |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Re: Powershell : Connect to the mailbox of a different user | PowerShell | |||
| Re: List AD user with or without an Exchange Mailbox | PowerShell | |||
| List AD user with or without an Exchange Mailbox | PowerShell | |||
| Exch 2003, create Mailbox from Vista machine? | PowerShell | |||
| How to create a mailbox in Exchange 2003 using Powershell | PowerShell | |||