Scripting Question

Admin Script Editor Script Packager Powershell ActiveDirectory Module

10/07/2015 2293 views
I need to package a PS script as an EXE.  The script calls the ActiveDirectory Module.
Works fine as a script.  Every time.  But when I package it and execute it I get:

Maybe I'm wrong, but my only explanation for that is that the ActiveDirectory Module must not be loading.  So I tried specifically launching PS with Arguments -noexit -command import-module ActiveDirectory but no luck.  Tried putting the Arguments in quotes but no luck there either.

Any help here would be much appreciated!

1 Comment   [ + ] Show comment


  • This is not related to just that command.. it appears that the packaged powershell command is missing several modules.. seems to be may be only a V2 module... not sure. invoke-webrequest is missing as well. Same thing.. if I do not hide the console it works.

All Answers

I've found the apparent cause of the issue... hiding the Console.
It appears that Modules will not Import without a visible Console.  My solution was to Import the Module, then hide the Console.

If anybody has any further information or solutions for this, I'd still love to know.

Answered 10/08/2015 by: talessi
White Belt

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ