tags:

views:

24

answers:

1

Is there a way getting the tfs server time, i didn't find any method in the API which give such functionality. i have try many ways but failed to find a solution.

thanks in advance , EA

A: 

You could use WMI to get the time from the server. I'm not sure what additional privileges you would need.

In PowerShell:

Get-WMIObject -ComputerName TfsServer -Class Win32_LocaTtime

This is, of course, something that will work for any Windows system.

Richard
In need to do that from a .net code.
.NET fully supports WMI (via types in `System.Management`), PSH is just quicker to use for a one off. There will only be one instance of `Win32_LocalTime`, so WMI query is `SELECT * FROM Win32_LocalTime`.
Richard
There is no way to that in a clean way ?for example using tfs web services...or any other way using tfs API...
@user266203: Not as far as I know (and I would expect to find nothing for this). You could work through the VS SDK to look at the TFS client library.
Richard
Ok thanks , i will try to find a way to do that.