Using Powershell to Set Date and Time

Опубликовано: 21 Октябрь 2024
на канале: Tom's Tech Show!
2,067
19

Some servers I have setup will just not keep the time correctly. Here is how I manage that using PowerShell

Get NTP Function
https://gallery.technet.microsoft.com...

Additional Commands to set time, place at the end of the file

$NtpArray = Get-NtpTime
$NtpDateTime = Get-Date -Date $NtpArray.NtpTime
Set-Date -Date $NtpDateTime

How to support my channel
0 - SHARE THIS VIDEO!
1 - Like videos
2 - Subscribe to my channel
3 - https://www.tomstechshow.com/contribute
4 - Twitter   / toms_tech_show  
5 - Facebook https://fb.me/tomstechshow

Code repository
https://bitbucket.org/tomstechshow/

My photo site
http://www.thomasnelsonphotography.com