清除MSMQ队列,并从一个bat文件重置IIS [英] Purge MSMQ queue and reset IIS from a bat file

查看:171
本文介绍了清除MSMQ队列,并从一个bat文件重置IIS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能从一个bat文件清除一个MSMQ队列?

Is it possible to purge a msmq queue from a bat file?

基本上我想打一个bat文件,或者至少东西快速和容易使未受过训练的员工可以点击并在不知道任何壳或管理工具修复

Essentially I want to make a bat file or at least something quick and easy so that an untrained employee can click and fix without knowing any shell or admin tools

可能有人请帮助我在正确的方向?

Could someone please help me in the right direction?

推荐答案

就以 MSMQAdm工具

通过实用程序管理任务包括以下内容:

Tasks administered through the utility programs include the following:


  • 浏览本地队列

  • 清除的消息

  • 删除个人信息

  • 停止和启动MSMQ服务

  • 连接,并从网络上断开

不要忘了PowerShell中,采取看看PowerShell的社区扩展

Don't forget about powershell, take a look on PowerShell Community Extensions

更新

打开PowerShell和一行行写

Open powershell and write line by line

[Reflection.Assembly]::LoadWithPartialName("System.Messaging")
$queueName = '.\Private$\testQueue'
$queue = new-object -TypeName System.Messaging.MessageQueue -ArgumentList $queueName
$queue.Purge()

从调用CMD的PowerShell

Call powershell from cmd


  1. 创建TXT文件。

  2. 将所有行

  3. 在PS1更改文件扩展名

这是CMD最简单的方法调用的脚本。

The easiest way call script from cmd.

powershell.exe -ExecutionPolicy无限制C:\\ purgemsmq.ps1

powershell.exe -executionpolicy Unrestricted C:\purgemsmq.ps1

这篇关于清除MSMQ队列,并从一个bat文件重置IIS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆