Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2021
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. $pc = Read-Host "Enter the remote computer name to disable secure desktop";
  2.  
  3. Invoke-Command -ComputerName $pc -Scriptblock {
  4. Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Value 0 -Force;
  5. };
  6.  
  7. $remoteAssist = "$Env:windir\system32\quickassist.exe";
  8. Start-Process $remoteAssist -Wait;
  9. Write-Host "Your Remote assist session has ended" -ForegroundColor Red;
  10.  
  11. Invoke-Command -ComputerName $pc -Scriptblock {
  12. Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Value 1 -Force;
  13. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement