Using PS to Adjust the server time Powershell has a command to Adjust the computer time, Set-Date-Adjust. However, you can only Adjust the local time, but not the remote computer time. FunctionAdjustDCTime ($ Server, $ addTime) {$ SvrGet-W use PS to Adjust the Server time Powershell has a command to Adjust the computer time, Set-Date-Adjust,, you can only adjust the local time, not the remote computer time. Function AdjustDCTime ($ Server, $ addTime) {$ Svr = Get-WmiObject Win32_OperatingSystem-ComputerName $ Server $ time = $ Svr. localDateTime $ NewTime = ([wmi] ""). convertToDateTime ($ time ). addSeconds ($ addtime) # $ NewTime $ setTime = ([wmi] ""). convertFromDateTime ($ NewTime) $ Svr. setDateTime ($ setTime) # $ time = $ Svr. localDateTime # $ time} # $ Server = ". "# $ addTime =-60 AdjustDCTime ". "60
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.