开启DNS调试日志,记录DNS查询日志 当文件达到20M后,会自动重写新日志DNS Deug Log,使用如下脚本进行分析脚本:############################################################################# # This cmdlet parses a Windows DNS Debug log. S
1.网站-高级设置,启用预加载 2.应用程序池,启动模式设置为 AlwaysRunning3.站点-配置编辑器,doAppInitAfterRestart设置为True添加集合:initializationPage设置为 /home
Add-PSSnapin microsoft.exchange* $Subject = '警惕“退税”钓鱼邮件' $From = "it@yx.com" $Sent = "05/09/2023" $Search = "Sent:$Sent AND From:$From AND Subject:$Subject" $KQLQuery=[scriptblock]::create($Se
#安装PSFTP模块 Install-Module psftp Get-Module psftp -ListAvailable Import-Module psftp $UserName = "ftpuser" $Password = "ftppassword" $userPassword = ConvertTo-SecureString -String $Password -AsPlainTe
判断 bash 变量是否为空:要点:变量两端用双引号括起来如果bash变量未设置或设置为空字符串,则返回true: if [ -z "$var" ];另一个选择: [ -z "$var" ] && echo "Empty"确定bash变量是否为空: [[ ! -z "$var" ]] && echo "Not empty" || echo "Empty"
将容器172.21.0.111的5432端口,映射到宿主机的54321端口步骤一:#查看nat表中的DOCKER链iptables -t nat --list-rules DOCKER#在nat表中添加一条DOCKER链规则iptables -t nat -A DOCKER -p tcp --dport 54321 -j DNAT --to-destination 172.21.0.111:543
[array]::indexof($array,‘bbb’)参考:https://devblogs.microsoft.com/scripting/find-the-index-number-of-a-value-in-a-powershell-array/
$groupnum=@('d1','d2')$var_mid="groupnum" + $groupnum[0]New-Variable -Name $var_mid -Value 3Get-Variable $var_mid$groupnumd1值为3
1.A机器上启用sftp,编辑 /etc/ssh/sshd_configSubsystem sftp internal-sftp Ciphers aes256-ctr,aes192-ctr,aes128-ctr Match Group sftp ChrootDirectory /data1/sftpfile ForceCommand in
#Backup records to other folder everyday.#定义备份的源目录、目标目录,备份每天日期的文件夹today=`date -d "now" +%Y%m%d`record_path="/var/spool/records"record_remotebak_path="/Record_bak/"record_path_today="$record_path
1.为Logstash添加一个配置文件dnsquery.conf,如下input { kafka { add_field => { "es_index_name" => "dns-query" } bootstrap_servers => "10.0.8.1:9092" topics => "dns-query" consumer_threads
从be还原邮箱数据库文件和日志后,在ecp直接挂载会提示无法挂载,然后使用esentutl命令进行修复,修复完成后,再将用户邮箱关联到该数据库即可。 创建恢复数据库:New-MailboxDatabase -Recovery -Name RDB1 -Server 0-IDC-S-MAIL003New-MailboxDatabase -Recovery -Name VIP-ba
1.先安装winpcap,下载地址:https://www.winpcap.org/windump/install/default.htm2.windump命令使用方法:windump.exe -D #返回所有可用网卡windump.exe -i 3 #监听网卡3windump.exe -n #不解析主机名,直接显示IPWinDump.exe -i 1 -n dst host 192.168.
Exchange用户发邮件提示“550 5.7.60 SMTP; Client does not have permissions to send as this sender”处理方法:get-mailbox username |get-adpermission |select user,extendedrights,查看该用户的 “NT Authority\Self”是否具有“Send-As”
curl -s ifconfig.mewget http://members.3322.org/dyndns/getipcat getip
#查看所有已注册用户sofia status profile internal reg#查看已注册用户1006sofia status profile internal reg 1006sofia status profile internal user 1006#删除已注册用户1006@10.0.6.10sofia profile internal flush_inbound_reg
#!/bin/bashsource /etc/profile #需要导入环境变量,否则非原生命令执行不成功Sendmail(){smtp='mail.yx.com'account='he@yx.com'password='123'to='liu@yx.com'subject=$1content=$2sendemail -f $account -t $to -s $smtp -u $su
1. yum -y install sendemail2.编写函数发送邮件Sendmail(){ smtp='noticemail.yxit.cc' account='he@qq.com' password='123' to='liu@yx.com' subject=$1 content=$2 sendemail -f $account -t $to -s $smtp -
1.登录DC,执行如下命令:Add-KdsRootKey -EffectiveTime (Get-Date).AddHours(-10) #命令成功,则返回 GUID 值#为名为 FSgMSA 的联合身份验证服务创建一个名为 FSgMSA 的新 gMSA adfs.contoso.comNew-ADServiceAccount -Name FSgMSA -DnsHostName adfs.con
Get-AdfsClaimsProviderTrust |select name,enabledget-AdfsRelyingPartyTrust |select name,claimsp*#ADFS绕过主领域发现,自动跳转到cas.test19.com登录Set-AdfsRelyingPartyTrust -TargetName OWA -ClaimsProviderName @("
#获取前一天Exchange收发邮件量$Mail_Servers = "mb11,mb12,mb13,mb14"$Mail_Servers_array = $Mail_Servers -split ","$Count_send = $null$Count_receive = $null$Count_sendout = $null$Count_receiveout = $null$d =
Ansible安装参考:http://www.360doc.com/content/22/0129/08/65762893_1015313555.shtml Windows服务器配置:set-psremoting -forcewinrm set winrm/config/service/auth '@{Basic="true"}'winrm set winrm/config/se
1.修改修改vim /etc/pki/tls/openssl.cnf# 取消req下被注释的第2行[ req ]distinguished_name = req_distinguished_namereq_extensions = v3_req # 删除req_distinguished_name下的0.xxx 的标签,把0.xxx的0. 去掉[ req_distinguished_na
$user = "zhangsan@tat.com.cn"$mdb = "maildbname"#迁移zhangsan@tat.com.cn的邮箱到邮箱数据库maildbnameNew-MoveRequest -Identity $user -TargetDatabase $mdb#查看用户邮箱 $user 迁移状态Get-MoveRequestStatistics -Identity
#查看当前有效证书Get-ExchangeCertificate | where {$_.Status -eq "Valid"} | Format-List FriendlyName,Subject,CertificateDomains,Thumbprint,NotBefore,NotAfter,Services#根据上一步结果导出在用的证书Export-ExchangeCertifi
vim /etc/sysctl.conf添加如下:net.ipv4.ip_nonlocal_bind =1 sysctl -p这样,当haproxy中绑定了不存在的IP时,服务可以正常启动
LVS+Keepalived配置:LVS使用两个网卡,网卡一对外提供服务(VIP也位于该网卡),网卡二连接后端RealServer(网卡二和RealServer位于同一网段)RealServer需要配置回环网卡,如下:CentOS:ifconfig lo:0 10.10.20.21 netmask 255.255.255.255 up #10.10.20.21为
查询3天内创建邮箱的用户$d = (Get-Date).adddays(-3)$ys = Get-ADUser -Filter 'Enabled -eq $true -and msExchWhenMailboxCreated -ne "$null" -and msExchWhenMailboxCreated -ge $d' -Properties msExchWhenMailboxCreated$
#新建IIS站点,设置主机头,设置应用程序池$domainname = "domainname"$site_owa = "OWA"$site_owa_dir = "d:\$site_owa"$url_owa = ($site_owa + "." + $domainname).ToLower()New-WebAppPool -Name $site_owaNew-Website -Nam
每天定时同步数据#脚本功能:#该脚本用来从远程服务器同步文件,会对文件修改时间进行比较,如果远程文件修改时间不小于当前服务器文件修改时间,则进行拷贝#远程源文件夹不要包含有子目录$remote_ip = "10.10.22.34"$username = "test\administrator"$password = "Yipassword"$remote_dir = "D:\Scrip
Copyright © 2005-2023 51CTO.COM 版权所有 京ICP证060544号