All of my systems have the AD module installed, but I'm trying to write a script that will execute on new Win7/Win8/Win10 systems (without the AD module installed). Will a script compiled with Powershell Studio 2016 that uses the ad module run on systems that do not have it?
I'm guessing it will not, but hoping that it will.
Will exe compiled scripts that use ActiveDirectory module run on systems that do not have it installed?
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: Will exe compiled scripts that use ActiveDirectory module run on systems that do not have it installed?
No, of course that won't work. Where would the missing module come from?
You have two options here that I can see:
a) Package your script with the required modules into an MSI, install on new machines and run it.
b) Detect that import-module failed, install the module from the LAN and continue execution in your script after the module loaded successfully.
You have two options here that I can see:
a) Package your script with the required modules into an MSI, install on new machines and run it.
b) Detect that import-module failed, install the module from the LAN and continue execution in your script after the module loaded successfully.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- dan.potter
- Posts: 709
- Last visit: Wed Nov 14, 2018 11:39 am
Re: Will exe compiled scripts that use ActiveDirectory module run on systems that do not have it installed?
c) pop up a warning telling user that the ad module is required.
Re: Will exe compiled scripts that use ActiveDirectory module run on systems that do not have it installed?
Thanks. I'm used to the old perl2exe. Any functions of modules you used were included in the exe so they could be run anywhere.
I ended up pulling the user attributes in a way that doesn't use the ad module.
new-object System.DirectoryServices.DirectorySearcher($dn)
Thanks.. still lots to learn.
I ended up pulling the user attributes in a way that doesn't use the ad module.
new-object System.DirectoryServices.DirectorySearcher($dn)
Thanks.. still lots to learn.