0

I'm in a relatively special situation.

I have a Restify API built on node.js that uses process.exec('powershell.exe') with some extra parameters to enter Mac Addresses into a database. This requires the ActiveDirectory module. Whenever I add a Mac Address, it creates a new process of powershell and imports the module, every time. This is incredibly inefficient, especially when I enter multiple at a time - for each mac address, it creates a new process and imports the module.

Is there anyway I could instead have an existing Powershell process with the ActiveDirectory module already loaded, then execute commands on it using the same process.exec('...') method?

Kyle
  • 1
  • You probably took the worst possible approach. Please go back and re-architect your solution to not involve typing commands into a PowerShell console. – Ansgar Wiechers Aug 13 '15 at 07:59
  • I'm probably going to use a LDAP node module for creating new users. Would you suggest that? – Kyle Aug 13 '15 at 18:21
  • I don't have enough experience with node.js to suggest anything, but you may want to take a look at the answers to [this question](http://stackoverflow.com/q/10179114/1630171). – Ansgar Wiechers Aug 13 '15 at 18:25

0 Answers0