WIN2008 关闭AAD同步

20 篇文章 0 订阅
文章介绍了在AAD同步用户时,由于用户无法直接删除,需要通过安装AzureAD模块、解决PowerShell的依赖问题、设置目录同步为禁用,然后在AzurePortal中才能删除用户的过程。涉及到的步骤包括安装WindowsManagementFramework5.1,处理PackageManagement的错误,以及使用PowerShell命令Connect-MsolService和Set-MsolDirSyncEnabled来操作。
摘要由CSDN通过智能技术生成

如果是通过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 就可以删除用户了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值