随笔 - 69,  文章 - 3,  评论 - 8,  阅读 - 49091

查询账号:

搜索安全日志,寻找锁定源

点击查看代码
$properties = @(
'TimeCreated',
@{n='Account Name';e={$_.Properties[0].Value}},
@{n='Caller Computer Name';e={$_.Properties[1].Value}}
)
$LockoutSource = Get-WinEvent -MaxEvents 1 -FilterHashTable @{LogName='Security'; ID=4740} | Select $properties | Format-Table -AutoSize -Wrap | Out-String
#SMTP发信验证,$anonUser 为发邮箱账户,anonPass 为发邮件账户密码
$AnonUser="账号"
$AonPass=ConvertTo-SecureString "XwETL5)8u%u2dL$" -AsPlainText -Force
$AonCred=New-Object System.Management.Automation.PSCredential($AnonUser,$AonPass)
#仅通知合肥EUS
Send-Mailmessage -from  "发件人邮箱账号" -to "收件人" -Body $LockoutSource -Subject "域账号锁定通知" -smtpserver 邮箱服务器  -Credential $AonCred -Encoding ([System.Text.Encoding]::UTF8)
posted on   vmsky  阅读(201)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· .NET Core 中如何实现缓存的预热?
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示