locked
Poweshell script RRS feed

  • Question

  • I have a script to get the status of the Virtual Desktop.

    it's can get three item:

    • HostMachinName
    • RegistrationState
    • SessionState

    Now, I want to write a conditional statement use if

    if (RegistrationState -eq "Unregistered" or SessionState -eq "Disconnected") {
    Restart-Computer -Force -ComputerName "HostedMachineName"
    }
    else {
    pass
    }

    What do I do?



    • Edited by as900 Tuesday, June 2, 2020 8:50 AM
    Tuesday, June 2, 2020 8:50 AM