RoadXY Posted February 17, 2015 #1 Share Posted February 17, 2015 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 serverGive 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 = NothingThe 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 = NothingThe 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 Link to comment Share on other sites More sharing options...
Tom Wellige Posted February 17, 2015 #2 Share Posted February 17, 2015 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. Link to comment Share on other sites More sharing options...
RoadXY Posted February 20, 2015 Author #3 Share Posted February 20, 2015 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? Link to comment Share on other sites More sharing options...
skywalker_13 Posted February 21, 2015 #4 Share Posted February 21, 2015 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. Link to comment Share on other sites More sharing options...
Soluzionidigitali Posted March 10, 2016 #5 Share Posted March 10, 2016 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 Link to comment Share on other sites More sharing options...
Soluzionidigitali Posted March 10, 2016 #6 Share Posted March 10, 2016 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.