Solved

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

Posted on 2014-04-04
2
182 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 29

Accepted Solution

by:
becraig earned 500 total points
ID: 39979364
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
ID: 39986768
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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
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 …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

733 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