Why is remove from role members not working?

独自空忆成欢 提交于 2019-12-11 04:22:06

问题


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

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()

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

i do get output

removed 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...


回答1:


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



来源:https://stackoverflow.com/questions/55112876/why-is-remove-from-role-members-not-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!