Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script for adding users into OLAP Administrators Group?

Status
Not open for further replies.

JasonXie

Programmer
Feb 4, 2001
20
0
0
NZ
Hello,

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 ?

Many thanks in advance.
 
Hi there,

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", _
&quot;Measures.CurrentMember.Name <> &quot;&quot;[Store Cost]&quot;&quot;&quot;
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

Good Luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top