Jump to content

Administartion of MS Exchange 2013 with the EMS

Hello there my friends,

 

I'm currently administrating and managing the MS Exchange 2013 Server down here the company where I'm working at.

But I've ran into a quit huge problem for our / my workflow.

 

 

Now a bit more details about the problem itself:

 

 

I wanted to write a Script in Visual Basic for Applications (VBA) which does the following things:

 

I have to enter 2 Dates, one counting as the "start" and the other one counting as the "end" of a certain time period.

If I confirm them by clicking on another button labeled "Confirm", it should convert the 2 Dates, into a String-variable and combine the variable with a pre-entered cmdlet for the Exchange Management Shell for me....

 

The Command should look something like this:

get-messagetrackinglog -Start [Starting Date] -End [Ending Date] -MessageSubject [Bills] -sender: [Mail-Adressof our Company, which sends out Bills] | Select timestamp,EventID,recipients,messagesubject | Out-File [serverpath]\MailTrackingLogs\MailTrackingLog.csv

 

And the command, that the Script creates, works.... if u copy and paste it manually into the Exchange Management Shell (EMS)...

But I want the Script to automaticlly copy the Command into the EMS, but that doesnt work ...

 

I was thinking about the cmdlet

call shell ("powershell [Path of the PS-Script]")

but that one only executes PowerShell Scripts and doesnt execute the get-messagetrackinglog cmdlet.

 

 

Now if anyone of you guys is into that kind of Stuff, pls help me Im Dying.... thx 

 

Greetings,

Iqu

R9 3900X | Aorus X570 Elite | 32GB 3600MHz RAM | RTX 2060 Super | Aquafusion 360mm | 2TB NVMe x4 Gen. 4.0 

Link to comment
Share on other sites

Link to post
Share on other sites

Wouldn't it be easier to just use PowerShell script and import the Exchange PowerShell module, VBA is pretty old now days.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, leadeater said:

Wouldn't it be easier to just use PowerShell script and import the Exchange PowerShell module, VBA is pretty old now days.

I am not quiet sure, how easy / difficult this is. Im new to the whole PowerShell - Scripting and the Exchange Administration... how do i Import the Exchange PS Module?

 

And the Problem is, I need to stick with VBA cause I want to calculate with the values, of some Mails in MS Excel and also need them in an Excel Document to properly send them to our BI Team

R9 3900X | Aorus X570 Elite | 32GB 3600MHz RAM | RTX 2060 Super | Aquafusion 360mm | 2TB NVMe x4 Gen. 4.0 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Iqu said:

And the Problem is, I need to stick with VBA cause I want to calculate with the values, of some Mails in MS Excel and also need them in an Excel Document to properly send them to our BI Team

You can do all of that in PowerShell, just a learning curve thing really.

 

3 minutes ago, Iqu said:

I am not quiet sure, how easy / difficult this is. Im new to the whole PowerShell - Scripting and the Exchange Administration... how do i Import the Exchange PS Module?

https://stackoverflow.com/questions/50129609/run-exchange-command-from-windows-powershell

 

https://docs.microsoft.com/en-us/powershell/exchange/exchange-server/connect-to-exchange-servers-using-remote-powershell?view=exchange-ps

https://xanderbikbergen.com/2017/04/28/add-the-exchange-powershell-module-into-a-standard-powershell-session/

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, leadeater said:

You can do all of that in PowerShell, just a learning curve thing really.

Well I didnt doubt that, but I personally like the VBA Option more than PowerShell, cause im quiet into VBA Scripting :D

 

 

6 minutes ago, leadeater said:

Aight I'm going to go through all of this ... hopefully it works .. if not, i know where I find help xd

 

But still, Thx for your help, appreciating it

R9 3900X | Aorus X570 Elite | 32GB 3600MHz RAM | RTX 2060 Super | Aquafusion 360mm | 2TB NVMe x4 Gen. 4.0 

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, leadeater said:

Well ... and I've run into thze next Problem ... If I post the cmdlet (get-messagetracinglog) directly into the EMS on our Exchange 2013 Server, I'm getting all of the data values that I want. But if I'm doing it via Remote-PowerShell Session, I'm missing information on for example the Billnumber or the Type of Bill.

 

It is 100% the same Cmdlet.

 

Any suggestions?

R9 3900X | Aorus X570 Elite | 32GB 3600MHz RAM | RTX 2060 Super | Aquafusion 360mm | 2TB NVMe x4 Gen. 4.0 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×