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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Powershell script causes problems since Exchange 2007-2010 upgrade 1

Status
Not open for further replies.

disturbedone

Vendor
Sep 28, 2006
781
AU
Hi, I'm relatively new to Powershell. A script was written by a contractor to add an AD user & mailbox in our Exchange 2007 environment. We upgraded to 2010 recently and now the script causes a problem.

Having extracted the single line in the script that adds the user/mailbox I've found it is the cause. The script itself generates an error on a later command but that's because the mailbox was not created properly initially.

The command is as follows. Obviously things like $FULLNAME are inputted by the user during the script.

New-Mailbox -Name $FULLNAME -Alias $LOGONALIAS -OrganizationalUnit "grammar.local/CGS/USERS/STAFF" -UserPrincipalName $LOGONALIAS@grammar.local -SamAccountName $LOGONALIAS -FirstName $FIRST -LastName $LAST -Password $PASSWORD -ResetPasswordOnNextLogon $true -Database "CN=Mailbox Database,CN=First Storage Group,CN=InformationStore,CN=EXMS,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=ABC School,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=abc,DC=local"

It does create the AD user and in the Exchange console I can see the user too. But the problem arises when I right-click and select to Manage Full Access Permissions. It then gives the error "Exchange Information Store on server 'exms.abc.local' is inaccessible. Make sure that the network is connected and that the Exchange Information Store is running. It was running the command 'Get-MailboxPermission -Identity 'CN=JohnSmith,OU=Staff,OU=Users,OU=School,DC=abc,DC=local''

In digging further using ADSI Edit I compared a working user and the test one I created. The 'HomeMDB' and 'HomeMTA' were different. The command above enters "CN=Mailbox Database,CN=First Storage Group,CN=InformationStore,CN=EXMS,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=ABC School,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=abc,DC=local" in the 'HomeMDB' field. The equivalent field in a working user is
"CN=2010 DAG Cluster,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=ABC School,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=abc,DC=local" so I put that in the command but get told that the 'Database 2010 DAG Cluster' was not found. Please make sure you have typed it correctly. Reason: ?The server '2010 DAG Cluster' is running Microsoft Exchange 2003 or earlier'.

What should this Powershell command include?
 
UPDATE: I got it to work....kind of.

New-Mailbox -Name JohnSmith -Alias esp -OrganizationalUnit "abc.local/CGS/USERS/STAFF" -UserPrincipalName js@abc.local -SamAccountName esp -FirstName John -LastName Smith -ResetPasswordOnNextLogon $true -Database "CN=2010 DAG Cluster,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=ABC School,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=abc,DC=local"

works when run from the E2K10 server. But I'm trying to run this from a member server (which service desk staff have access to in order to run these scripts) and it fails. The same command gives the error "Database 2010 DAG Cluster was not found. Please make sure you have typed it correctly. Reason: ?The server ’2010 DAG Cluster’ is running Microsoft Exchange 2003 or earlier”!

Any ideas?
 
You have the 2010 management tools installed on the member server? The first example is wrong, which is why it's not working. Exchange will actually pick a database automatically if one is not defined. So you should be able to remove that part of the command and try again.

What happens if you use the Exchange Management Console to test?

Do you have your Tek-Tips.com Swag? I've got mine!

Stop by the new Tek-Tips group at LinkedIn.
 
Ah, there we go. Tried installing the E2K10 management tools and......unable to install on W2K3-32bit! Obviously because E2K10 is 64bit.

So I've built a new W2K8R2 member server, installed the E2K10 management tools and it now creates the user & mailbox successfully.

There are other errors in the script now. It doesn't like the command dsmod but that's unrelated to the initial problem so I'll work trough that.

Thanks 58sniper :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top