Question of active directory Powershell module

hi i would like to check if we use active directory Powershell commands in our powershell script do i need to install the active directory Powershell module on the machine that is running OO central? Look forward to any suggestions or reply. :)

 

Untitled.png

  • Verified Answer

    Yes, I have done that earlier for activate/disable some ad-computer objects in active directory that for OO with CSA.

  • you are welcome :), just keep in mind that to mention that if you running remote PowerShell script over active directory direct to Active directory no need for AD module in OO.

    that if u have limitation to access AD from a customer perspective for security reasons. something like below

    Import-Module ActiveDirectory

    $userName = "${username}"

    $secure_string_pwd= convertto-securestring "${password}" -asplaintext -force

    $cred = new-object management.automation.pscredential $userName,$secure_string_pwd

     

    $Adaccount = Get-ADComputer ${vm} ActiveDirectory\Disable-ADAccount $Adaccount -credential $cred

     

    ActiveDirectory\Move-adobject $Adaccount -targetpath "OU=Windows,ou=Servers,ou= Computers,dc=domain,dc=local" -Credential $cred Get-ADComputer ${vm}

  • hi Mostafa,

    you mentioned about " remote PowerShell script over active directory" that part i am lightly confused. the current setup is powershell script is ruinning from OO Central but conncting to remote AD server to perform certain task, in this case do we need the AD Powershell module installed in the OO central server (i was thinking operation will only work only if you are able able to execute AD powershell commands from OO central server manually)? 

    YH

  • Hello, 

    Sorry for late response, what I meant some customers don't allow remote PowerShell session to AD directly, 

    so other way is to install AD-Powershell Module in Central and run that from central with an account that has permission to do so whatever action in the AD.