gaohan 发表于 2017-7-1 18:14:59

国际版删除域名的步骤


[*]第一步:使用Microsoft Azure Active Directory Module for Windows Powershell连接至office365 管理中心:

  Connect-msolservice   (输入全局管理员账号)

[*]第二步:查看是否有用户或者组在使用需要删除的域名,并将这些用户以及组或者联系人导出来到CSV 文件。
[*]输入命令查看在使用需要被删除的用户(请将msoffice.linkpc.net 替换为需要被删除的域名):

  Get-MsolUser -DomainName msoffice.linkpc.net -all | Export-Csv d:\user.csv

[*]输入命令查看在使用需要被删除的组和联系人:

  Get-msolgroup -all | where {$_.proxyaddresses -match "msoffice.linkpc.net" } | Export-Csv d:\group.csv
  Get-msolcontact -all | where {$_.emailaddress -match "msoffice.linkpc.net" } | Export-Csv d:\contact1.csv
  Get-msolcontact -all | where {$_.ProxyAddresses -match "msoffice.linkpc.net" } | Export-Csv d:\contact2.csv

[*]第三步: 运行命令删除与该域名相关的用户,组,联系人:

  Get-MsolUser -DomainName msoffice.linkpc.net -all| remove-msoluser -force (用户被删除到已删除用户列表)
  Get-MsolUser -ReturnDeletedUsers -all | Remove-MsolUser -RemoveFromRecycleBin -force(从已删除的用户列表里面讲用户永久删除)
  Get-msolgroup -all | where {$_.proxyaddresses -match "msoffice.linkpc.net" } | remove-msolgroup -force (强制删除所有与该域名有关组)
  Get-msolcontact -all | where {$_.emailaddress -match "msoffice.linkpc.net" } | remove-msolcontact -force (删除与域名有关的联系人)
  Get-msolcontact -all | where {$_.ProxyAddresses -match "msoffice.linkpc.net" } | remove-msolcontact -force (删除与域名有关的联系人)

[*]第四布:当确认好域名已经没有邮件地址或者用户和组在使用时,可以直接将domain在office365管理中心删除,该过程有些慢,或者使用命令
  Remove-MsolDomain -DomainName msoffice.linkpc.net -force
页: [1]
查看完整版本: 国际版删除域名的步骤