Oct 30 2020 11:39 AM
Oct 31 2020 05:55 AM
Hi
Try to make a look on WMI
this is the powershell query to get the date and time from remote computer
Get-WmiObject -ComputerName REMOTE_COMPUTER -Query 'select * from Win32_CurrentTime where __CLASS ="Win32_LocalTime"'
For the timezone, you can use TZUTIL
Nov 08 2020 04:52 AM
Hi @nareshunik86,
Could you try that PowerShell script?
$ComputerNames = Get-Content "C:\Servers.txt"
foreach($ComputerName in $ComputerNames)
{
$TimeZone=Get-WmiObject -Class win32_timezone -ComputerName $ComputerName
$LocalTime = Get-WmiObject -Class win32_localtime -ComputerName $ComputerName
$Output =@{'ComputerName' = $LocalTime.__SERVER;
'Time Zone' = $TimeZone.Caption;
'Current Time' = (Get-Date -Day $LocalTime.Day -Month $LocalTime.Month);
}
$Object = New-Object -TypeName PSObject -Property $Output
Write-Output $Object
}
Servers.txt is a text file which includes your servers' names.
Mar 16 2022 04:24 AM