From: Sofia on
Hi! :)

We use a vbscript to create users. Here are the lines of code in the script
that creat the user account. The password is also set and some groups
added...

Set objUser = objUserOU.create("user", "cn=" & strEmpid)
objUser.Put "SAMAccountName", strEmpid
objUser.Put "givenName", strFirstName
objUser.Put "sn", strLastName
objUser.Put "displayName", strLastname & " " & strFirstName
objUser.AccountExpirationDate = DateAdd("d", 1, CDate(strEndDate))

objUser.Put "userPrincipalName", strEmpid & "@" & cstrADDomainName
objUser.put "mDBUseDefaults", True
objUser.put "mailNickname", strEmpiD
objUser.put "homeMDB", cstrPrivStore
objUser.put "msNPAllowDialin", True

objUser.Setinfo


Since the upgrade to Exchange 2007 the mailboxes have been created as
"Legacy mailbox" without Exchange 2007 functionality. To make the mailboxes
"User mailbox"es instead we have to log inte an exchange 2007 server and run
the powershell command: Set-Mailbox -id
<username> -ApplyMandatoryProperties.

The description of the command is: "Creating a Exchange 2007 mailbox through
the Exchange 2003 extensions to the Active Directory Users and Computers
console is not supported. If an Exchange 2007 mailbox is created with this
tool, it will be identified as a legacy mailbox, even though it resides on
an Exchange 2007 server. Use the ApplyMandatoryProperties parameter to
modify the mandatory properties of a mailbox in this state to correct the
problem and remove the legacyMailbox tag from the mailbox."

What is the problem and how do I solve it?
Since the full script is a 550 lines long .hta conversion to powershell is
not an option.

Thanks a million! :)

/Sofia


From: Wayne Tilton on
"Sofia" <@> wrote in news:OdN8IHJvKHA.5936(a)TK2MSFTNGP04.phx.gbl:

> Hi! :)
>
> We use a vbscript to create users. Here are the lines of code in the
> script that creat the user account. The password is also set and some
> groups added...
>
> Set objUser = objUserOU.create("user", "cn=" & strEmpid)
> objUser.Put "SAMAccountName", strEmpid
> objUser.Put "givenName", strFirstName
> objUser.Put "sn", strLastName
> objUser.Put "displayName", strLastname & " " & strFirstName
> objUser.AccountExpirationDate = DateAdd("d", 1, CDate(strEndDate))
>
> objUser.Put "userPrincipalName", strEmpid & "@" & cstrADDomainName
> objUser.put "mDBUseDefaults", True
> objUser.put "mailNickname", strEmpiD
> objUser.put "homeMDB", cstrPrivStore
> objUser.put "msNPAllowDialin", True
>
> objUser.Setinfo
>
>
> Since the upgrade to Exchange 2007 the mailboxes have been created as
> "Legacy mailbox" without Exchange 2007 functionality. To make the
> mailboxes "User mailbox"es instead we have to log inte an exchange
> 2007 server and run the powershell command: Set-Mailbox -id
> <username> -ApplyMandatoryProperties.
>
> The description of the command is: "Creating a Exchange 2007 mailbox
> through the Exchange 2003 extensions to the Active Directory Users and
> Computers console is not supported. If an Exchange 2007 mailbox is
> created with this tool, it will be identified as a legacy mailbox,
> even though it resides on an Exchange 2007 server. Use the
> ApplyMandatoryProperties parameter to modify the mandatory properties
> of a mailbox in this state to correct the problem and remove the
> legacyMailbox tag from the mailbox."
>
> What is the problem and how do I solve it?
> Since the full script is a 550 lines long .hta conversion to
> powershell is not an option.
>
> Thanks a million! :)
>
> /Sofia
>
>
>

Sofia,

We had a simliar issue with our in-house user provisioning tool when the
E2k7 migration started. I tried various options and ended up with
solution that sounds kind of clunky but actually has been 100% reliable.

Instead of setting the Exhchange attributes on the user object when it is
created, I create a 'mail box creation' file and drop it in a shared
directory on a server with PowerShell and ESM installed. This MB
creation file contains everything needed to create the MB, including the
target server/storage group which is picked based on a load leveling
routine (and the DC it was created on so I don't have to worry about
replication).

A scheduled task runs once a minute looking for files in the MBQueue
directory. It runs a simple batch file that reads the data from the file
and calls another batch file that runs two PS cmdlets; Enable-Mailbox and
Set-CASMailbox (for Active Sync). If successful it deletes the data file
from the queue folder, otherwise it sends an email to the tech that was
doing the user creation so they can see what went wrong.

In the 4 months we been using it, it has succesfully provisioned >1,000
mailboxes without a single error.

Hopefully that little story will help you come up with a solution for
your environment.

Wayne Tilton
From: Sofia on
Hi Wayne and thanks for your fast reply. Unfortunally this doesn't help me
at all. This script creates only one user and it needs to be done when the
script is run.

1. I am requesting vbs code that creates an exch 2007 mailbox. I don't think
this should be that hard to do...

2. I'd also like vbs code that does the same as the powershell command
"Set-Mailbox -id
<username> -ApplyMandatoryProperties".

If I cannot find any of these I will have to run the powershell command from
the vb-script instead. This is an acceptable solution but I'd prefer to
learn more about how exch 2007 works and solve the problem using vbs. :)

I've been on maternity leave for two+ years and havn't had the oppurtunity
to script for exch 2007 before now. :)

Thanks a million! :)

/Sofia



From: Al Dunbar on


"Sofia" <@> wrote in message news:#Y#5uOrvKHA.1984(a)TK2MSFTNGP05.phx.gbl...
> Hi Wayne and thanks for your fast reply. Unfortunally this doesn't help me
> at all. This script creates only one user and it needs to be done when the
> script is run.
>
> 1. I am requesting vbs code that creates an exch 2007 mailbox. I don't
> think this should be that hard to do...

I am sure that if someone here has done it , they will tell you how.

> 2. I'd also like vbs code that does the same as the powershell command
> "Set-Mailbox -id
> <username> -ApplyMandatoryProperties".
>
> If I cannot find any of these I will have to run the powershell command
> from the vb-script instead. This is an acceptable solution but I'd prefer
> to learn more about how exch 2007 works and solve the problem using vbs.
> :)

To learn more about how exchange 2007 works is to learn more about how all
of its administrative functionality is based on powershell. I suspect that
anyone trying to create a vbscript-driven shell will be driven to
distraction - even if this is only to write vbscript code to invoke the
powershell cmdlets that do what it is you want to do.

/Al

> I've been on maternity leave for two+ years and havn't had the oppurtunity
> to script for exch 2007 before now. :)
>
> Thanks a million! :)
>
> /Sofia


 | 
Pages: 1
Prev: Object required
Next: Adding Multiple Variables