Windows PowerShell Home
getForest($context) hangs indefinetly when used within a job
11/1/2013 10:49:01 AM
User(s) can reproduce this bug
within a PowerShell job, the job hangs indefinetly. Runs fine when used outside a job.
Microsoft Windows Server 2003 R2 Enterprise Edition SP2
How often does this happen?
Have you seen this problem before in this product?
I do not know if this issue existed previously
Create a new job where you call
$Context = New-Object System.DirectoryServices.ActiveDirectory.DirectoryContext("Forest", "Contoso.com")
within the script-block.
(Replace Contoso.com with the appropriate name for the forest)
The job will get past the first command, as seen with Receive-Job (It'll output 1), but will never continue on from there.
to post a comment.
Please enter a comment.
on 11/1/2013 at 12:28 PM
This appears to be the same as reported here: https://connect.microsoft.com/PowerShell/feedback/details/499499/adding-a-snapin-add-pssnapin-from-within-a-job-start-job-causes-job-to-hang-indefinitely
Note that this has been fixed in PowerShell V3 as well as Vista and above operating systems.
on 11/1/2013 at 11:06 AM
Also reproducible on Windows XP (Professional Version 2002 Service Pack 3).
to post a workaround.
Please enter a workaround.
© 2014 Microsoft