Incorrect time on servers, How to pass local time of Controller to Citrix server

Welcome Forums General PowerShell Q&A Incorrect time on servers, How to pass local time of Controller to Citrix server

This topic contains 4 replies, has 3 voices, and was last updated by

 
Participant
4 months ago.

  • Author
    Posts
  • #130553

    Participant
    Points: 4
    Rank: Member

    I have a few hundred servers in my Citrix farm, The time is incorrect, I want to run a command and find the time difference between my Controller and the remote servers.

    I am unable to pass the (get-date) value using invoke-command to Citrix servers.

    Is there any other way to get the time difference, I am not interested in TIME ZONE, since the timezone is CST, but they have EST time on them

  • #130560

    Participant
    Points: 639
    Helping Hand
    Rank: Major Contributor

    I am unable to pass the (get-date) value using invoke-command to Citrix servers.

    Use -ArgumentList or the using: keyword

    https://kevinmarquette.github.io/2016-08-28-PowerShell-variables-to-remote-commands/

    • #130569

      Participant
      Points: 4
      Rank: Member

      Rob,

      Thanks for the answeer. I do know that we can use -ArgumentList for passing parameters to ICM

      My question is " why does the below function give me local time rather than remove time when  I use via icm"

      function t-value{
      $ht=@{}
      $cname = $env:computername
      $tvalue = get-date -f 'g'
      $ht[$cname] = $tvalue
      $ht
      }

  • #130575

    Participant
    Points: 380
    Helping Hand
    Rank: Contributor

    If the time is incorrect it sounds like either you're not using NTP or the NTP source is misconfigured.
    If not using any NTP sync then the servers will drift over time as the onboard clocks are not that great.

    w32tm.exe /stripchart /dataonly /computer:time.google.com /samples:1
    

    Will give you the time difference against the NTP source time.google.com.
    Just replace with whatever source you're using in your organisation.

  • #130583

    Participant
    Points: 639
    Helping Hand
    Rank: Major Contributor

    Try WMI to get the time. Get-Date should be displaying the local time on that server, but I've had Get-Date automatically convert UTC\GMT to local time on me before. Your not really explaining how the remote servers are configured. Are you seeing the time off by 20 minutes? Are you seeing that the date is in EST on the server but is converted to PST?

    Parsing remote machine local date and time with WMI

The topic ‘Incorrect time on servers, How to pass local time of Controller to Citrix server’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort