Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a PowerShell script from Access 2010

Status
Not open for further replies.

txgeekgirl1

Programmer
Sep 10, 2009
85
US
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:
Code:
'Call Powershell and run connection
    Call Shell("powershell -file ""c:\scripts\NewMailbox.ps1""", vbMaximizedFocus)

Access 2010 suggestion - does not work:
Code:
'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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top