Advertisement
guyrleech

Get time for Citrix VDA to register from boot

Mar 10th, 2021
1,673
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $OS = Get-CimInstance -ClassName Win32_OperatingSystem
  2. ## Find the "The Citrix Desktop Service successfully registered with delivery controller ..." event
  3. if( $OS -and ( $registered = Get-WinEvent -Oldest -FilterHashtable @{ 'ProviderName' = 'Citrix Desktop Service' ; id = 1012 ; starttime = $OS.LastBootUpTime} -ErrorAction SilentlyContinue | Select-Object -First 1 ) )
  4. {
  5.     New-TimeSpan -Start $OS.LastBootUpTime -End $registered.TimeCreated
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement