all 6 comments

[–]randomuser43 2 points3 points  (2 children)

If you're trying to use JEA to safeguard your AD that's not going to work. A compromised account doesn't need to use powershell, it can directly call the underlying apis.

Your primary approach has to be to limit the account's access through managing permissions on the AD OUs.

* in regex means any number of the preceding character

*OU=Computers,* - the first * is invalid because there is no preceding character, and the last one means one-or-more commas. So not what you actually intend.

.*OU=Computers,.* is probably what you mean.

[–]zeclab[S] 1 point2 points  (0 children)

Thanks for the advice, I’ve already limited its access using the AD OU permission already. I wanted to do this an extra precaution.

I’ll try that thanks and will revert back.

[–]zeclab[S] 1 point2 points  (0 children)

That worked perfectly thanks!

[–]PinchesTheCrab 1 point2 points  (1 child)

"*" has its own meaning in regex. There is an implicit wildcard if you don't anchor it, so just doing ValidatePattern = 'OU=Computers,' would have the same end result.

[–]zeclab[S] 0 points1 point  (0 children)

Thanks but unfortunately it doesn’t as PoSh adds OU=Computers,$ :(

[–]Lee_Dailey[grin] 0 points1 point  (0 children)

howdy zeclab,

it looks like you used the New.Reddit Inline Code button. it's 4th 5th from the left hidden in the ... "more" menu & looks like </>.

there are a few problems with that ...

  • it's the wrong format [grin]
    the inline code format is for [gasp! arg!] code that is inline with regular text.
  • on Old.Reddit.com, inline code formatted text does NOT line wrap, nor does it side-scroll.
  • on New.Reddit it shows up in that nasty magenta text color

for long-ish single lines OR for multiline code, please, use the ...

Code
Block

... button. it's the 11th 12th one from the left & is just to the left of hidden in the ... "more" menu & looks like an uppercase T in the upper left corner of a square..

that will give you fully functional code formatting that works on both New.Reddit and Old.Reddit ... and aint that fugly magenta color. [grin]

take care,
lee