Timeout issue

Welcome Forums General PowerShell Q&A Timeout issue

This topic contains 1 reply, has 2 voices, and was last updated by

7 months ago.

  • Author
  • #105164

    Points: 42
    Rank: Member

    Not really a scripting question,

    the script below works fine on smaller groups, however my gateway groups can include upwards od 20-30k objects

    $Gateways = Get-ADGroup -ldapFilter "(name=*gateway*)" -SearchBase "OU=Internet Mail,DC=global,DC=Contoso,DC=com" -SearchScope OneLevel | select -ExpandProperty name
    foreach ($Gateway in $Gateways)
        $members = Get-ADGroupMember -Identity $gateway -Recursive | Select -ExpandProperty Name

    after running for a while it will return a timeout error (per group)

    Get-ADGroupMember : The size limit for this request was exceeded
    At H:\EAA\Powers Shell Commands\Mail Enabled DL.ps1:6 char:16
    + ...    $members = Get-ADGroupMember -Identity $gateway -Recursive | Selec ...
    +                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (Europe Gateway:ADGroup) [Get-ADGroupMember], ADException
        + FullyQualifiedErrorId : ActiveDirectoryServer:8227,Microsoft.ActiveDirectory.Management.Commands.GetADGroupMember

    how can i increase timeout or make this more efficient, i realise i am not doing anything with $members yet 🙂

  • #105172

    Points: 518
    Helping Hand
    Rank: Major Contributor

The topic ‘Timeout issue’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort