Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Calling a PowerShell code from Access 2010

$
0
0

I had a program written in VBA which called a PowerShell script to create Exch2010 mailbox accounts for new users. Worked fabulous with Access 2003.

We moved our Databases to a newer server with Access 2010 on it. I have checked reference libraries and anything pertaining to the code - everything looks good. I then consulted the Microsoft boards for calling a PS Script from Access2010 but their solution does not work. If anyone has any suggestions or solutions - much appreciated!

Access 2003 code that worked:

'Call Powershell and run connection
    Call Shell("powershell -file ""c:\scripts\NewMailbox.ps1""", vbMaximizedFocus) 

Access 2010 suggestion - does not work:

'Call Powershell and run connection Call Shell("C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -command c:\scripts\NewMailbox.ps1", vbMaximizedFocus)

The actual code in the file does run and work from the new server - so I just need to get the Call fixed.

Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>