none
A connection to the directory on which to process the request was unavailable. This is likely a transient condition. RRS feed

  • Question

  • Hi Experts,

    When we execute many powershell scripts parallel sometimes we receive below error

    "A connection to the directory on which to process the request was unavailable. This is likely a transient condition."

    we have some runbook configured in which all most all AD activities are automated using powershell scripts. eg.user create/deletion/adding member to group etc.. and there are high chances that powershell query executes parallel by the system and we get the error.

    may be web service is overloaded. is there anyway we can increase the parallel connection or any other solution?


    Regards, Nidhin.CK

    Wednesday, September 17, 2014 9:54 PM

Answers

  • Hi Nidhin,

    Background jobs are autonomous things. They aren't a separate thread sharing resources, they are actually run in a whole new PowerShell.exe process. So we need to use Import-Module inside your script block to have you module members available there.

    As a workaroud, you can try to use ADSI instead, the script below use ADSI to add members to a group is for your reference:

    $G = [adsi]"LDAP://CN=MyGoup,OU=MyOU,DC=MY,DC=CORP"
    $U = [adsi]"LDAP://CN=MyUser,OU=MyOU,DC=MY,DC=CORP"
    $G.Add($U.ADspath)

    In addition, you can also check this similar discussion:

    A connection to the directory on which to process the request...

    If there is anything else regarding this issue, please feel free to post back.

    Best Regards,

    Anna Wang

    Friday, September 19, 2014 2:57 AM
    Moderator