WIN2008 关闭AAD同步

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

如果是通过AAD方式同步的话在AAD中用户是无法删除的所以需要关闭。

一.安装AzureAD模块失败
PS C:\Users\administrator> Install-Module AzureAD
The term 'Install-Module' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:15
+ Install-Module <<<<  AzureAD
    + CategoryInfo          : ObjectNotFound: (Install-Module:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

解决安装Windows Management Framework 5.1
下载地址为https://www.microsoft.com/en-us/download/confirmation.aspx?id=54616
下载 Windows Management Framework 5.1后安装。

二.运行Install-Module AzureAD
PackageManagement\Install-PackageProvider : No match was found for the specified search criteria for the provider
'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package
has the tags.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7405 char:21
+ ...     $null = PackageManagement\Install-PackageProvider -Name $script:N ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (Microsoft.Power...PackageProvider:InstallPackageProvider) [Install-Pac
   kageProvider], Exception
    + FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackageProvider

解决指定传输协议PS中运行如下
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

三.登录
PS C:\Users\administrator> Connect-MsolService -AzureEnvironment AzureCloud

输入用户名和密码注意后面的AzureCloud如果不是全球版需要换成AzureChinaCloud

四.关闭同步
PS C:\Users\administrator> Set-MsolDirSyncEnabled -EnableDirSync $false
关闭同步后再登录Azure Portal可以看到同步已经disable了。

五.登录Azure.portal.com 就可以删除用户了

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

“WIN2008 关闭AAD同步” 的相关文章