In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
#
# Author:Young, time: January 2018 # Email:azhe.911@foxmail.combr/ > # Email:azhe.911@foxmail.com
# Version:1.3
#
# Import active Directory powershell module
Import-Module Activedirectory
# current time
$TodayDate=Get-Date
# View the Samaccountname of all accounts in the specified OU
$Userlist=Get-ADUser-SearchBase "ou=test,dc=outlook,dc=com"-Filter * |% {$_ .Samsprintname}
# # #
# cycle to detect accounts that meet the Samaccountname,AccountExpirationDate,Manager attribute
# # #
Foreach ($user in $Userlist) {
$AccountExpirationDat=Get-ADUser $user-Properties Samaccountname,AccountExpirationDate,Manager,Enabled
# days from the expiration of the account
$expire_days= ($AccountExpirationDat.AccountExpirationDate-$TodayDate). Days
# the assignment is the email address of the public mail manager
$Manager= (Get-ADUser $AccountExpirationDat.Manager). UserPrincipalName
# the assignment is the name of the public mail manager $ManagerName= (Get-ADUser $AccountExpirationDat.Manager). The name # assigned to the public mail is $NameUser= (Get-ADUser $AccountExpirationDat.Samaccountname). Name
# retrieve those that contain the expiration time of the account and have the attribute of the manager (here it is worth the assignment of the manager in the organization in the attribute of the public mail account)
If ($AccountExpirationDat.AccountExpirationDate-and $AccountExpirationDat.Manager-and $expire_days-ge 0-and $expire_days-le 15-and $AccountExpirationDat.Enabled-eq "True")
{
# verify the output accounts # $AccountExpirationDat# email body $Emailbady= "Hello, $ManagerName:
Your $NameUser public email account and $expire_days account will expire in a few days. Your account will be disabled after $expire_days days, which will affect the normal use of your public mailbox account. Please contact the help desk 010-10100120 as soon as possible to apply for the continued use of your public mailbox. Beijing xxxx Brokerage Co., Ltd. IT Department
"# represents the space IT Department this is to adjust the font size and color IT Department is to bold the font # send email to the public mail manager (manager) to notify Send-MailMessage-From" zhangsan@outlook.com "- to" $manager "- Subject" your public mailbox account is about to expire "- BodyAsHtml $Emailbady-SmtpServer mail.outlook.com-Encoding ([System.Text.Encoding]:: UTF8)}
# retrieve expired public mailbox accounts and send email notifications
Elseif ($AccountExpirationDat.AccountExpirationDate-and $AccountExpirationDat.Manager-and $expire_days-lt 0-and $AccountExpirationDat.Enabled-eq "True")
{
# verify the output accounts # $AccountExpirationDat# email body $Emailbady= "Hello, $ManagerName:
Your $NameUser public email account has expired $expire_days days. Your public mailbox account has been disabled, please confirm whether it still needs to be used, please contact the help desk 010-110101010 as soon as possible, if you need to continue to use, please submit an application for continued use, if the public mailbox is no longer in use, please submit an application to delete the account. Beijing xxxx Brokerage Co., Ltd. IT Department
"# represents the space IT Department this is to adjust the font size and color IT Department is to bold the font # send email to the public mail manager (manager) to notify Send-MailMessage-From" zhangsan@outlook.com "- to" $manager "- Subject" your public mailbox account has expired "- BodyAsHtml $Emailbady-SmtpServer mail.outlook.com-Encoding ([System.Text.Encoding]:: UTF8)}
}
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.