I am trying to run a script to return the w32tm status of a host, I run this-
$serverlist = @(w32tm /monitor | Where-Object{$_.StartsWith(" NTP:") -and !$_.StartsWith(" NTP: error")})
To get a list of all the NTP sources and their time offsets
When I run it as a domain account it works fine, but when I run it as the Local System Account i get this error-
Getting AD DC list for default domain...GetDcList failed with error code: 0x80070774. Exiting with error 0x80070774
Is there any way I can get around this? I don't want to change the user account that the script runs under for other reasons
w32time /monitor gets the information from the Domain Controller (PDC).
For the same reason, it needs the domain admin credentials to fetch it.
But if you wish to get the information locally, then you should use:
w32tm /query /configuration
Hope you can understand the difference.
User contributions licensed under CC BY-SA 3.0