新钛云服已累计为您分享737篇技术干货
基本信息
镜像下载地址:
https://next.itellyou.cn/Original/#
文档:
https://learn.microsoft.com/zh-cn/Exchange/plan-and-deploy/system-requirements?view=exchserver-2019
必要软件
Exchange 2019 最低要求是 16GB 内存
显示计算机、网络图标,在运行窗口输入
rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,0
桌面壁纸显示ip地址信息
https://learn.microsoft.com/zh-cn/sysinternals/downloads/bginfo
Boot Time: <Boot Time>
OS Version: <OS Version>
Host Name: <Host Name>
Logon Domain: <Logon Domain>
Machine Domain: <Machine Domain>
CPU: <CPU>
Memory: <Memory>
IP Address: <IP Address>
DHCP Server: <DHCP Server>
MAC Address: <MAC Address>
Subnet Mask: <Subnet Mask>
DNS Server: <DNS Server>
Default Gateway: <Default Gateway>
Volumes: <Volumes>
A .NET框架4.8
https://download.visualstudio.microsoft.com/download/pr/014120d7-d689-4305-befd-3cb711108212/0fd66638cde16859462a6243a4629a50/ndp48-x86-x64-allos-enu.exe
B.Visual C++ Redistributable Package for Visual Studio 2012
https://www.microsoft.com/download/details.aspx?id=30679
C.在 Windows PowerShell 中运行以下命令,安装远程工具管理包:
Install-WindowsFeature RSAT-ADDS
D.Exchange Server 2019 CU12 (2022H1)补丁包
https://techcommunity.microsoft.com/t5/exchange-team-blog/released-2022-h1-cumulative-updates-for-exchange-server/ba-p/3285026
下载地址https://www.microsoft.com/en-us/download/details.aspx?id=30679
E.IIS URL 重写模块
IIS 的 URL 重写模块需要在累积更新 11 或更高版本中使用。
下载地址https://www.iis.net/downloads/microsoft/url-rewrite
F.添加所需的 Lync Server 或 Skype for Business Server 组件:
Install-WindowsFeature Server-Media-Foundation
G.安装 Unified Communications Managed API 4.0。
此程序包可供下载并位于 Exchange Server 媒体的
\UCMARedist 文件夹中。
https://www.microsoft.com/download/details.aspx?id=34992
H.使用 Exchange 安装程序安装所需的 Windows 组件,请在 Windows PowerShell 中运行以下命令之一
#把window2019的安装ios加到到本电脑上的z磁盘
Install-WindowsFeature NET-Framework-45-Features, Server-Media-Foundation, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Clustering-CmdInterface, RSAT-Clustering-Mgmt, RSAT-Clustering-PowerShell, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect, Web-Http-Tracing, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-Mgmt-Console, Web-Mgmt-Service, Web-Net-Ext45, Web-Request-Monitor, Web-Server, Web-Stat-Compression, Web-Static-Content, Web-Windows-Auth, Web-WMI, Windows-Identity-Foundation, RSAT-ADDS -Source Z:\sources\sxs
#扩展AD架构
\Setup.exe /IAcceptExchangeServerLicenseTerms /PrepareSchema
\Setup.exe /IAcceptExchangeServerLicenseTerms /PrepareAD /OrganizationName:"tyun"
#在AD用戶与計算机上,你会发现 Microsoft Exchange Security Groups
\Setup.exe /IAcceptExchangeServerLicenseTerms /PrepareAllDomains
I.批量发送邮件给自己
send-mailmessage -to administrator@tyun.cn -subject "TEST49" -Body "請注意!SRVEX 磁碟空間目前已剩下不到 78% 的可用空間 " -smtpserver srvex.ianext.com -from administrator@tyun.cn -Encoding Unicode
J.单exchange服务停止批量启动
#查看exchange服务
Get-Service -Name "MSExch*"
#显示完成的exchange名称
Get-Service -Name "MSExch*" | ft -auto
# 直接重啟 Exchange 已经停止的服务
Get-Service -Name "MSExchange*" | Where-Object {$_.Status -eq "Stopped"} | Restart-Service
K.exchange用户信息
#用户登录Exchange信息
Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails UserMailbox, SharedMailbox | Get-MailboxStatistics | Sort-Object Lastlogontime -Descending | Select-Object DisplayName,MailboxTypeDetail,LastLogonTime,ServerName
#查看目前有架构下所有的 Exchange Server 完整主机名称等等信息
Get-ExchangeServer | Select FQDN, ServerRole,AdminDisplayVersion,IsEdgeServer
#查看本机所有 Exchange 服务的执行状态
Get-Service -Name *Exchange* | Select Status, DisplayName | Sort Status | FT -Auto
#测试主机连接smtp服务是否正常
Test-NetConnection srvex.tyun.cn -Port 25 -InformationLevel "Detailed"
#测试连接的所有网络、来源地址、目的地址以及路由信息
Test-NetConnection -ComputerName srvex.tyun.cn -DiagnoseRouting -InformationLevel Detailed
#Exchange DNS 查看
Get-TransportService | FL *dns*
#把ad用户导入到exchange
Get-User -RecipientTypeDetails User -Filter { UserPrincipalName -ne $Null } | Enable-Mailbox
L.批量导出AD用户
参考https://www.cnblogs.com/wulongy/p/14924907.html
#查询到的ad用户导出到ADuser.csv文件里
Get-ADUser -Filter * -SearchBase "DC=TYUN, DC=CN" |Select-Object -Property SamAccountName, Surname, GivenName, Name, Group, UserPrincipalName, Path, AccountPassword, Enabled, ChangePasswordAtLogon | Export-Csv -Encoding unicode ADuser.csv
文件在C:\Users\Administrator下面
#PowerShell 批量导入AD域用户(密码写在脚本上Tyun@2022)
import-csv c:\ad\User.csv | Foreach {New-ADUser -samAccountName $_.SamAccountName -Surname $_.Surname -GivenName $_.GivenName -Name $_.Name -UserPrincipalName $_.Userprincipalname -DisplayName $_.DisplayName -Description $_.Description -Path $_.Path -AccountPassword(ConvertTo-SecureString "Tyun@2022" -AsPlainText -Force) -Enabled $true -ChangePasswordAtLogon 1 -passthru -PasswordNeverExpires ($_.PasswordNeverExpires -eq "1") }
#PowerShell 批量导入AD域用户(密码写在csv里面)
import-csv c:\ad\User.csv | Foreach {New-ADUser -samAccountName $_.SamAccountName -Surname $_.Surname -GivenName $_.GivenName -Name $_.Name -UserPrincipalName $_.Userprincipalname -DisplayName $_.DisplayName -Description $_.Description -Path $_.Path -Enabled $true -AccountPassword (ConvertTo-SecureString $_.AccountPassword -AsPlainText -force) -passthru -PasswordNeverExpires ($_.PasswordNeverExpires -eq "1")}
#指定用户查询所有域组名称
Get-ADPrincipalGroupMembership hexingxing | ft name
#指定用户查询所有域组名称并以名称排序
Get-ADPrincipalGroupMembership hexingxing | sort name | ft name
#Get-ADUser
(Get-ADUser -Identity hexingxing -Properties *).MemberOf
用户上次设置密码时间
Get-ADUser king -Properties * | ft PasswordLastSet
设置账户king密码永不过期
Set-ADAccountControl -Identity king -PasswordNeverExpires:$true
取消账户king密码永不过期
Set-ADAccountControl -Identity king -PasswordNeverExpires:$false
设置king的账户过期时间为 2022/10/18 0:00:00,即最后可用使用时间为 2022/10/18
Set-ADAccountExpiration -Identity king -DateTime "10/18/2022"
忽略旧密码为账户设置新密码
Set-ADAccountPassword -Identity king -NewPassword (ConvertTo-SecureString -AsPlainText "ef7s00#" -Force)
根据提示信息输入旧密码并更新用户密码
Set-ADAccountPassword -Identity king
AD 域启用账户
Enable-ADAccount -Identity king
AD 域禁用账户
Disable-ADAccount -Identity king
表格样例
AD域管理工具
https://osdn.net/projects/sfnet_adbulkadmin/downloads/ADBulkAdmin/1.1.0.33/ADBulkAdmin-v1.1.0.33.zip/
https://zh.osdn.net/projects/sfnet_adbulkadmin/releases/
导出it组织单元下的所有用户
Get-ADUser -Filter * -Properties * -SearchBase "DC=it,DC=tyun,DC=cn" |Select-Object name,SamAccountName,Givenname,surname,Displayname,title,mobile,CanonicalName,Created,Department,DistinguishedName,EmailAddress,homeMDB,mail,mailNickname,MemberOf,msExchCoManagedObjectsBL,msExchHomeServerName,PasswordLastSet,PrimaryGroup,proxyAddresses,UserPr