Solved

Is there a way to deploy the PowerShell AD module to our users?

Posted on 2014-04-04
2
178 Views
Last Modified: 2014-04-08
Hello,

I wrote a PowerShell script that requires the ActiveDirectory module (i.e. Import-Module ActiveDirectory). It works without issue on my PC. However, I need to run it from a login script for all of our users and it won't because, despite having PowerShell on their PCs (Windows 7 x64), it won't run because this hasn't been installed. I know that this can be installed manually but we have 100's of PCs and I'm looking for a way to deploy it automatically. In my searching on the web, I haven't found a way to accomplish this but I'm thinking that there's got to be a way. Any way of doing this? I can't believe that no one has ever written a PS script that they wanted to deploy that uses AD.

Thank you.

-Marc Johnson
0
Comment
Question by:Marc_Johnson
2 Comments
 
LVL 28

Accepted Solution

by:
becraig earned 500 total points
Comment Utility
Download this KB:
http://www.microsoft.com/en-us/download/details.aspx?id=7887

Then simply write a script something like below:
gc serverlist | %  {
if (!(Test-Path \\$_\C$\temp))
{mkdir \\$_\C$\temp}
invoke-command -computername $_ -scriptblock {
cmd c:\temp\kbname.exe 
}
#you can maybe put a sleep then reboot and test for response \
then run the add feature.

invoke-command -computername $_ -scriptblock {Add-WindowsFeature RSAT-AD-PowerShell
}

}

Open in new window



This is not really tested just a suggested path
0
 

Author Closing Comment

by:Marc_Johnson
Comment Utility
Thank you, becraig. We ended up not going this route because we didn't want these tools on all of our user's workstations, but I appreciate the solution suggested.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now