August 18, 2014 at 7:54 am #18103
I've recently written a module for a company, with functions for all their specific User Provisioning tasks and frequent requests. A few of the commands require the Exchange 2010 Snap-ins, so I have a Shortcut on the desktop that's runs a PowerShell script which opens PowerShell in Version 2 mode, loads the Exchange Management Shell (in the supported way), the AD Module and the custom module that I've created.
As part of this module, we have a lot of New Starter requests come in as automated emails from SAP. So I've written a function to open Outlook (COM Object) via the MAPI profile, get this particular folder and convert the New Starter emails into an object that can be piped into my New-Starter command.
Before these new starters can be processed, we have to wait for our service desk to open the request, then we need to add the call reference to each object in the collection. To do this, we've tried load of different methods. Forms, WPF etc, but due to Exchange 2010 forcing us to use PowerShell 2.0, nothing was working particularly well. In the end, I wrote a simple DOS-Style menu that lists each of the users in the collection, gives the end-users the option of selecting a user, then prompts for the Call Reference. Once all the call references have been entered, you press the S key, and the function writes out the newly updated object.
Here's where things get weird. When I run this menu function, I can update one or two objects in the collection with no problems. Everything works fine. However, when we get a large number of new starters come through, and I try to update 5-10 objects, everything appears to work fine, the output is written correctly, but then traditional command line utilities no longer work. If I try to run ping, rmtshare, netsh, shutdown etc. they all just return a prompt with no output.
PowerShell CmdLets still function with no problems, and I can run commands that start a new process (notepad.exe, calc.exe), but when I try and run any executable that would output in the same shell, I get nothing.
I can't say for certain, but so far I've not been able been able to reproduce the issue on PowerShell 3 or above.
My colleague found a TechNet article which sounds like the same issue, but it looks like they had about as much luck as I've been having.
Has anyone ever seen anything like before? It's driving me crazy...
August 20, 2014 at 2:37 am #18173
I've not personally run into it, no. Frankly, it sounds like something that could only be solved by Microsoft product support working with you, possibly trying to run your script while having a debugger attached to the PowerShell process.
You must be logged in to reply to this topic.