Solved

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

Posted on 2014-04-04
2
183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Raise the IQ of Your IT Alerts

From IT major incidents to manufacturing line slowdowns, every business process generates insights that need to reach the people required to take action. You need a platform that integrates with your business tools to create fully enabled DevOps toolchains.

You need xMatters.

Question has a verified solution.

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

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

696 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