sg.exe发送给所有具有响应功能的用户
我试图通过发送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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论