Warning: Undefined array key "cperpage" in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 255

Warning: Undefined variable $output in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 325

Warning: Undefined variable $fixed_tags in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 326

Warning: Undefined variable $isshowdots in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 327

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 330

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 333

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 336

Warning: Undefined variable $post in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Attempt to read property "ID" on null in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Undefined variable $post in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Attempt to read property "ID" on null in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Undefined variable $more_text_link in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345
WIndows – 理想社会

分类: WIndows

  • Exchange2010/2013/2016删除指定主题邮件

    说到Exchange服务,大家并不陌生了,但是作为一个Exchange管理员的话,随时都在学习中,近期有个问题,用户发错邮件了,说能不能把用户收到的主题邮件进行删除,所以就同意帮用户删除指定主题的邮件了,具体操作见下:

    在Exchange中我们可以使用search-mailbox命令在邮箱中就行搜索然后再次删除的操作可以实现邮件的关键性搜索及删除操作。在操作前,我们需要明确的是删除指定用户的主题邮件还是组织中的所有用户的主题邮件,当然不管哪种方式操作方法都是一样的,只是命令稍微不一样而已;但是在操作之前我们需要注意的是,只有管理员用户有以下权限才可以对 用户邮箱中搜搜及删除邮件:

    邮箱搜索:利用此角色,您可以跨组织中的多个邮箱搜索邮件。默认情况下不会向管理员分配此角色。要向自己分配此角色以便搜索邮箱,请将您自己添加为“发现管理”角色组的成员。

    邮箱导入导出: 此角色允许您从用户邮箱删除邮件。默认情况下,不向任何角色组分配此角色。若要从用户邮箱删除邮件,您可以将“邮箱导入导出”角色添加到“组织管理”角色组。

    1.管理员本身需要加入organization Management, Domain admins, Enterprise admins, Schema admins;

    2.此外,把管理员加到 “Discovery Management”组;

    3.再给管理员加额外权限:

    New-ManagementRoleAssignment -Role “Mailbox Import Export” -User “admin账号”

    注意如果我们不赋予权限的话,执行的话会提示没有相关的命令:

    我们 按照提示,需要运行search-mailbox命令,但是我们发现提示没有searh-mailbox这个命令,运行这个命令前需要添加一个mailbox import export权限

    New-ManagementRoleAssignment –Role “Mailbox Import Export” –User ixmsoft\administrator

    添加权限后,然后再把命令提示符关闭,重新打开运行命令就可以了。

    此示例将搜索组织的所有邮箱,查找主题行为“下载此文件”邮件,然后将其永久删除。

    Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery ‘Subject:”Download this file”‘ -DeleteContent

    当然如果要删除指定用户的主题邮件的话,我们只需以下命令即可

    Search-Mailbox -Identity “gaowenlong” -SearchQuery ‘Subject:”Download this file”‘ -DeleteContent

    本文转自 高文龙 51CTO博客,原文链接:http://blog.51cto.com/gaowenlong/1742046,如需转载请自行联系原作者

    针对所有邮箱:

     

    
    
    Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"标题内容"' –DeleteContent
    
    

     

    针对单个邮箱:

    
    

     

    Search-Mailbox -Identity “单个邮箱的名字” -SearchQuery ‘Subject:”标题内容“‘ –DeleteContent

    
    

     

    针对通讯组:

    
    

     

    Get-DistributiongroupMember <通讯组名字> | Search-Mailbox -SearchQuery ‘Subject:”标题内容“‘ -DeleteContent -Force:$TRUE

     

     

  • WinRAR批量解压子目录下的压缩包

    @echo off
    for /r . %%a in (*.zip) do (
    cd “%%~pa”
    “C:\Program Files\WinRAR\WinRAR.exe” e “%%a”
    del “%%a”
    )

  • Exchange2010/2013 Send Welcome Email to New Mailbox / New Users

    Let’s understand how to configure Exchange Server to send welcome email:

    What is Cmdlet Extension Agents?

    Cmdlet extension agents are components in Microsoft Exchange Server 2013/Exchange Server 2010 invoked by Exchange 2013/2010 cmdlets when the cmdlets run. Every time an Exchange cmdlet is run, the cmdlet calls the Scripting Agent cmdlet extension agent. When this agent is called, the cmdlet checks whether any scripts are configured to be called by the cmdlet. If a script should be run for a cmdlet, the cmdlet tries to call any APIs defined in the script. Cmdlet extension agents are available on any server role.

    Implementation:

    As you got an idea on the Cmdlet Extension Agent, I will go ahead and explain how we can use the feature to generate welcome email for the new mailboxes that we create.

    When we create new mailbox in Exchange 2010/2013,  new-mailbox command is used (whether it is Exchange Management Shell or Exchange Management Console). You can enhance the behavior of the command by using Cmdlet Extension. It is like triggering a script whenever new-mailbox command is used.

    In order to use the feature, we need to,

    –          Deploy XML file on all the exchange servers.

    –          Enable “Scripting Agent”.

     

    How to deploy XML files?

    On all the exchange servers, the exchange setup copies the file “ScriptingAgentConfig.xml.sample” to <installation path>\Bin\CmdletExtensionAgents\.  The file is a kind of sample/template. We can modify the file to meet our requirement or we can make our own XML file. I have detailed the steps to modify the sample file to send welcome email.

    Note: The sample XML contains other feature blocks. If you are appending the below steps as it is without making changes to other feature blocks, you may receive unexpected warning while create new mailbox. If you are not using cmdlet-extension sample file for any other purpose/tasks, I would suggest you keep only the Welcome Email Feature block as it is in XML file provided in the attached zip file.

    Step #1:

    Create a welcome email template in html format that will be sent as welcome email or use the exiting template attached to the blog to suit your requirement. Easiest way to create welcome email template would be, open new message in Outlook, compose the email and save it as HTML. 

    Step #2:

    Make a copy of the existing XML file and rename it to ScriptingAgentConfig.xml. Keep the file in <installation path>\Bin\CmdletExtensionAgents\.

    Step #3:

    Replace the following content:

    1. $tempmsg= [string] (get-content (“c:\welcome\WelcomeMSG.htm“))
    2. $HUBServer=”20.1.1.2
    3. $WelcomeEMail.From=administrator@e2k10.com
    4. $WelcomeEMail.Subject=”Welcome to Contoso IT !!!

    How to manage/enable Cmdlet Extension Agent?

    After the XML file updated with script, you need to enable the agent to call the XML file and the script whenever new-mailbox used. You can view the agent status by running the command:

    Get-CmdletExtensionAgent | FT Name,Enabled

    By default,“Scripting Agent” is disabled. You can enable it using the command,

    Enable-CmdletExtensionAgent “Scripting Agent”

    When you wanted to disable the “Scripting Agent” , run the command ,

    Disable-CmdletExtensionAgent “Scripting Agent”

    Enabling or disabling CmdletExtension does not require restart of the server or exchange services in a normal scenario. It is a global command and applicable to all the exchange servers in the organization. So you have to update the XML file on all the exchange servers. If the XML files is not updated on any of the exchange server and you run any non-Get cmdlets, the cmdlet will fail.

    Downlod: WelcomeMSG

    Related articles :

    https://gallery.technet.microsoft.com/office/Send-Welcome-Email-to-New-88cde35c

    http://blog.51cto.com/johnsonchen/1860377

  • 运行时错误429:ActiveX部件不能创建对象的解决办法

    运行时错误429:ActiveX部件不能创建对象的解决办法

    同事使用cpc时出现,运行时错误429:ActiveX部件不能创建对象的错误。

    该问题的产生,可能是卸载其他软件时系统相关的DLL被反注册掉了。

    问题截图:

    QQ截图20160613120736

    解决办法:

    开始→运行→cmd,然后回车。输入for %1 in (%windir%\system32\*.dll) do regsvr32 /s %1

    等系统处理完之后,看看问题是否解决了 :D