Jump to content

Problems with VBA and the Exchange Management Shell

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.

 

Any idea´s on how I can rid of this Problem in my VBA Script?

 

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

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

×