Wednesday 23 October 2019

node-powershell + active directory ps1 scripts = ghetto ADUC API?

instead of reinventing the wheel, im just curious if there could be a way to reuse all my powershell scripts, but just route them up in Express to run server side then spit back some JSON to the client end for display....then CRUD my way into an active directory api. ive messed around a bit using node-powershell, running some different scipts, and getting used to how the output works...but it seems doable, still trying to understand the output part.so im always leery when it seems like im the only one wondering stuff...i havent seen hardly any chatter about using this node-powershell package as a way to get a really easy ADUC api going. You already have all the powershell cmdlets there, or any personal scripts...i figured it was worth a try, or either start learning ldapjs, which im not sure im up to right now. i have lots of enable or disable scirpts i use when folks hire on, or get termed, that goes out to a lot of extra endpoints to turn down other accounts and do cleanup, we're O365/hybrid...sure would kick ass if I could reuse those.OR, is there a more optimal way of invoking ps scripts server side using node.js/express? none of the ps1 scripts i use run over 15-20 seconds, not huge cpu crunching or anything, mostly just waiting for aduc to talk back, or when reaching out to other API's, which i'd probably bring those out of their ps1 scripts and do the fetching from express directly.....but the AD stuff seems doable if there isnt a gaping security angle im not seeing yet...

Submitted October 23, 2019 at 04:15PM by MajDogbyte

No comments:

Post a Comment