Powershell get-process select start time

Hi Guys,

I have written this powershell script:

 Get-Process -ComputerName server-exam01 dp* | select starttime


however it does not tell me the start time of the process. Please can someone help me.
chglAsked:
Who is Participating?
 
SubsunConnect With a Mentor Commented:
That seems to be a bug with Get-Process command in collecting process details.. If remoting enabled on server server-exam01 then you can try..

Invoke-command -ComputerName server-exam01 -scriptblock {Get-Process dp* | select starttime}

Open in new window


Else try with WMI..
get-WmiObject Win32_Process -computername server-exam01 | ? {$_.name -like "dp*"} | Select Name,@{N="CreationDate";E={[System.Management.ManagementDateTimeconverter]::ToDateTime($_.CreationDate)}}

Open in new window

0
 
Meir RivkinFull stack Software EngineerCommented:
what is the output of the script run?
0
 
Haresh NikumbhSr. Tech leadCommented:
try this

Get-Process -ComputerName server-exam01 dp* | select StartTime

script
Powershell script is case sensitive

I have run for local computer, and i got above result. it should work on remote computer too
0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

 
Meir RivkinFull stack Software EngineerCommented:
@takecoffee
in this case powersehll is not case sensitive.
i can run Get-Process  *r* | select name,StaRttiMe
and it will work fine, its not the issue.
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
It is not a bug, it's a feature. Many properties of processes are available only on the local machine. The StartTime property is one of them (see NotSupportedException in http://msdn.microsoft.com/en-us/library/system.diagnostics.process.starttime.aspx).
0
 
Haresh NikumbhSr. Tech leadCommented:
aha good to know ..
0
 
chglAuthor Commented:
what does the @ before the {N=....} mean?
0
 
SubsunCommented:
It's for creating a custom property..

N= is short form of Name=
E= is short form of Expression=

Ref : http://technet.microsoft.com/en-us/magazine/hh750381.aspx
0
 
chglAuthor Commented:
brlliant thanks :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.