• SharePoint常用Powershell整理


    SharePoint问题排查

    案例1,邮件问题,邮件已在后台进行配置好,可是还是无法发送,所以需要知道无法发送的原因,可以通过查询ULS(Unified Logging System)

    对邮件发送日志中反馈的问题进行分析

    $SiteURL="https://sharepointtest.centos.com/"
    $Email = "Test@SharePoint.com"
    $Subject = "Test Email from SharePoint"
    $Body = "Test Email Body"
    #Get the Web
    $Web = Get-SPWeb $SiteURL
     
    #Send Email using SPUtility SendEmail method
    [Microsoft.SharePoint.Utilities.SPUtility]::SendEmail($Web ,0,1,$Email,$Subject,$Body)
    Get-SPLogEvent -StartTime "12/30/2021 15:32" -EndTime "12/31/2021 11:20" | Where-Object {$_.Category -eq "E-Mail"} |select Message |ft -wrap >>D:\Logs\1230.txt

    $EmailTo = "test@centos.com"
    $EmailSubject = "Test Email from SharePoint"
    $EmailBody = "Test Email Body"

    $SPGlobalAdmin = New-Object Microsoft.SharePoint.Administration.SPGlobalAdmin
    $SMTPServer = $SPGlobalAdmin.OutboundSmtpServer
    $EmailFrom = $SPGlobalAdmin.MailFromAddress

    Send-MailMessage -To $EmailTo -From $EmailFrom -Subject $EmailSubject -Body $EmailBody -BodyAsHtml -SmtpServer $SmtpServer -UseSsl

    #邮件发送
    $EmailTo = "test@centos.com"
    $EmailSubject = "Test Email from SharePoint"
    $EmailBody = "Test Email Body"

    $SMTPServer = "10.10.5.19"
    $SMTPServer = "mail.centos.com"
    $EmailFrom = "SharePoint@centos.com"

    #匿名
    Send-MailMessage -To $EmailTo -From $EmailFrom -Subject $EmailSubject -Body $EmailBody -BodyAsHtml -SmtpServer $SmtpServer -UseSsl
    #不匿名
    Send-MailMessage -To $EmailTo -From $EmailFrom -Subject $EmailSubject -Body $EmailBody -BodyAsHtml -SmtpServer $SmtpServer -Credential SharePoint.Notify@hengrui.com



    $SiteURL="https://sharepoint.sha.centos.com/"
    $Email = "test@hengrui.com"
    $Subject = "Test Email from SharePoint"
    $Body = "Test Email Body"

    #Get the Web
    $Web = Get-SPWeb $SiteURL

    #Send Email using SPUtility SendEmail method
    [Microsoft.SharePoint.Utilities.SPUtility]::SendEmail($Web ,0,1,$Email,$Subject,$Body)

    Set-ContentFilterConfig -BypassedSenders SharePoint.Notify@hengrui.com


    $SPGlobalAdmin = New-Object Microsoft.SharePoint.Administration.SPGlobalAdmin
    $SPGlobalAdmin.OutboundSmtpServer


    Get-MessageTrackingLog -Start "12/28/2021 09:00:00" -End "12/31/2021 17:00:00" -Sender "SharePoint@centos.com"


    $SiteURL="https://sharepointtest.centos.com/"
    $Email = "test@centos.com"
    $Subject = "Taomg Email from SharePoint"
    $Body = "Taomg Email Body"

    #Get the Web
    $Web = Get-SPWeb $SiteURL

    #Send Email using SPUtility SendEmail method
    [Microsoft.SharePoint.Utilities.SPUtility]::SendEmail($Web ,0,1,$Email,$Subject,$Body)


    Get-SPLogEvent -StartTime "12/30/2021 15:00" -EndTime "12/31/2021 11:20" | Where-Object {$_.Category -eq "E-Mail"} |select Message |ft -wrap >>D:\Logs\zhengshi.txt

  • 相关阅读:
    Prism之12345
    Struts2注解学习1
    模拟Spring依赖注入
    Spring的IOC注解学习
    Hibernate注解学习1
    Redis源码分析(二十六) slowLog和hyperloglog
    做优秀产品经理所需的7种素质
    程序员学习英语
    PL/SQL Developer记住密码设置
    oracle11g,安装及net Manager的配置
  • 原文地址:https://www.cnblogs.com/life512/p/15749029.html
Copyright © 2020-2023  润新知