为什么从角色成员中删除不起作用? [英] Why is remove from role members not working?

查看:27
本文介绍了为什么从角色成员中删除不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https:///docs.microsoft.com/en-us/dotnet/api/microsoft.analysisservices.rolemembercollection.remove?view=analysisservices-dotnet

出于某种原因,这无法正常工作.我一直在重新连接服务器并检查 ID 是否被删除,而没有!

For some reason, this is not working properly. I keep reconnecting the server and checking if the ID gets removed and its not!

$ssasInstance = "<ssas instance name>"
$accountName= "<domain\user>"
Import-Module SqlServer
[Microsoft.AnalysisServices.Server]$SSASserver = New-Object ([Microsoft.AnalysisServices.Server])
$SSASserver.Connect($ssasInstance) 
$role= $SSASserver.Roles["Administrators"]
$role.Members.Remove($accountName)
$role.Update()

没有错误或任何东西.我做了一个条件语句来检查 ID 是否存在,如果存在,则删除并删除输出!

there is no errors or anything. i did a conditional statement to check if ID exists, and if it does, remove and output removed!

我确实得到了输出

已删除 ID!

但 ID 并没有真正被删除!

but the ID is not really getting removed!

我试过添加,所以我知道脚本没有问题,并添加作品!仅出于某种原因删除不起作用...

I have tried ADD, so that i know nothing is wrong with the script, and add works! only remove for some reason is not working...

推荐答案

由于话题有一定的关联性,万一以后有人搜索类似的标题,这里是答案:

Since the threads are somewhat related, in case someone searches for a similar title in the future, here is the answer:

https://stackoverflow.com/a/55145118/8397835

这篇关于为什么从角色成员中删除不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆