Hello Robert,
I am not a developer, just a user, but I do use the shell to get things done as
well. I am on Mac so the shell commands may look a bit different but the
overall idea is the same, you should just address the command to the shell
using ADDRESS
This is what I do to re-authenticate myself at an API I am currently writing a
client for:
_cURL = _Pre _Consumer_Key || ':' || _Consumer_Secret_Key _Post
/* If close to expiry re-authenticate */
IF _expires_in < 0 THEN
DO
ADDRESS 'ksh' _cURL '--silent --output' OPSauth
…
END
In your case leave out ‚ksh‘ it is the Korn shell I am using on the Mac, _cURL
is the actual command and the rest are just fixed switches
Hope it helps.
Hälsningar/Regards/Grüsse,
P.O. Jonsson
[email protected]
> Am 07.01.2018 um 14:46 schrieb Robert Garrett <[email protected]>:
>
> I have a REXX program that runs on a timer, scanning my web server logs and
> looking for evidences of people trying to ‘brute force’ guess passwords. It
> happens a lot. Without getting too far into the details, when something is
> detected the program runs a windows powershell command to add a block for the
> offending IP range into the windows group policy object that controls my
> windows firewall. The line of code that runs the command looks like this:
>
> /* Update the applicable GPO */
> _CMD = "powershell.exe",
> "New-NetFirewallRule",
> "-DisplayName "_NEWIP,
> "-Direction Inbound",
> "-Profile Any",
> "-Action Block",
> "-InterfaceType Any",
> "-RemoteAddress "WORD(PARMS.IP,1)"-"WORD(PARMS.IP,2),
> "-PolicyStore ...mydomain...\...firewall policy GPO name...";
>
> _CMD;
>
> When the code runs, it gets this response:
>
> New-NetFirewallRule : A directory service error has occurred.
> At line:1 char:1
> + New-NetFirewallRule -DisplayName 043.241.140.000 -Direction Inbound - ...
> + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> + CategoryInfo : NotSpecified:
> (MSFT_NetFirewallRule:root/standar
> dcimv2/MSFT_NetFirewallRule) [New-NetFirewallRule], CimException
> + FullyQualifiedErrorId : Windows System Error 8341,New-NetFirewallRule
> powershell.exe New-NetFirewallRule -DisplayName ...new rule name...
> -Direction Inbound -Profile Any -Action Block -InterfaceType Any
> -RemoteAddress ...IP address range... -PolicyStore ...mydomain...\...firewall
> policy GP name...
> New-NetFirewallRule : The requested object could not be found.
>
>
> What I don’t understand about the situation, is that I can cut the command
> from the code, paste it into a command window with no changes, and it works
> perfectly.
> So I must be missing something here – I just don’t yet know what. I’m hoping
> someone here can shed some light.
>
> Thanks,
> Robert
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org <http://slashdot.org/>!
> http://sdm.link/slashdot_______________________________________________
> <http://sdm.link/slashdot_______________________________________________>
> Oorexx-devel mailing list
> [email protected] <mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
> <https://lists.sourceforge.net/lists/listinfo/oorexx-devel>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel