Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

open EMS Powershell 2.0 from excel VBS

$
0
0

hi

this code below running in my exchange 2013 test environment. But under Exchange 2010 with powershell 2.0 it opens only a ps session for every code line in excel and close it again.

No code execute and i cannot see which error happen

 

 

Private Sub CommandButton1_Click()

Counter = 37

Do

       Dim Command

       Command = Worksheets("get-ad").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


Viewing all articles
Browse latest Browse all 8583

Trending Articles