Automation

 View Only
Expand all | Collapse all

PowerCLI: Detect incorrect Time Configuration

  • 1.  PowerCLI: Detect incorrect Time Configuration

    Posted Sep 07, 2010 01:07 PM

    Hi all,

    I am looking for PowerCLI code to detect "Incorrect Date&Time Settings"

    We have some ESXi 4.0 U1 hosts (Dell blades) of which the BIOS time has a too large offset to the NTP server.

    Therefore it will never sync the time.

    In vCenter the Date & Time Configuration is shown as red (differs too much from client).

    Is there any Powershell code to detect which host has a misconfigured date / time setting?

    (I don't like going through 200 hosts manually..... :smileywink: )

    Thanks for your help.

    Regards,

    Harold



  • 2.  RE: PowerCLI: Detect incorrect Time Configuration

    Broadcom Employee
    Posted Sep 07, 2010 02:44 PM

    Hi,

    Here is simple that can do that for you:

    $allowedDifferenceSeconds = 20
    
    get-vmhost | %{    
        #get host datetime system
        $dts = get-view $_.ExtensionData.configManager.DateTimeSystem
        
        #get host time
        $t = $dts.QueryDateTime()
        
        #calculate time difference in secconds
        $s = ( $t - [DateTime]::UtcNow).TotalSeconds
        
        #check if time difference is too much
        if( $s -gt $allowedDifferenceSeconds){
            #print host and time difference in seconds
            $row = "" | select HostName, Seconds
            $row.HostName = $_.Name
            $row.Seconds = $s
            $row
        }
    }
    
    

    Regards,

    Nedko Nedev

    PowerCLI Development Team



  • 3.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Sep 07, 2010 03:06 PM

    Hello Nedko,

    Thanks for your quick reply.

    This code does look like what I am looking for, but it does not seem to work.

    Is this by any chance PowerCLI 4.1 code?

    We are still on 4.0....

    Thanks again.

    Regards,

    Harold



  • 4.  RE: PowerCLI: Detect incorrect Time Configuration
    Best Answer

    Broadcom Employee
    Posted Sep 07, 2010 03:39 PM

    Hi,

    VMHost.ExtensionData property is new to PowerCLI 4.1 and in order to run this script with PowerCLI 4.0 you should replace it with get-view

    invocation:

    Get-VMhost | Get-view |% {
        #get host datetime system
        $dts = get-view $_.ConfigManager.DateTimeSystem
    ...
    

    Here is the final version of the script:

    $allowedDifferenceSeconds = 20
    
    get-view -ViewType HostSystem -Property Name, ConfigManager.DateTimeSystem | %{    
        #get host datetime system
        $dts = get-view $_.ConfigManager.DateTimeSystem
        
        #get host time
        $t = $dts.QueryDateTime()
        
        #calculate time difference in seconds
        $s = ( $t - [DateTime]::UtcNow).TotalSeconds
        
        #check if time difference is too much
        if( $s -gt $allowedDifferenceSeconds){
            #print host and time difference in seconds
            $row = "" | select HostName, Seconds
            $row.HostName = $_.Name
            $row.Seconds = $s
            $row
        }
    }
    

    It's using Get-View -ViewType HostSystem since it's the fastest way to get view for each VMhost object

    Regards,

    Yasen Kalchev

    PowerCLI Dev Team



  • 5.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Sep 07, 2010 03:57 PM

    Thanks all, this works fine!

    I just made one change, to also check hosts having a negative time offset:

    if( $s -gt $allowedDifferenceSeconds -or $s -lt (0 - $allowedDifferenceSeconds) ){

    Regards,

    Harold



  • 6.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Sep 07, 2010 04:36 PM

    You could also use the Absolute value mathematical function and use a shorter condition

    if([math]::abs($s) -gt $allowedDifferenceSeconds){
    

    ____________

    Blog: LucD notes

    Twitter: lucd22



  • 7.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Sep 08, 2010 05:05 PM

    Thnaks Luc,

    I knew there was some way to make it absolute, this solves all my questions on this topic.

    Thanks guys !



  • 8.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Apr 08, 2011 12:35 AM

    Someone could tell me how can I run this script I have VMware 4.1 Update 1 vSphere PowerCLI

    thanks for you help.

    tomas!



  • 9.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Apr 08, 2011 01:06 AM

    Have you installed the latest PowerrCLI build on a Windows box ?

    If yes,

    • save the script in a file with a .ps1 extension
    • start the PowerCLI prompt
    • check that the execution policy is set to remotesigned.
      • execute Get-ExecutionPolicy from the prompt
      • if not set correctly, execute Set-ExecutionPolicy RemoteSigned
    • connect to the vSphere server with Connect-VIServer -Server <servername>
    • run the script by typing .\<name-of-the-script>.ps1 at the prompt


  • 10.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Apr 08, 2011 03:37 PM

    Thanks thanks for answering ...

    I did the steps described, and the console will not mark any error, but does not return any results. Any ideas?

    We appreciate your help.!!



  • 11.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Apr 08, 2011 04:14 PM

    The script tests if there is a time drift greater than 20 seconds.

    If not, there is no output.

    The following version adds a positive message to the script.

    $allowedDifferenceSeconds = 20

    get-view -ViewType HostSystem -Property Name, ConfigManager.DateTimeSystem | %{   
        #get host datetime system
        $dts = get-view $_.ConfigManager.DateTimeSystem
       
        #get host time
        $t = $dts.QueryDateTime()
       
        #calculate time difference in seconds
        $s = ( $t - [DateTime]::UtcNow).TotalSeconds
       
        #check if time difference is too much
        if(
    [math]::abs($s) -gt $allowedDifferenceSeconds){
            #print host and time difference in seconds
            $row = "" | select HostName, Seconds
            $row.HostName = $_.Name
            $row.Seconds = $s
            $row
        }
        else{
            Write-Host "Time on" $_.Name "within allowed range"
        }
    }


  • 12.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Apr 08, 2011 05:23 PM

    Thanks a lot; this version is very helpful to me,  thank you very much.

    tom.



  • 13.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jan 07, 2013 12:46 AM

    Hi Luc

    This script works great! How could I allow for the different time zones?

    Thanks



  • 14.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jan 07, 2013 09:12 AM

    Try changing

    [DateTime]::UtcNow

    into

    [DateTime]::Now


  • 15.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jan 07, 2013 01:33 PM

    I'm getting the folloing error regardless if I'm using [DateTime]::UTCNow or [DateTime]::Now...

    Method invocation failed because [System.Object[]] doesn't contain a method nam
    ed 'QueryDateTime'.
    At D:\VPO\test\test.ps1:30 char:27
    +    $t = $dts.QueryDateTime <<<< ()
        + CategoryInfo          : InvalidOperation: (QueryDateTime:String) [], Run
       timeException
        + FullyQualifiedErrorId : MethodNotFound

    I found an article on the web that suggested using another ]

    [DateTime]]::Now

    but this didn't work



  • 16.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jan 07, 2013 01:42 PM

    I suspect you are are running in "multiple" mode (see Set-PowerCLIConfiguration) and that you are connected to more than 1 vSphere server.

    You can check with

    $defaultVIServers.

    As an effect the variable $dts will be an array, which doesn't have the QueryDateTime method.



  • 17.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jan 07, 2013 04:04 PM

    It's running better now with only one error...

    Get-View : Cannot validate argument on parameter 'VIObject'. The argument is nu
    ll or empty. Supply an argument that is not null or empty and then try the comm
    and again.
    At D:\VPO\test\test.ps1:31 char:19
    +    $dts = get-view <<<<  $_.ConfigManager.DateTimeSystem
        + CategoryInfo          : InvalidData: (:) [Get-View], ParameterBindingVal
       idationException
        + FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutom
       ation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView

    I ran Set-PowerCLIConfiguration -DefaultVIServerMode 'Single' -Confirm:$false to cahnge the DefaultVIServerMode.



  • 18.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jan 07, 2013 04:17 PM

    It looks as if the $_ is empty.

    Are you sure the previous 'Get-View -ViewType HostSystem ...' returns anything ?

    Is the Filter correct ?



  • 19.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jan 07, 2013 04:28 PM

    The filter does return reults. The script starts out with no errors then somewhere in between the the output I get the error.



  • 20.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jan 07, 2013 04:46 PM

    In the servers returned by

    get-view -ViewType HostSystem -Property Name, ConfigManager.DateTimeSystem -Filter @{"Name"=$esxnames}

    is there perhaps a host that is powered off ?



  • 21.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jan 07, 2013 06:44 PM

    there was one host that was powered off but its still came back with

    esx01 within allowed range



  • 22.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jan 07, 2013 06:51 PM

    And is that the host that is causing the error message on the

    $dts = get-view $_.ConfigManager.DateTimeSystem

    line ?

    If you don't have a debugger, you can show the name of the host on screen.

    Just add the following line before the line above (inside the code block)

    Write-Host $_.Name

    I suspect the test succeeds because the script uses the value in $t from the previous host.



  • 23.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jan 07, 2013 08:54 PM

    OK here are my findings:

    When I ran the script in my prodcution environment I got the following error:

    Get-View : Cannot validate argument on parameter 'VIObject'. The argument is nu
    ll or empty. Supply an argument that is not null or empty and then try the comm
    and again.
    At D:\VPO\test\test.ps1:32 char:19
    +    $dts = get-view <<<<  $_.ConfigManager.DateTimeSystem
        + CategoryInfo          : InvalidData: (:) [Get-View], ParameterBindingVal
       idationException
        + FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutom
       ation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView

    When I ran the script in my test environment of 2 hosts I got this error:

    esx02.flotech.lab.org
    Exception calling "QueryDateTime" with "0" argument(s): "Unable to communicate
    with the remote host, since it is disconnected."
    At E:\Scripts\Test\test.ps1:35 char:27
    +    $t = $dts.QueryDateTime <<<< ()
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : DotNetMethodException

    The operation '[$null] - [System.DateTime]' is not defined.
    At E:\Scripts\Test\test.ps1:38 char:15
    +    $s = ( $t - <<<<  [DateTime]::UtcNow).TotalSeconds
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : NotAdefinedOperationForTypeType

    Time on esx02.flotech.lab.org is within allowed range
    esx01.flotech.lab.org
    Time on esx01.flotech.lab.org is within allowed range

    The common factor in both tests are that the hosts in both environments were disconnected.



  • 24.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jan 07, 2013 10:38 PM

    Ok, that makes sense.

    The solution is to test if the host is powered on and connected, if not display a message.



  • 25.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jan 17, 2013 07:04 PM

    Hi Luc

    How would you change the $allowedDifference to return minutes instead of seconds?



  • 26.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jan 17, 2013 07:12 PM

    I would add a line and change the 1st line, something like this

    $allowedDifferenceMinutes = 2
    $allowedDifferenceSeconds = $allowedDifferenceMinutes * 60


  • 27.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jan 17, 2013 07:40 PM

    Still sending output in seconds:

    HostName                                       Seconds

    --------                                                -------

    ESX5Host1                                   -341.7298868 



  • 28.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jan 17, 2013 07:48 PM

    I see, you mean the output.

    Then you can change this line

    $s = ( $t - [DateTime]::UtcNow).TotalSeconds

    into

    $s = ( $t - [DateTime]::UtcNow).TotalMinutes

    And change the property name of course.

    Note that this will return the minutes as a fraction if the difference is not a multiple of 60 seconds.



  • 29.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jan 17, 2013 07:59 PM

    That worked. Thanks!



  • 30.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Mar 18, 2013 04:39 PM

    Wouldn't setting the NTP.CONF file with tinker panic 0 solve the issue with a large drift in time causing the Host not to be able to sync with the NTP server? My environment has this issue and I am trying to determine the best way to solve it.

    Thanks,

    Brad



  • 31.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Mar 18, 2013 06:35 PM

    That is a possible solution if you experience large drift.

    But you could also monitor the drift and send a 'ntpd -q' when the drift exceeds a threshold



  • 32.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Apr 10, 2013 04:09 AM

    Hi Luc,

    I'm getting an error with get-view command as below, have or don't have "ExtensionData". We're using ESXi5 and running from powerCLI 4.1. Pls help me.

    Get-View : Cannot validate argument on parameter 'Id'. The argument cannot be null or empty.
    At line:1 char:19
    + $dts=Get-View <<<<  $esx.ExtensionData.ConfigManager.dateTimeSystem
        + CategoryInfo          : InvalidData: (:) [Get-View], ParameterBindingValidationException
        + FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutomation.Commands.DotNetInterop.GetVIView

    ----------------

    Get-View : Cannot validate argument on parameter 'Id'. The argument cannot be null or empty.
    At line:1 char:19
    + $dts=Get-View <<<<  $esx.ConfigManager.dateTimeSystem
        + CategoryInfo          : InvalidData: (:) [Get-View], ParameterBindingValidationException
        + FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutomation.Commands.DotNetInterop.GetVIView



  • 33.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Apr 10, 2013 05:25 AM

    You should consider upgarding your PowerCLI version if possible.

    If not possible, you will have to do this in 2 steps

    $esxObj = Get-View $esx

    $dts = Get-View $esxObj.ConfigManager.dateTimeSystem



  • 34.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Apr 10, 2013 06:19 AM

    Hi Luc,

    Thanks for your recommended to upgrade PowerCLI version. Now I am using powerCLI 5.0 and already passed the command: "$dts = Get-View $esx.Extensiondata.ConfigManager.dateTimeSystem".

    But another issue has appeared with the command: "$dts.UpdateDateTime(Get-Date)". Error as below:

    Missing ')' in method call.
    At line:1 char:26
    + $dts.UpdateDateTime( <<<< get-date)
        + CategoryInfo          : ParserError: (CloseParenToken:TokenId) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : MissingEndParenthesisInMethodCall



  • 35.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Apr 10, 2013 07:58 AM

    Try it like this

    $dtSystem = Get-View $esx.Extensiondata.ConfigManager.dateTimeSystem 
    $dtSystem
    .UpdateDateTime((Get-Date))

    With the double parenthesis we force Get-Date to execute first



  • 36.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Apr 10, 2013 08:10 AM

    Woa, that's running! So all that we needed!

    Thank you very much, :smileyhappy:



  • 37.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Oct 17, 2012 08:02 AM

    HI ,

    Apologies for bumping up a very old thread but is there any way i can run this script against a list of 200 EsxI server . say i enter the name of server in a simple text file, it read that text file and calls this script to give me the output . I just need to know what time the hosts are running . if there is a difference, it should just report that so tht i can correct it manually or if possible script be able to correct it.

    I am currently runnig windows powershell ver 2.0 & running Vsphere 5 . Not sure if i can use the same for running .Ps1 ext scripts..



  • 38.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Oct 17, 2012 08:34 AM

    You will need to have the PowerCLI snapin installed to run the script.

    If I understand you correctly, you want to retrieve the names of the ESXi servers to check from a text file.

    Is that correct ?



  • 39.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Oct 17, 2012 08:38 AM

    Yes, that;s Correct. Idea is to feed the name of EsxI server from a text file and Let the script get me time on the host. If required, it should synch a pre defined time on All esxI hosts .

    Say ..i am running correct time on my Windows server from where i am running the script. I am trying to synch the time of all esxI host with this correct time . In the end, i want all my esxI hosts running correct time .

    Apologies in advance for nit picking but i am new to Scripting & don ;t have even a slight idea fo scripts...



  • 40.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Oct 17, 2012 08:42 AM

    Try something like this

    $allowedDifferenceSeconds = 20 
    $esxnames
    =  [string]::Join('|',(Get-Content -Path C:\vmhosts.txt | %{"^" + $_}))   get-view -ViewType HostSystem -Property Name, ConfigManager.DateTimeSystem -Filter @{"Name"=$esxnames} | %{     #get host datetime system     $dts = get-view $_.ConfigManager.DateTimeSystem        #get host time     $t = $dts.QueryDateTime()         #calculate time difference in seconds     $s = ( $t - [DateTime]::UtcNow).TotalSeconds        #check if time difference is too much     if([math]::abs($s) -gt $allowedDifferenceSeconds){         #print host and time difference in seconds         $row = "" | select HostName, Seconds
           
    $row.HostName = $_.Name
            $row.Seconds = $s
           
    $row
        }    
    else{         Write-Host "Time on" $_.Name "within allowed range"
        } }

    The vmhosts.txt file contains a hostname per line.



  • 41.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Oct 17, 2012 09:19 AM

    Thanks Lucd .

    I will test Out the script and feedback.

    Just a curious question : - the script is not asking for any authentication, so i beleive it will use logged in user credentials to connect to Esx hosts .



  • 42.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Oct 23, 2012 01:13 PM

    tested the script . I am getting below error ..

    PS D:\sushil> .\time.ps1

    The term 'get-view' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the sp

    elling of the name, or if a path was included, verify that the path is correct and try again.

    At D:\sushil\time.ps1:4 char:9

    + get-view <<<<  -ViewType HostSystem -Property Name, ConfigManager.DateTimeSystem -Filter @{"Name"=$esxnames} | %{

        + CategoryInfo          : ObjectNotFound: (get-view:String) [], CommandNotFoundException

        + FullyQualifiedErrorId : CommandNotFoundException

    Not sure where it went wrong...



  • 43.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Oct 23, 2012 01:32 PM

    Do you have the PowerCLI snapin installed ?

    Get-PSSnapin | Select Name,Version

    Do you see an entry that says VMware.VimAutomation.Core ?



  • 44.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Oct 23, 2012 02:48 PM

    No Below is the output...

    PS D:\> Get-PSSnapin | Select name,version

    Name                                                        Version
    ----                                                        -------
    Microsoft.PowerShell.Diagnostics                            1.0.0.0
    Microsoft.WSMan.Management                                  1.0.0.0
    Microsoft.PowerShell.Core                                   1.0.0.0
    Microsoft.PowerShell.Utility                                1.0.0.0
    Microsoft.PowerShell.Host                                   1.0.0.0
    Microsoft.PowerShell.Management                             1.0.0.0
    Microsoft.PowerShell.Security                               1.0.0.0


    PS D:\>

    Edit : - enabled the Plug in and I get a error "As unable to connect to Server" which is correct as i didn;t connect to VC server.



  • 45.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Oct 23, 2012 03:00 PM

    Excellent. Got the script to Run now and It compares the time with my loged in server and shows me output as time within range.

    I have bought down the tolerance limit to 2 sec and perfect.

    Just wondering why i am unable to give you point on the excellent help.



  • 46.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Oct 23, 2012 04:05 PM

    You can only give points when you start the thread.

    No problem, glad your problem got solved.



  • 47.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jul 09, 2013 12:22 AM

    I found a couple of cases where $dts = get-view $_.ConfigManager.DateTimeSystem needs to be refined.   It can occasionally return more than 1 value.

    For these cases I modified the line after that to read:

    $t = $dts[0].QueryDateTime()


    This makes sure that the subtraction operation only has a single value to work on.


    Here is the full copy of the version I'm using:


    Function CheckHostDateTime ( $testHost ) {

        #get host datetime system

        $dts = get-view $testHost.ExtensionData.configManager.DateTimeSystem

       

        #get host time (sometimes DateTimeSystem returns more than 1 value.  Only use the 1st one)

        $t = $dts[0].QueryDateTime()

      Write-Host "Time on " $testHost $t "(UTC)"

       

        #calculate time difference in seconds

        Try { $s = ( $t - [DateTime]::UtcNow).TotalSeconds

       

        #check if time difference is too much

       if([math]::abs($s) -gt $allowedDifferenceSeconds){

            #print host and time difference in seconds

            $row = "" | select HostName, Seconds

            $row.HostName = $testHost

            $row.Seconds = $s

           Write-Host "Time on" $testHost "outside allowed range"

            $row

          }

       else{

            Write-Host "Time on" $testHost "within allowed range"

          }

      }

      Catch { Debug-Output 0 "`$testHost: $testHost"

      Write-Debug "`$t: $t "

      $dts}

    }

    Function Debug-Output 

      {

       Param(

      [Parameter(Mandatory=$True,Position=1)]

      [ValidateRange(0,10)][int]$Level,

      [Parameter(Mandatory=$True,Position=2)]

      [string]$Message

      )

    #

    # Print Debug output

    #

      if ( $DebugFlag ) { if ($Level -le $DebugLevel ) {

      if ( ! $DebugBG ) {

      $a = (Get-Host).PrivateData

      $DebugFG = $a.DebugForegroundColor

      $DebugBG = $a.DebugBackgroundColor

      }

      Write-Host -ForegroundColor $DebugFG -BackgroundColor $DebugBG "Debug L${Level}($DebugLevel) $Message"

      # -WarningAction Continue -ErrorAction Continue

      $WhereFrom = $MyInvocation.ScriptName

      $WhereAt = $Myinvocation.ScriptLineNumber

      Write-Host -ForegroundColor $DebugFG -BackgroundColor $DebugBG "From: $WhereFrom Line: $WhereAt "

      }

      }

    }



  • 48.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jul 09, 2013 05:29 AM

    Aren't you getting multiple values returned because you are running in "Multiple" mode (see the Set-PowerCLIConfiguration cmdlet) ?

    Instead of doing $dts[0], it would perhaps be better to select 1 connection (and use the Server parameter).



  • 49.  RE: PowerCLI: Detect incorrect Time Configuration

    Posted Jul 09, 2013 05:44 AM

    Luc you are correct. I am using this in a context checking NTP settings across multiple datacenters and clusters.  Will have to try and see if that will still work with multiple mode off.