问题
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