Can anyone point out whether there is a way to use a script to add users into OLAP Administrators Group ?
Such as adding "everyone" of the local machine into the group ?
I have the script to add users to Domain Users Group, I guess you can change it to OLAP admin Group.
Here it is:
Dim dsoDB As DSO.MDStore
Dim dsoCube As DSO.MDStore
Dim dsoRole As DSO.Role
' Connect to the local server.
dsoServer.Connect "LocalHost"
'Connect to the FoodMart 2000 database.
Set dsoDB = dsoServer.MDStores.Item(strDBName)
' Create a new database role named TestRole.
Set dsoRole = dsoDB.Roles.AddNew("TestRole2", sbclsRegular)
With dsoRole
' Lock the database role.
.LockObject olaplockRead, "Creating Role"
' Set the list of users assigned to this role.
.UsersList = "Domain Users"
' Set the role description.
.Description = "Test role 2"
.UnlockObject
''NOW CODE TO ADD ROLE TO YOUR CUBE
Set dsoCube = dsoDB.MDStores(CubeName)
' Create a new cube role named TestRole, based on the database role
' named TestRole.
Set dsoRole = dsoCube.Roles.AddNew("TestRole", sbclsRegular)
' Change the role properties for the cube role.
With dsoRole
' All of the other properties are propagated from the
' TestRole database role.
' Prevent the users associated with this role from
' reading the [Store Cost] measure.
.SetPermissions "CubeRead", _
"Measures.CurrentMember.Name <> ""[Store Cost]"""
End With
' Update the cube role by updating the cube.
dsoCube.Update
Hope it helps, I found it at microsoft site and it works.
Look for DSO objcets at MSDN online
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.