Advertisement
Guest User

job

a guest
Jan 13th, 2015
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $citrixsession = New-PSSession ServerName -Credential $ADMSCredential
  2. Invoke-Command -Session $citrixsession -ScriptBlock { add-pssnapin Citrix.XenApp.Commands }
  3.  
  4. $Job = Invoke-Command -Session $citrixsession -ScriptBlock { Get-XASession -account "domain\$($args[0])" -full | Select-Object -Property SessionID,ServerName,AccountName,State } -argumentlist $global:UInit -AsJob
  5.  
  6. Wait-Job $Job -Timeout 5 | Out-Null
  7.  
  8. If ($Job.State -eq "completed") {
  9.  
  10. }
  11. Else {
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement