Ok, ok. I always forget so to save me some time, here it is...
Open up command line from Visual Studio, then run...
cmd>aspnet_regsql.exe
Then execute the following...
-- Register Application
EXEC dbo.aspnet_Applications_CreateApplication 'AppName', NULL
-- Check if Application was registered
SELECT * FROM dbo.aspnet_Applications
-- Create a Role
EXEC dbo.aspnet_Roles_CreateRole 'AppName', 'Administrator'
-- Check if Role was created
SELECT * from dbo.aspnet_Roles
-- Add myself as Admin
DECLARE @Date AS DATETIME
SET @Date = (SELECT GETDATE())
EXEC aspnet_UsersInRoles_AddUsersToRoles 'AppName', 'DOMAIN\username', 'Administrator', @Date
-- Check if I got added as Admin
EXEC dbo.aspnet_UsersInRoles_GetUsersInRoles 'AppName', 'Administrator'
EXEC dbo.aspnet_Applications_CreateApplication 'AppName', NULL
-- Check if Application was registered
SELECT * FROM dbo.aspnet_Applications
-- Create a Role
EXEC dbo.aspnet_Roles_CreateRole 'AppName', 'Administrator'
-- Check if Role was created
SELECT * from dbo.aspnet_Roles
-- Add myself as Admin
DECLARE @Date AS DATETIME
SET @Date = (SELECT GETDATE())
EXEC aspnet_UsersInRoles_AddUsersToRoles 'AppName', 'DOMAIN\username', 'Administrator', @Date
-- Check if I got added as Admin
EXEC dbo.aspnet_UsersInRoles_GetUsersInRoles 'AppName', 'Administrator'
2 comments:
It would be nice if you also howed how this relates to web.config
Sincerley T.Saxeggen
One way to use roles in web.config:
If http://www.service.com/
But don't want all users to connecto to http://www.service.com/Proceed
Post a Comment