Jump to content
RoadXY

ANSWERED Powershell From Gse Vbscript

Recommended Posts

Hello,
 
I'm trying to use Powershell from a vbscript block.
I'm able to start cmd and use a echo to a file but am unable to start a simple powershell script.

 

What I'v tried so far:

  • Swyx Service local admin on Swyx server
  • Give the everyone group read and write permission on c:\batchfiles
  •  

 
My non-working Vbscript: 

Dim objShell Set objShell = CreateObject ("WScript.shell")objShell.run "c:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File c:\Batchfiles\test-script.ps1" Set objShell = Nothing

The Vbscript which is working:

Dim objShell Set objShell = CreateObject ("WScript.shell")objShell.run "CMD /C echo test >> C:\Users\Public\Downloads\logs\test.txt" Set objShell = Nothing

The Powershell script which I'm trying to run:

$file = "C:\Users\Public\Downloads\logs\test.txt"$date = Get-DateWrite-Host "Appending current date and time ($date) to $file"$date | Out-File $file -Append

Share this post


Link to post
Share on other sites

Call routing scripts are run by the SwyxServer. The server runs under the "Swyx Service Account". Make sure, this user has the proper access privileges for the files in question.

Share this post


Link to post
Share on other sites

Call routing scripts are run by the SwyxServer. The server runs under the "Swyx Service Account". Make sure, this user has the proper access privileges for the files in question.

Thank you for your reply.

 

The account used for the Swyx service accounts are the user SwyxServer.

Which is already admin on the swyx server.

 

Is that what you meant?

Share this post


Link to post
Share on other sites

Hello ,


 


this is how i call a Powershell-Script from a CMD:


 


C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -noninteractive -Command "&'c:\temp\Gruppe.ps1'"


 


I think you also need to start the script as admin.


Share this post


Link to post
Share on other sites

Hello, I have the same issue.

The user with Which I star swyxservice, is SwyxAdmin and it is included in the Administrators Group of the swyx server.

What else should I do to give it admin priviledge to run the powershell script?

 

Also I have another issue: I have to use the "import-module ippbx" command EVERTIME I open a powershell Windows...if I dont do this it give me error for command not recognized.

I installed powershell module from the SwyxAdministration setp; have I to do something more to make the powershell ippbx module always "ready to use"=?

thank you

Stefano Mattioli

Share this post


Link to post
Share on other sites

I tried to add the Swyxserviceaccount to the "System ADministrator" role, but when I click OK, it doesnt add it to the system administrator role:

Afeter I click "OK" nothing Change, also I cannot remove the user Operator from the list.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.