Private Sub CommandButton1_Click()
Counter = 3
Do
Dim Command
Command = Worksheets("table1").Cells(Counter, 1).Value
Shell ("C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -PSConsoleFile ""C:\Program Files\Microsoft\Exchange Server\V15\bin\ExShell.psc1"" -noexit icm -ScriptBlock {" & Command & "}")
Counter = Counter + 1
Loop Until Command = ""
End Sub
With the script above i'm running every command been stored in excel from row 2,col1 until
an empty row iscoming. Every command line opens in his own EMS window. How can i execute
every command in only one Shell window? How can i implement an errorlog?
The commands in excel are exchange2010 specific like below
|