Stephan,
Thanks for your help, however I think I must be doing something wrong?
Add-Member : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:116
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member <<<< -MemberType NoteProperty -Name ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
Add-Member : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:116
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member <<<< -MemberType NoteProperty -Name ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
Add-Member : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:116
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member <<<< -MemberType NoteProperty -Name ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
Add-Member : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:116
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member <<<< -MemberType NoteProperty -Name ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
Add-Member : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:116
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member <<<< -MemberType NoteProperty -Name ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
Add-Member : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:116
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member <<<< -MemberType NoteProperty -Name ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
Add-Member : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:116
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member <<<< -MemberType NoteProperty -Name ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
Add-Member : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:116
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member <<<< -MemberType NoteProperty -Name ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
Add-Member : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:116
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member <<<< -MemberType NoteProperty -Name ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
Add-Member : Cannot bind argument to parameter 'Name' because it is an empty string.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:147
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member -MemberType NoteProperty -Name <<<< ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
Add-Member : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:116
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member <<<< -MemberType NoteProperty -Name ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
Add-Member : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:116
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member <<<< -MemberType NoteProperty -Name ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
Add-Member : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:116
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member <<<< -MemberType NoteProperty -Name ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
Add-Member : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:116
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member <<<< -MemberType NoteProperty -Name ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
Add-Member : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:116
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member <<<< -MemberType NoteProperty -Name ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
Add-Member : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:116
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member <<<< -MemberType NoteProperty -Name ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
Add-Member : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:116
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member <<<< -MemberType NoteProperty -Name ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
Add-Member : Cannot bind argument to parameter 'Name' because it is an empty string.
At C:\Users\TechOp\PRTG_SNTP_test.ps1:1 char:147
+ [pscustomobject]$timesync = New-Object -TypeName PSObject; (w32tm /query /status /verbose) | % { $test | Add-Member -MemberType NoteProperty -Name <<<< ($_ -split ": ")[0] -Value (($_ -split ": ")[1] -replace "[^0-9$.,]"); }; $timesync
+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
For reference, I originally ran just the command and got this same output. In order to be able to copy the entire error output, I saved it as a .ps1 and ran it as
.\PRTG_SNTP_test.ps1 2>&1 | tee -filePath C:\users\TechOp\ps_errors.txt
This is a stripped-down and hardened Win7 install on this dedicated probe, and I ran standard PowerShell (not x86 or ISE) as an Administrator. Please let me know if I'm missing something, in the meantime I am awaiting a response from Veracity on my inquiry to them.
Thank you!
C.J.
Add comment