如何使用gpo阻止工作站

如何使用gpo阻止工作站

本文介绍了如何使用gpo阻止工作站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dears, good morning.

I developed a Windows Form application in Visual Studio (C#) that aims to lock the employees workstation that is logged into the machine by Windows.

This application is running on the employee machine via Group Policy (GPO).

Running the program locally, the code below works, but when I run via the GPO, it does not work.

Process.Start ("rundll32.exe", "user32.dll, LockWorkStation");

The only thing that worked so far was the commands:

* Application.SetSuspendState (PowerState.Hibernate, true, true); // puts the machine into hibernation
* Application.SetSuspendState (PowerState.Suspend, true, true); // set the machine to standby

I need to lock the workstation. Anyone have any idea how to solve it?





我尝试过:





What I have tried:

I tried the following codes too, but nothing worked:

* Process.Start ("rundll32.exe", "user32.dll, LockWorkStation");
* WindowsIdentity.GetCurrent (). User;
* WindowsIdentity.GetCurrent (). Groups.Translate (GetUsuario (Name));
* WindowsIdentity.GetCurrent ().Groups.Translate(GetType (NTAccount)).ToString()

推荐答案


这篇关于如何使用gpo阻止工作站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 15:16