Troubleshooting PowerShell Processes

%3CLINGO-SUB%20id%3D%22lingo-sub-1170136%22%20slang%3D%22en-US%22%3ETroubleshooting%20PowerShell%20Processes%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1170136%22%20slang%3D%22en-US%22%3E%3CP%3EHey%20Guys%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20an%20issue%20where%20a%20single%20PowerShell%20process%20is%20using%2020%25%20of%20the%20CPU%20and%20up%20to%2010GB%20of%20RAM%20.%20This%20causing%20windows%20resource%20exhaustion%20issues.%20(RADAR).%20Looking%20in%20the%20IIS%20processes%2C%20i%20see%20that%20PowerShell%20and%20ECP%20are%20both%20slammed%20(powershell%20more%20than%20ecp).%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUsing%20the%20IIS%20logs%20i%20am%20able%20to%20find%20what%20looks%20like%20an%20offending%20user%2C%20this%20specific%20user%20has%20114K%20items%20in%20the%20log%20files%2C%20calling%20ECP%20and%20PowerShell.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20can%20i%20figure%20out%20exactly%20what%20commands%20or%20processes%20are%20being%20under%20this%20powershell%20session%3F%20I%20know%20the%20Process%20ID%20and%20i%20thought%20that%20DebugView%20would%20tell%20me%2C%20but%20Debug%20logging%20isnt%20enabled.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20an%20easier%20way%20to%20tell%20what%20cmdlets%20the%20process%20is%20running%3F%20The%20user%20is%20most%20likely%20running%20an%20exchange%20powershell%20script.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F70852%22%20target%3D%22_blank%22%3E%40Ross%20Smith%20IV%3C%2FA%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F64%22%20target%3D%22_blank%22%3E%40Tony%20Redmond%3C%2FA%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F102076%22%20target%3D%22_blank%22%3E%40Joe%20Schaeffer%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20ideas%20guys%3F%20this%20would%20be%20right%20down%20your%20alley!!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERobert%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1170136%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1205243%22%20slang%3D%22en-US%22%3ERe%3A%20Troubleshooting%20PowerShell%20Processes%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1205243%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F78373%22%20target%3D%22_blank%22%3E%40Robert%20Bollinger%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20it%20a%20local%20script%20on%20the%20server%20or%20is%20it%20a%20remote%20script%20and%20call%20a%20webside%20what%20is%20provided%20by%20your%20IIS%3F%3C%2FP%3E%3CP%3EIf%20it%20is%20a%20local%20script%20that%20search%20for%20it%20(open%20the%20taskmanager%2C%20configure%20the%20command%20line%20column)%20and%20look%20for%20the%20script%20path.%3C%2FP%3E%3CP%3EThan%20you%20can%20have%20a%20look%20into%20the%20script.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20it%20is%20a%20remote%20script%2C%20that%20may%20Fiddler%20is%20the%20thing%20what%20will%20help%20you%20to%20see%20what%20kind%20of%20request%20comming%20to%20your%20IIS%20via%20the%20remote%20script.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ebr%2C%3C%2FP%3E%3CP%3ENico%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Frequent Contributor

Hey Guys, 

 

I have an issue where a single PowerShell process is using 20% of the CPU and up to 10GB of RAM . This causing windows resource exhaustion issues. (RADAR). Looking in the IIS processes, i see that PowerShell and ECP are both slammed (powershell more than ecp). 

 

Using the IIS logs i am able to find what looks like an offending user, this specific user has 114K items in the log files, calling ECP and PowerShell. 

 

How can i figure out exactly what commands or processes are being under this powershell session? I know the Process ID and i thought that DebugView would tell me, but Debug logging isnt enabled. 

 

Is there an easier way to tell what cmdlets the process is running? The user is most likely running an exchange powershell script. 

 

@Ross Smith IV @Tony Redmond @Joe Schaeffer 

 

Any ideas guys? this would be right down your alley!!

 

Thanks, 

 

Robert 

1 Reply
Highlighted

@Robert Bollinger 

Is it a local script on the server or is it a remote script and call a webside what is provided by your IIS?

If it is a local script that search for it (open the taskmanager, configure the command line column) and look for the script path.

Than you can have a look into the script.

 

If it is a remote script, that may Fiddler is the thing what will help you to see what kind of request comming to your IIS via the remote script.

 

br,

Nico