Page 1 of 1 1
Topic Options
#180359 - 2007-09-10 04:33 PM Access to Exchange 2007 Management Shell
GSUK Offline
Starting to like KiXtart

Registered: 2004-03-10
Posts: 125
Hi there,

I don't know if this is possible, but has anyone succesfully managed to access the Exchange 2007 Management shell using Kix?

The reason I ask is I have a script that creates new user accounts. Part of the script creates a new SMTP address (command = $adsUser.CreateMailBox) which then appears in Exchange 2007 as a Legacy Mailbox.

To upgrade the legacy Mailbox to a User Mailbox I have to enter the following command in the Exchange Management shell: set-mailbox username -applymandatoryproperties which upgrades the account ( see MS article here )

So, the question is, can I run this shell command from within Kix?

Thanks in advance for any help.
Glenn.

Top
#180368 - 2007-09-11 02:25 AM Re: Access to Exchange 2007 Management Shell [Re: GSUK]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
How about
 Code:
shell '%COMSPEC% /c powershell.exe -noexit set-mailbox username -applymandatoryproperties'

Might be time to start reading up on PowerShell at http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
_________________________
There are two types of vessels, submarines and targets.

Top
#180370 - 2007-09-11 10:25 AM Re: Access to Exchange 2007 Management Shell [Re: Sealeopard]
GSUK Offline
Starting to like KiXtart

Registered: 2004-03-10
Posts: 125
Aha! Thanks Sealeopard.

For some reason though, set-mailbox is not a valid command when Powershell.exe is run as above. There must be some kind of exchange paramter that is run with powershell.exe when you run the Exchange Management Shell that enables all the exchange commands. I'll see if I can find the answer and post it here...

Top
#180372 - 2007-09-11 10:52 AM Re: Access to Exchange 2007 Management Shell [Re: GSUK]
GSUK Offline
Starting to like KiXtart

Registered: 2004-03-10
Posts: 125
Here we go:

PowerShell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -noexit set-mailbox username -applymandatoryproperties

Top
#180409 - 2007-09-11 09:07 PM Re: Access to Exchange 2007 Management Shell [Re: GSUK]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Does that same command work without powershell? Will it run from DOS like that? If so then KiXtart should be able to do it's own SHELL
Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1527 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.055 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org