Disable New Logons Until Restart

Microsoft.Windows.Server.10.0.RemoteDesktopServicesRole.Service.RDSessionHost.LogonDrainUntilRestart (Task)

This task will disable new user logons until the server is restarted by running the Change Logon /DrainUntilRestart command.

Element properties:

TargetMicrosoft.Windows.Server.10.0.RemoteDesktopServicesRole.Service.RDSessionHost
AccessibilityPublic
CategoryMaintenance
EnabledTrue
RemotableFalse
Timeout300

Member Modules:

ID Module Type TypeId RunAs 
WA WriteAction System.CommandExecuter Default

Source Code:

<Task ID="Microsoft.Windows.Server.10.0.RemoteDesktopServicesRole.Service.RDSessionHost.LogonDrainUntilRestart" Accessibility="Public" Enabled="true" Target="Microsoft.Windows.Server.10.0.RemoteDesktopServicesRole.Service.RDSessionHost" Timeout="300" Remotable="true">
<Category>Maintenance</Category>
<WriteAction ID="WA" TypeID="System!System.CommandExecuter">
<ApplicationName>%SystemRoot%\System32\Change.exe</ApplicationName>
<WorkingDirectory>%SYSTEMROOT%\temp</WorkingDirectory>
<CommandLine>LOGON /DRAINUNTILRESTART</CommandLine>
<TimeoutSeconds>300</TimeoutSeconds>
<RequireOutput>true</RequireOutput>
<Files/>
</WriteAction>
</Task>