none
Powershell v2 and Active directory module

    Question

  • Could anyone provide me the windows powershellv2(CTP3) link and Active directory module for 32 bit (OS: Windows 2003)

    Pls help.

    Wednesday, April 28, 2010 6:52 AM

Answers

All replies

  • Why CTP3? You can download v2 RTM at http://support.microsoft.com/kb/968929

    HTH


    Ravikanth
    http://www.ravichaganti.com/blog
    Twitter: @ravikanth
    PowerShell 2.0 remoting - eBook
    Wednesday, April 28, 2010 8:13 AM
  • OK. How to add ?

    Import-module ActiveDirectory

    Wednesday, April 28, 2010 8:24 AM
  • This module will only be available on systems where AD role is installed or RSAT tools are installed.

    It requires PowerShell v2 http://technet.microsoft.com/en-us/magazine/ee914610.aspx


    Ravikanth
    http://www.ravichaganti.com/blog
    Twitter: @ravikanth
    PowerShell 2.0 remoting - eBook
    Wednesday, April 28, 2010 8:35 AM
  • getting below error

    PS D:\> Import-Module activedirectory
    Import-Module : The specified module 'activedirectory' was not loaded because no valid module file was found in any mod
    ule directory.
    At line:1 char:14
    + Import-Module <<<<  activedirectory
        + CategoryInfo          : ResourceUnavailable: (activedirectory:String) [Import-Module], FileNotFoundException
        + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

    Wednesday, April 28, 2010 9:49 AM
  • On what OS are u trying this? Do you have PowerShell v2 installed? Do you have active directory role installed?

    If not on Windows Server 2008 R2, do you have RSAT installed?

     


    Ravikanth
    http://www.ravichaganti.com/blog
    Twitter: @ravikanth
    PowerShell 2.0 remoting - eBook
    Wednesday, April 28, 2010 10:36 AM
  • Could anyone provide me the windows powershellv2(CTP3) link and Active directory module for 32 bit (OS: Windows 2003)

    Pls help.


    To use the AD module, in addition to having a Server 2008 R2 or Windows 7 machine with the AD PowerShell module, if you're not running Server 2008 R2 AD servers, you will need this:

    http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=008940c6-0296-4597-be3e-1d24c1cf0dda

    If you go with a Server 2003 or 2008 AD server with the above add-on, you will still need a Server 2008 R2 or Windows 7 system to be able to utilize the AD module.  Using PowerShell remoting, you would be able to use any system with PowerShell v2 installed to call the AD module cmdlets remotely, as outlined here:

    http://concentratedtech.com/item/view/id/340

    Wednesday, April 28, 2010 11:35 AM
    Moderator
  • Is it possible to import the ActiveDirectory module without installing RSAT? 

    Here is a quick summary of what I’ve tried:

    -          Install RSAT on a box

    -          Copy Module directory from c:\windows\system32\windowspowershell\v1.0 to a "central location"

    -          Connect to a box without RSAT

    -          Add "central location" Path to $PSModulePath

    -          Get-module –listavailable [finds the ActiveDirectory module]

    -          Import-module ActiveDirectory fails with error “AD module not loaded because no assembly was found.”

     

    If the only supported answer is “install RSAT” … then I guess I'll work on getting RSAT installed everywhere ... I was just hoping that the RSAT modules would be a little more "portable" and that it could be imported without requiring administrative privs or reboots [since RSAT would require both].

    Thursday, December 22, 2011 4:42 PM
  • Anyone else have any suggestions?  The ad module sure does make scripting some things easier!

    I am at the exact same place but I do not think I am going to install RSAT on all our computers.

    and please do not tell me the standard lines "you cant do it" or "it is not supported" or "it only works with RSAT installed.

    Thanks!

    Wednesday, April 11, 2012 8:12 PM
  • And the Quest active directory snappin is not an option?

    I thought they were/are the only option for non Server 2008 R2 or Windows 7 machines and running at least one Server 2008 R2 AD controller. You can find them here:

    Free PowerShell Commands for Active Directory

    Thursday, April 12, 2012 12:50 AM
  • its looking for a DLL, likely registered in the GAC... you could use the
    Sysinternals PerfMon to monitor it and try to figure out what files it
    loads...
     
    either way, you'd probably need to register the DLL in the GAC on all the
    machines which in effect would be as difficult as installing RSAT.
     
     

    Justin Rich
    http://jrich523.wordpress.com
    PowerShell V3 Guide (Technet)
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Thursday, April 12, 2012 1:33 PM
  • Hi,


    You have a very good option by bypassing the PSsession, it's very well explained here : http://www.youtube.com/watch?v=-Ya1dQ1Igkc&playnext=1&list=PL8061F1B9CFA86D4D&feature=results_main

    Watch from 2:05:22

    Hope this helps


    • Edited by Ahmad Habib Thursday, March 28, 2013 8:19 PM word
    Thursday, March 28, 2013 8:17 PM
  • I have this same flipping issue.  I had a botched Operations Manager console and was cleaning out the registry and most likely deleted something I shouldnt have.  Now my AD module will not load because it cannot be found.

    I have tried uninstalling RSAT completely

    Tried to uninstall Windows Framework 3.0

    EVERYTHING!!!  All the stuff on the net.  I see the Module folder being populated with the ACtiveDirectory folder, but it still wont load and it was working until I fiddled with the registry.

    Help!

    EFD

    Wednesday, July 24, 2013 6:38 PM
  • What I can't find out--though I think I can guess the answer--is whether there is an ActiveDirectory module that can be imported into PowerShell 2.0 on a Windows Server 2003 domain controller.  I'm sure the answer is "NO!!" but it would save me time and stomach lining to hear it from someone authoritative.  I'm holding my breath.
    Monday, October 14, 2013 11:05 PM
  • What I can't find out--though I think I can guess the answer--is whether there is an ActiveDirectory module that can be imported into PowerShell 2.0 on a Windows Server 2003 domain controller.  I'm sure the answer is "NO!!" but it would save me time and stomach lining to hear it from someone authoritative.  I'm holding my breath.

    You can stop holding your breath. The answer is indeed no.

    EDIT: Here's the official documentation:

    http://technet.microsoft.com/en-us/library/dd378937%28v=WS.10%29.aspx


    Don't retire TechNet! - (Maybe there's still a chance for hope, over 12,110+ strong and growing)


    Monday, October 14, 2013 11:22 PM
  • I found a very Simple and Eligant way to make the AD Powershell Module Portable.

    you will need 3 simple things

    1.) the ActiveDirectory Module Directory from a system that has it already installed. 

    Standard path on a 64bit windows 7

    C:\Windows\System32\WindowsPowerShell\v1.0\Modules

    2.)  Global Assembly Cache Utility

    Available from the Windows SDK

    gacutil.exe

    3.) the Microsoft.ActiveDirectory.Management dll assembly

    found on a system that already has the RSAT and powershell enabled. Microsoft.ActiveDirectory.Management.dll

    Now in order to make this work you need to install the dll using the gacutil program.  commandline is as follows.

    GACUTIL.exe -I Microsoft.ActiveDirectory.Management.dll

    Once installed you must copy the entire directory from item 1 to the powershell module location.

    Once copied you can then use the import command to import it and start using the cmdlets.  below is my batch file I wrote to automate this for deployment during SCCM.

    We want our help desk to be able to clone security groups assigned to our computers for application deployment so that when they image a replacement computer the new computer will automatically get the previously assigned applications.  Also see below for that powershell script as well.  Hope this helps the community.

    And for the people/MS that say it can not be done,  here to you :)

    REM ************************************
    REM SET Working Directory
    REM ************************************

    @setlocal enableextensions
    @cd /d "%~dp0"

    REM ************************************
    REM Copy Module
    REM ************************************

    if not exist C:\Windows\System32\WindowsPowerShell\v1.0\Modules\ActiveDirectory mkdir C:\Windows\System32\WindowsPowerShell\v1.0\Modules\ActiveDirectory
    xcopy /y /e .\ActiveDirectory\*.* C:\Windows\System32\WindowsPowerShell\v1.0\Modules\ActiveDirectory

    REM ************************************
    REM Install Microsoft Active Directory Assembly
    REM ************************************

    gacutil.exe -i Microsoft.ActiveDirectory.Management.dll

    REM ************************************
    REM Set Powershell Execution Policy
    REM ************************************

    powershell set-executionpolicy remotesigned

    REM ************************************
    REM Run Computer Membership Clone
    REM ************************************

    powershell ./ADCompMemberof.ps1

    exit

    ######################################################################

    Powershell script to copy group membership of a computer object in AD

     

    # Create TS Environment COM Object
    $TS = New-Object -ComObject Microsoft.SMS.TSEnvironment
    $Target=$TS.Value('_SMSTSMachineName')
    $Source=$TS.Value('OldComputer')

    $array = @()
    $groups = Get-AdComputer -Identity $source -property "MemberOf" 

    Foreach($group in $groups.memberOf) {
    $array +=$group
    }

    Get-ADComputer -Identity $target | Add-ADPrincipalGroupMembership -MemberOf $array

    • Proposed as answer by JmorganConsult Thursday, January 30, 2014 8:25 PM
    Thursday, January 30, 2014 8:25 PM