I can’t for the life of me figure out how to include the actual service name. Also one other thing less important is that it doesn’t act like a SQL select where I can rename the column with the “AS” statement. How would I also do that easily?
Is it Get-Service or Get-Process you’re using in your script?
BTW:
When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
Can you clarify what you mean by “I can’t figure out how to include the actual service name” statement? Your list of processes have a certain set of properties available. You’re selecting 4 of those properties. If you want to see all the properties available, you can interrogate the objects with Get-Member
You’re going to have to explain what you’re trying to achieve, what you’ve tried, and what’s not working much more clearly. You talk about services, but you’re running Get-Process. Please, take a step back and think about how you’re explaining this. Plenty of us want to help you, but we can’t read your mind.
Okay thanks and sorry if I am not explaining this well. I want a list of processes with the start time and the windows service name. Get-Process gives me the starttime which is what I want but the name (and processname) is the name of the executable (e.g. foobar.exe). In my environment I have like 10 windows services that use that same executable but the Windows Service name is something a lot different like Scheduled Job Doing Task X. Each task is different and named accordingly to the display name in the windows service itself. Maybe there is specific column name I need to pull in that I am unaware of idk. Let me know if I am finally making sense, thanks!
Not all processes are related to a service. And not all services have a constantly running process. So you may need separate queries to get what you want.
Can you share some actual names/examples? If these service use the same executable you may be unable to determine individual start times.
Sorry I thought there might be an easy way to do it with some switches or pipes I was unaware of. I do not want to make this a big project. Just want to make sure there was nothing I was missing
There are no switches mixing cmdlets for processes and services - no. But there might be a solution anyway. You just have to explain exactly what you need.
It does not have to be a big project. But we are unable to help until we understand what you actually want to do.