sg.exe发送给所有具有响应功能的用户

发布于 2025-02-14 01:32:00 字数 740 浏览 0 评论 0原文

我试图通过发送MSG并允许用户选择“是”或“否”来确定他们是否正在工作。我能够通过WSCRIPT进行此操作,但还没有找到通过MSG找到它的方法。我需要使用MSG的原因是因为它必须访问服务器上的所有用户。

$prompt = new-object -comobject wscript.shell 
$answer = $prompt.popup("Are you still working?  The shutdown was triggered and this server will shut down.  This message will expire in 30 seconds`n",30,"Idle Shutdown Triggered",0x4 + 0x20 + 0x1000)              
if($answer -eq 6) {"Yes You ARE!"}
if($answer -eq 7) {Invoke-WebRequest -Uri 'some api to stop the shutdown'-Method POST -Body $postParams}
if($answer -eq -1) {Invoke-WebRequest -Uri 'some api to stop the shutdown'-Method POST -Body $postParams}

我已经测试了msg * /w“ message” < /code>,并且提示可以工作,但是如果没有响应,我需要执行API URL或他们说“否”

I am trying to not log users off if they are still working by sending a msg and allowing the users to select "Yes" or "No". I am able to do this via wscript, but haven't found a way to do it via msg. The reason I need to use msg is because it has to go to all users on the server.

$prompt = new-object -comobject wscript.shell 
$answer = $prompt.popup("Are you still working?  The shutdown was triggered and this server will shut down.  This message will expire in 30 seconds`n",30,"Idle Shutdown Triggered",0x4 + 0x20 + 0x1000)              
if($answer -eq 6) {"Yes You ARE!"}
if($answer -eq 7) {Invoke-WebRequest -Uri 'some api to stop the shutdown'-Method POST -Body $postParams}
if($answer -eq -1) {Invoke-WebRequest -Uri 'some api to stop the shutdown'-Method POST -Body $postParams}

I have tested msg * /W "Message" and the prompt worked, but I need to execute the api url if no response or they say "No"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文