Quantcast
Channel: Network Audit and Documentation, CENTREL Solutions Blog
Viewing all articles
Browse latest Browse all 433

Get-Printer StartTime and UntilTime

$
0
0
The Windows PowerShell Get-Printer cmdlet provides a start and finish time for printer availability but confusingly this value is returned as an integer value.



More confusingly this is stored as a value of minutes from midnight GMT so if you print server is in GMT -5 and has a available from time of midnight you'll see the StartTime of 300.

If you'd like to convert the time to a DateTime that is more understandable that reflects what is seen in the UI try the following



$baseTime=[System.DateTime]::MinValue.AddDays(1)
$baseTime=$baseTime.AddHours([System.TimeZoneInfo]::Local.BaseUtcOffset.TotalHours)
$baseTime=$baseTime.AddMinutes(150)


Viewing all articles
Browse latest Browse all 433

Trending Articles