Rick Rudolph
asked on
Run VBScript on a remote computer with parameters
I have a vbscript that runs correctly on an Exchange Server The goal is to create a mailbox from the command line.
This is the script:
Set objShell = CreateObject("Wscript.Shel l")
objShell.Run("powershell.e xe -noexit c:\temp\RJRcreatemailbox.p s1 RickRudolph rjr@somedomain.com")
This script runs a powershell script which creates a mailbox for RickRudolph, email address of rjr@somedomain.com
Now what I want to do is to be able to run this script remotely from MSAccess VBA and pass the 2 parameters to the Exchange Server
Any ideas on the best way to do this?
Thank you,
Rick
This is the script:
Set objShell = CreateObject("Wscript.Shel
objShell.Run("powershell.e
This script runs a powershell script which creates a mailbox for RickRudolph, email address of rjr@somedomain.com
Now what I want to do is to be able to run this script remotely from MSAccess VBA and pass the 2 parameters to the Exchange Server
Any ideas on the best way to do this?
Thank you,
Rick
ASKER
I was unsure of how to run the PowerShell script from VBA
Thank you for the idea. I have never used WMI, I don't see any reference to the server name, should that be placed in front of the c:\temp with UNC naming?
The noexit should go
Can you clarify how the server name is referenced?
Thank you,
Thank you for the idea. I have never used WMI, I don't see any reference to the server name, should that be placed in front of the c:\temp with UNC naming?
The noexit should go
Can you clarify how the server name is referenced?
Thank you,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
David,
thanks very much, a big help.
Rick
thanks very much, a big help.
Rick
you can try connecting with WMI to the remote machine
Open in new window
Why the -noexit parameter?