I am new to this topic and I want to know how to remotely disconnect a users session from powercli
Use the Disconnect-VIServer cmdlet
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you for answering so quickly. I don't have good English, but could you give me an example? I need is to close or disconnect the session of a specific user. How would you do it? I am used Horizon.
In that case you could do something like this
$userName = 'domain\user'
$sessMgr = Get-View SessionManager
$sessions = $sessMgr.SessionList |
where{$_.UserName -eq $userName -and $_.UserAgent -match 'PowerCLI' -and $_.Key -ne $sessMgr.CurrentSession.Key} |
Select-Object -ExpandProperty Key
$sessMgr.TerminateSession($sessions)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for your answer, but it is for Vcenter, not Horizon.
What would it be like for Horizon?
It would have been handy if you mentioned that from the start.
In any case, have a look at Need script to log off all sessions for particular... - VMware Technology Network VMTN
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hello again. Please, I need to know how to disconnect a user's session by powercli with Horizon 7.6.
Grateful.