Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $pc = Read-Host "Enter the remote computer name to disable secure desktop";
- Invoke-Command -ComputerName $pc -Scriptblock {
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Value 0 -Force;
- };
- $remoteAssist = "$Env:windir\system32\quickassist.exe";
- Start-Process $remoteAssist -Wait;
- Write-Host "Your Remote assist session has ended" -ForegroundColor Red;
- Invoke-Command -ComputerName $pc -Scriptblock {
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Value 1 -Force;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement