Can't Log Out of Windows Server 2008 - windows-server-2008-r2

I'm currently logged into my Windows Server 2008 R2 (x64) server, using Remote Desktop. As soon as I clicked on Start -> Log Out, this message popped up:
The message says:
"Waiting for all snap-ins to complete..."
There's a second dialog box in the background that says:
MMC cannot initialize the snap-in.
Now I can't log out and I can't bring up task manager. I can hit ctrl-alt-del and then click Task Manager, I can right-click the task bar and click Start Task Manager, and I can click the start menu and click Log Out, but none of those do anything. I also can't click the OK button that is shown in the screenshot.
This is a live web server, so I don't want to try restarting the server.
I can just disconnect from Remote Desktop, but these dialog boxes are still shown when I log back in later.
Any ideas? Do I just need to wait until the middle of the night and restart the server?

Try from the command prompt shutdown /l
C:\Users\User>shutdown /?
Usage: shutdown [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]
[/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]]
No args Display help. This is the same as typing /?.
/? Display help. This is the same as not typing any options.
/i Display the graphical user interface (GUI).
This must be the first option.
/l Log off. This cannot be used with /m or /d options.
/s Shutdown the computer.
/r Shutdown and restart the computer.
/g Shutdown and restart the computer. After the system is
rebooted, restart any registered applications.
/a Abort a system shutdown.
This can only be used during the time-out period.
/p Turn off the local computer with no time-out or warning.
Can be used with /d and /f options.
/h Hibernate the local computer.
Can be used with the /f option.
/e Document the reason for an unexpected shutdown of a computer.
/m \\computer Specify the target computer.
/t xxx Set the time-out period before shutdown to xxx seconds.
The valid range is 0-315360000 (10 years), with a default of 30.
If the timeout period is greater than 0, the /f parameter is
implied.
/c "comment" Comment on the reason for the restart or shutdown.
Maximum of 512 characters allowed.
/f Force running applications to close without forewarning users.
The /f parameter is implied when a value greater than 0 is
specified for the /t parameter.
/d [p|u:]xx:yy Provide the reason for the restart or shutdown.
p indicates that the restart or shutdown is planned.
u indicates that the reason is user defined.
If neither p nor u is specified the restart or shutdown is
unplanned.
xx is the major reason number (positive integer less than 256).
yy is the minor reason number (positive integer less than 65536).

I know this is an old question but I ran into the same issue today. Following on from CrazyDart's comment...
On the server (no need to remote to another server on the network) go to Administrator Tools -> Remote Desktop -> Remote Desktop Services Manager, select the server, right click your user name from the list and select log-off.
I was also unable to open Task Manager or Command Prompt (unless I ran as administrator, in which the shutdown /l command simply did nothing).
Thanks to CrazyDart for this one. I'd up vote you, but I can't seem to do it for comments...

When I originally posted this question, I had completely forgotten that I have PCMonitor installed on the server and one of the options it gives me is to use my phone to see logged in users and to log them out.
As soon as I sent the command to log out my user, my Remote Desktop session ended, and then when I logged back in the MMC dialog boxes were finally gone.
Sorry it's not a better answer for anyone that doesn't have an app like that installed.

Related

Pyautogui on RDP

I am using pyautogui in Windows 10 with Python 3, in a virtual machine accessed by remote desktop.
Unfortunately, the program stops execution when I close remote connection, giving "OSError: screen grab failed".
I've searched for a solution online, but the only workaround that I've found is from this link
Use a remote desktop client that allows you to keep outputting the display, even if you minimise the window/close your PC. I used terminals (https://terminals.codeplex.com/ - not affiliated with them at all just recommending as it solved this issue for me).You can set this up to persist the display, and your code should then run fine.
The problem is that I can't find a setting for persisting display. I've also found this:
pyautogui._pyautogui_x11._display = Xlib.display.Display(
os.environ['DISPLAY']
)
... but it doesn't seems to work either (gives me errors...).
Do you have some workaround to do the trick?
Based on an answer from here:
when you disconnect from RDP, Windows lock the computer and does not render the screen any more so any automation apps which needs GUI fails to work.
To disconnect from RDP without losing the screen you can disconnect using following commands as administrator (its better to make a bat file and run that file as administrator when you need to disconnect from RDP):
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
%windir%\System32\tscon.exe %%s /dest:console )
I have resolved using TightVNC instead of remote desktop and detaching mouse cursor.

CredSSP Encryption Oracle Remediation Error

Hello we are using Azure Virtural Machine. Now We cannot remote into the server due to the following error message. Would like to get suggestion on the error since we don't have the support plan and the live agent suggest me to ask here.
Thanks all.
Error Message Image
So I resolved the issue temporarily. Follow these steps on your local computer (not on server)
Note : The below steps are not recommended by Microsoft. So follow these steps just to login to your machine and do necessary updates. Once it's done, revert the configuration changes
1 . Go to "Administrative Templates" (type /search it directly on window)
Please see above image.
Right click and edit Encryption Oracle Remediation.
Make it enabled, and change protection level to "vulnerable"
Click on Apply and close window.
Try to connect to VM. And after establishing a connection, update the VM if there's any pending updates
For a fast workaround that doesn't involve any server side changes just type the following in a console with administrator privileges
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters" /f /v AllowEncryptionOracle /t REG_DWORD /d 2
I didn't have permission (human permission) to make any change to the server so this was a perfect solution for me
Easiest solution for me was to download remote desktop app on my phone and connect to remote server. Install windows updates on remote server and I was able to connect again from my pc
Login into https://portal.azure.com
Navigate to the Azure Virtual Machine tab and go to the VM that is giving this error
Now under operations, select the Run Command option which will give you the option to run a PowerShell script
In the PowerShell script section, type in the below two lines and click on run
REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters\ /v AllowEncryptionOracle /t REG_DWORD /d 2
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters' -name "AllowEncryptionOracle" 2 -Type DWord
Now on your own machine (client machine), follow the below steps:
On the client that has the CredSSP update installed, run gpedit.msc, and then browse to Computer Configuration > Administrative Templates > System > Credentials Delegation in the navigation pane.
Change the Encryption Oracle Remediation policy to Enabled, and then change Protection Level to Vulnerable.
If needed, please restart the server and now when you try to RDP into your Azure VM you will be able to login and complete the connection. Please note that it is highly recommended to patch your VMs and follow the latest guidelines that are mentioned in the Microsoft Support Article or blog
This issue can be resolved, just use this below command
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters" /f /v AllowEncryptionOracle /t REG_DWORD /d 2
I had the same issue. My server didn't have the option.
Encryption Oracle Remediation
But I solved it by unchecking
Allow connections only from computers with network level authentication
under system properties as shown in figure.

Wrong time in the Windows on dual-boot PC (Winwows/Linux)

On my PC I use two operation systems Windows 8 and Ubuntu 14.04. I noticed that after booting Linux and then rebooting to Windows, Windows show the wrong time (Windows clock is 2 hours behind).
I checked in the Linux - time is correct.
I checked time settings - both OS have UTC+2 time zone and option to set time from the Internet.
If I correct time in Windows and do not boot Linux everything is O.K. But at list single loading Linux makes time shift.
I have tried to remove the option for setting time from the Internet.
But manual time setting option changed nothing. What should be done to see the same time in the both operating systems?
That's very popular problem.
All you need to do (and that's really the rightest way) is to say Windows that you hardware time is UTC.
To do it just add the following DWORD key to the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal
and set its value to 1.
Also you can youse QWORD key instead of DWORD if you have 64bit Windows. But, as far as I know, it's not necessary.
The simplest solution is to set time zone UTC (London) in Linux.
I faced a similar problem, and my solution is quite simple without changing any configs of your operating system.
Requirements: Need to have a internet connection for time sync. Have admin privileges.
You need to enable windows time service
Go to services by typing in the search bar.
Open services
Search for windows time service (W32Time)
W32Time Service
Change the Startup Type to Automatic
Change Startup type
Creating a small bat script file
Open Notepad and create a file with the following command.
w32tm /resync
Save it anywhere with .bat extension. (Remember its location)
Schedule a task
Go to Task Scheduler by typing it in the search bar
Open Task Scheduler
Right click on the empty space > create new task
Create New Task
Give your task a name and description
Change "When running the task, use the following user account" to any admin user or admin group account.
Select "Run whether user is logged on or not"
Check the box for "Run with highest privileges"
Check the box for "Hidden" and "Configure for" = Windows 10
Go to Triggers tab, add the following triggers by clicking on "New..."
First Trigger
"Begin the task:" Select "At startup"
In Advanced settings, check the box for Enabled
Second Trigger
"Begin the task:" Select "At log on"
"Settings" Select "Any user"
In Advanced settings, check the box for Enabled
Go to Actions tab, create a new action by clicking on New...
"Action:" Select "Start a program"
In "Program/script" browse and select the file you created earlier.
And then click OK
Go to Conditions tab
Check the box "Start only if the following network connection is available"
Select your internet network or you can select "any connection" as wild card.
Go to Settings tab.
Check "Allow task to be run on demand"
Check "Run task as soon as possible ..."
Check "If the task fails, restart every" select "1 minute", "Attempts to restart up to:" 3 times
Check "Stop the task if runs longer than:" 3 Days
Check "If the running task does not end when requested, force it to stop"
"If the task is already running, then the following rule applies:"
Select "Do not start a new instance"
I had the same problem recently. My solution is:
First make sure you have the correct time zone
Set BIOS time to local time.
In Linux, edit /etc/default/rcS by replacing UTC=yes with UTC=no.
Reboot.

Web Deploy Fails with ERROR_EXCEEDED_MAX_SITE_CONNECTIONS

When I deploy my solution (DNN solution) from Visual Studio using Web Deploy, I get success for a few files (averaging 30) then I get the error:
Error 102 Web deployment task failed. (The maximum number of connections for this site has been exceeded. Learn more at: h**p://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXCEEDED_MAX_SITE_CONNECTIONS.) 0 0 h**p://mylocalhostwebsite/mywebsitename/"
I read everything I could get on the and was not able to find a solution that works.
I run my own dedicated server on Windows 2012 (on windows azure). My dev environment runs on Windows 8, and I am deploying using VS.NET 2013 Ultimate
The server is clean, has only one website and it's not even life (no one is hitting the server except me, the one and only developer)
Once this error occurs, web deploy would fail with the same error continuously (no more 30 files or so)...all up until I restart the server.
I check the web server, and all seems to be intact...
I am not deploying the database as part of the process
I had the same problem with an IIS in Windows Server 2012 R2.
I've solved it using this post
UPDATE
Go to the IIS Server
Select your IIS Server, in the Features View, select Management Service
Under Actions, click Restart.
So I've restarted the server and worked fine...
I tried searching everywhere for why this was happening, but am yet to find an answer. When it happened, the quickest way to be able to publish again was to kill the WMSVC process and start it again. To reduce having to do this manually, I kill the WMSVC process everyday at midnight, using a batch file and Windows Task Scheduler.
ECHO OFF
for /f "tokens=2 delims=," %%B in ('tasklist /fi "Imagename eq wmsvc.exe" /fo csv') do #echo %%B >processkill.txt
set /p taskid=<processkill.txt
TASKKILL /f /pid %taskid%
exit
This creates a text file in the same location as the batch file you're running with the process ID of the WMSVC process, and then kills it. Make sure to have the process set to automatic start.
Furthermore, I am investigating whether this will be a more permanent fix - adding the following to the registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\3]
"MaxSiteConnections"=dword:00000010

Group policy in RDP connections

So I've backed myself into a corner - I wanted an application or command to run when a user logged in over RDP to a server. As per a best-practice suggestion on a Microsoft site, I set up this program to run under group policy rules and now I have a dilemma:
I log into my server via RDP, the default program launches and then immediately logs me out without a chance for me to do anything.
How can I get into the box again to change this setting? Server is Windows 2008 r2 with terminal services installed on a remote IP.
Could you just remove\edit the GPO, wait a bit, and then reboot the server? You could still send it the "shutdown /m \computername". You could also use psexec to remotely run "gpupdate /force" before rebooting.
If you set that up as local group policy, then you can try opening mmc, choosing the Group Policy editor, and pointing it to that machine to edit the policies. In more detail:
Start --> Run --> mmc
File --> Add/Remove Snap-in
Under the Standalone tab, click Add...
Choose Group Policy Object Editor
In the following wizard, click the Browse button
Click the "Computers" tab, select the Another computer radial button, and type the name or Browse to the remote computer
Click OK, then Finish, then Close, and finally OK
Also you could maybe edit/add a logon script that runs "shutdown -a" to abort logoff/shutdowns, but that may not work due to timing.
You didn't mention if this was Domain, or local, but those options should take care of either.

Resources