Jump to content
Cptrico

PowerOfTheShell Plugin 1.5

Recommended Posts

Hi Mario,

 

Thanks for using the plugin. 

 

The code is build to any CPU, which means it will work on 32 and 64 bit machines. 

I am running pulseway agent 4.7.6 and POTS 1.5 to test on my windows 8.1 laptop.. 

 

I ask through POTS if I am running 64 bit or not..

[Environment]::Is64BitProcess
 
And I get true back.I don't have the exchange mgmt pack on my machine so I can test.. 
 
Take a look at the script pack, I know Paul (digby) have a lot of exchange examples to try, he uses WMI if I recall correctly..

Share this post


Link to post
Share on other sites

I use the following code to determine if the snapin is loaded or not

 

 

    # Add Exchange 2010 commandlets (if not added)
    if(!(Get-PSSnapin | where-Object {$_.name -eq "Microsoft.Exchange.Management.PowerShell.E2010"}))
    {
      ADD-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 -ErrorAction SilentlyContinue
    }

Share this post


Link to post
Share on other sites

Hi, thank you for POTS, I'm very impressed. I have a couple of problems, and wonder if you could give me some advice?

I am running a Powershell script to add a new user to Active Directory. Here is the config.xml for the script:

<?xml version="1.0"?>
<!-- Example Xml -->
<main>
  <group title="Emmanuel School Scripts" enabled="True" maxResults="500">
    <page title="User Admin" pageId="1" subtitle="User Administration Scripts" enabled="True">
          <subpage title="New User script" pageId="3" subtitle="Add a new user" enabled="True">
              <command title="NewUser" commandId="3" path="c:\scripts\newuser.ps1" arguments="" >                        
             <commandInput name="name1" inputType="TextInputItem" title="First Name" subtitle="Please enter First Name" />
             <commandInput name="name2" inputType="TextInputItem" title="Second Name" subtitle="Please enter Second Name" />
             <commandInput name="group" inputType="PickListInputItem" title="Student or Teacher" subtitle="Select Student or Teacher Account" >
                <pickItem title="Student" />
                <pickItem title="Teacher" />                
            </commandInput>
        </command>
        </subpage>
      </page>
   </group>
</main>

My problems are:

1. The script runs fine when run from a local logged-on session. It also runs fine in POTS, but in POTS it appears to get executed twice. I know this because the script has some code to test if the user has already been defined. So because the script is getting executed twice, the user gets defined the first time round, but I get an error message the second time around.

2. The "commandinput" data entry works fine from my Android phone, but when I run POTS(and Pulseway) in a Browser I cannot select the commandinput buttons to eneter the data. I have tried with IE and Firefox, with the same result.

Can you give any advice please?

KInd regards and thanks

Alan Reeves

 

Share this post


Link to post
Share on other sites

Hi Alan,

Thanks for using POTS.
1. If the script your running should check if the resource exists already, I am not sure why it should run twice through because of that in POTS. I would need to understand how the script looks to figure out why it would run twice.
2. I don't know if there could be a compability issue showing the commandInput button in the new Web version. Also havd you made sure that the browsers you use when running web have been aproved in the Pulsway manager to run commands on the mentioned server ? only relevandt if you have limited the access to only some devices.

 

/Johnni

Share this post


Link to post
Share on other sites

Hi everyone,

In regards to the inputs on the WebApp, we don't support any form of API inputs for the HTML WebApp at this moment, they are planned to be introduced in the future. I'm sorry for the confusion this caused.

-Paul

Share this post


Link to post
Share on other sites
On 11/8/2016 at 0:06 PM, JohnnyJoker said:

Hey,

it seems the Download Link (and the Page hosting it) is down?!

Hi Johnny,

It seems to be working now. Can you check again?

-Paul

Share this post


Link to post
Share on other sites

Hi, I have searched and searched and cannot find the answer I needed. When I execute the Test script "windows.ps1" (and any others) I get the same error that the script cannot be loaded because running scripts is disabled. I've changed the execution policy to unrestricted for current user and still nothing. I'm at a loss..

Any help would be appreciated.

 

Thanks

Tony

 

Share this post


Link to post
Share on other sites

Hi Tony,

thanks for using ( trying ) the plugin.
So I am assuming that you can run powershell scripts on your server / client without any issues just fails using POTS right ?
And have you tried to have a look in the trace files with plugin diagnostics enabled in Pulseway manager. ( settings -> Diagnostics ) click the include Diagnostic logging for plugins.

//Johnni

Share this post


Link to post
Share on other sites

Hi and thanks for the reply. Correct I can run the script locally on the machine but get that error when I run it in POTS. I just turned on the logging as well.

So in looking at the log file, I get this:

11/17/2016, 10:21:08.221: [Service] A request was received from a non authorized device and it was denied: Request Plugin page command 'PowerOfTheShell.Program[>x1x2x3x4x5<]204[>x1x2x3x4x5<]204' from device Id: '-----4f84d'
11/17/2016, 10:21:52.293: [Service] Received Request Plugin page command 'PowerOfTheShell.Program[>x1x2x3x4x5<]204[>x1x2x3x4x5<]204' from device Id: '-----EEEE', device name: Tony’s iPhone 7

My phone and all my other devices are authorized.

 

Capture.PNG

Share this post


Link to post
Share on other sites
Quote

A request was received from a non authorized device and it was denied

Try removing your devices and adding them again. It's possible that your device changed it's identifier (reinstalled the app maybe?).

-Paul

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.
Note: Your post will require moderator approval before it will be visible.

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.


×
×
  • Create New...