.NET Framework - exchange 2003 and PS

Asked By roge
10-Apr-07 07:02 AM
I need to write a simple VB.NET app that creates a exch 2003 mailbox. Used to
do this trough codexm but this no longer works on vista - so PS looks like
the way to go... So does anyone know how such a script should look like or
where to find the docs to read up on how to do this?

Regards,
Roger
VB.NET
(1)
XP
(1)
Vista
(1)
CDOEXM
(1)
VBScript
(1)
ADSI
(1)
PS
(1)
SecurityRe
(1)
  Thomas Lee replied...
10-Apr-07 07:35 AM
Powershell is supported natively by Exchange 2007, but not by Exchange
2003.

--
Thomas Lee
doctordns@gmail.com
MVP - Admin Frameworks and Security
  Marco Shaw replied...
10-Apr-07 08:02 AM
As Thoman mentions, PowerShell is supported natively in Exch 2003.  You
could still potentially use PowerShell though from what I've been able to
quickly google.

I've never heard of CDOEXM before, but it appears to be an Exch automation
DLL (COM object, if I'm using the right terminology).

I would think you could use PowerShell to load CDOEXM as a COM object then
call a method or property from it to do pretty much anything that object
would support.

That enough to get you going?

Marco
  Marco Shaw replied...
10-Apr-07 08:38 AM
Oops!  PowerShell is supported natively in Exch *2007*...
  Thomas Lee replied...
10-Apr-07 08:53 AM
It's Thomas and it's Exchange 2007 that's supported natively not 2003!

One place to start, Roger, is "Exchange Scripting: A Road Map"
http://www.microsoft.com/technet/scriptcenter/topics/exchange/exchange_ro
admap.mspx


Indeed - you can pretty much do _everything_ with PowerShell (well
nearly).


Collaboration Data Objects for Exchange Management.

http://msdn2.microsoft.com/en-us/library/aa142616.aspx

NB: these are gone in Exchange 2007
http://msdn2.microsoft.com/en-us/library/bb332450.aspx


Correct.


See also:

Scripting Exchange Using VBScript and ADSI (Part 1):
http://www.msexchange.org/articles/Scripting-Exchange-VBScript-ADSI-Part1
.html

Scripting Exchange Using VBScript and ADSI (Part 2)
http://www.msexchange.org/articles/Scripting-Exchange-VBScript-ADSI-Part2
.html

Scripting Exchange Using VBScript and ADSI (Part 3)
http://www.msexchange.org/articles/Scripting-Exchange-VBScript-ADSI-Part3
.html

HTH

Thomas

--
Thomas Lee
doctordns@gmail.com
MVP - Admin Frameworks and Security
  roge replied...
10-Apr-07 11:00 AM
Thomas & Marco:

Thanks for the replies - although I knew Powershell/Exchange features was
mailbox would be possible. As you mentioned CDOEXM is part of the Exchange
2003 management tools. It was a breeze to hook into it from a VB.NET app and
create new mailboxes in code. The insane thing I discovered after upgrading
to Vista is that MS has decided that the 2003 management tools can not be
used on Vista - efficiently breaking my code from running on administrators
Vista pc's. And testing and development has to be done on an XP pc until I
find an alternative solution to this. It has to be more developers out there
that did this through CDOEXM and has been fooled by this strange effect og
installing Vista.... :-((

I'll have a look at WMI to see if that can be the way to go......
  Marco Shaw replied...
10-Apr-07 12:43 PM
...

Well, it appears CDOEXM is just a set of DLLs...  I see no reason why you
can't hunt down the DLLs, and copy them over to Vista manually.  Might not
be supported, but I'd think it would work.  Easy to load them into
PowerShell after..


That should work too.
  Gaurhoth replied...
10-Apr-07 05:02 PM
You do not *HAVE* to use CDOEXM to create mailboxes via scripts... altho
it's the only way that Microsoft supports it. There is a set of AD Fields
that if you enter the correct data, the RUS will create the mailbox and
handle everything just fine. I've done it successfully in my lab and several
times in my production environment. It'll probably be this weekend before I
can dig out the code -- I'm in the middle of buying a house, so my time is
no longer mine :)

Gaurhoth
  RobCampbel replied...
11-Apr-07 08:54 AM
I believe the required properties you need to set to have RUS create the
mailbox are:

msexchhomeservername
homemdb
mailnickname
Create New Account
help
NET Framework VB or C? Fact Poll I made the transition from (Borland) C++ to VB.NET around 2004. I have been happy with the choice. I find I can focus more and less on being "tidy" with VB. But, I fear that many don't take VB.NET seriously, particularly in scientific programming. They ask; "What do you code in?" and you say C, right? Because if you do, in fact, mean C, then there are tremeandous differences. VB .NET is a .NET language (obviously) and so all the advantages of .NET vs. COM come issue, caching, etc.). If you do mean C# instead, then the differences between it and VB .NET are minimal. You can do a Google search on VB.NET vs. C# and come
NET Framework Use of Mid Statement in VB.Net Hi All If anyone has the time, I think feedback on the following may be eg aba format. The beauty of the old VB6 Mid statement (which is available in VB.Net) is that it allows me to replace n chars at a specified position in a mfRecordType Mid(buffer, pointer, MyFields.mfTransactionType ) = "AB" pointer + = mfTransactionType 'etc etc There appears no native VB.Net equivalent to this method. The StringBuilder Class does not have this method either. It should you. He is talking about the vb6 mid statement. . . As for the Mid statement in VB.NET - that maps to Microsoft.VisualBasic.CompilerServices.StringType.MidStmtStr. This method basically takes your string ByRef
I'm told that VB6 code, when well written, can be ten times faster than vb.net, but that if its badly written it can be ten times slower. Is that correct my code will be quite well written, and I don't want to move to vb.net if well written VB6 code is ten times faster. Have I been told the truth I need to look into this further? Mike Hi Mike, Great to see you considering VB.NET. Optimized code in VB.NEt will run much a muchness with optimized code in VB6. The questions are how hard
effective apps in vb6, I am trying to see if it is worthwhile relearning for vb.net. I have vb express 2008. One of the things I want to do is read object. How can I do it in dot.net? How can I do this is vb.net? HI again all I see that I already enquired re both of these. I must there were no solutions to the print problem. Cheers StrandElectric wrote : It is possible in VB.NET using the built in file io functions, but I would suggest you not do this files, then for all that is good and right in the universe do not use VB.NET's native FileXXX functions. . . Use the classes from System.IO. Don't do much with