Desktop productivity for business analysts and programmers

How to get all users, groups and authentication domain from metadata

Reply
N/A
Posts: 0

How to get all users, groups and authentication domain from metadata

From metadata, how can I get all the users, their groups and their Authentication domains. Is any sample script available?
Super Contributor
Super Contributor
Posts: 3,174

Re: How to get all users, groups and authentication domain from metadata

From searching the SAS support http://support.sas.com/ website, this conference paper (link below) discusses SAS 9.2 facilities related to this topic.

Scott Barry
SBBWorks, Inc.

Paper 321-2009
Using SAS® 9.2 Metadata Security Reporting and Auditing Features
Forrest Boozer and Diane Hatcher, SAS Institute Inc., Cary NC
http://support.sas.com/resources/papers/sgf09/321-2009.pdf
N/A
Posts: 0

Re: How to get all users, groups and authentication domain from metadata

I'm assuming that you want to get hold of the data and then report/manipulate it in SAS code??

If that's the case try this :

options metaserver="meta1" /* Your metadata server */
metaport=8561
metaprotocol=bridge
metauser="sasadm"
metapass="*****************"
metarepository="Foundation" ; /* Presuming that your users are defined in the Foundation Repository */

data _null_; /* You might need to replace Foundation with an alternate repository name */
length id $20
type $256;
repos_rc=metadata_resolve("omsobj:RepositoryBase?@Name='Foundation'",type,id);
call symputx('reposid', id) ;
call symputx('reposid2', scan(id, 2, ".")) ;
run ;

filename inxml TEMP ; /* defines what metadata you'd like to get hold of */
data _null_ ;
file inxml ;
put
"" /
" &reposid" /
" Person" /
" " /
" SAS" /
" 404" /
" " /
" " /
" " /
" " /
" " /
"
" /
" " /
" " /
" " /
"
" /
" " /
"
" /
"
" /
"
" /
;
run ;

filename outxml 'd:\out.xml' ;

proc metadata in=inxml /* Fetches the requested metadata, and returns it as XML */
out=outxml ;
run ;

filename People TEMP ; /* Define an XML map to overlay on your XML */
data _null_ ;
file People ;
put
" " /
"" /
" " /
" //Person/IdentityGroups/IdentityGroup" /
" " /
" //Person/Logins/Login/@Name" /
" character" /
" string" /
" 200" /
"
" /
" " /
" //Person/Logins/Login/Domain/AuthenticationDomain/@Name" /
" character" /
" string" /
" 50" /
"
" /
" " /
" //Person/IdentityGroups/IdentityGroup/@Name" /
" character" /
" string" /
" 50" /
"
" /
"
" /
"
" /
;
run ;

libname outxml xml xmlmap=People access=READONLY; /* Defines a libname containing a table based on your XML map */

/* I'd advise that you copy this table elsewhere before you try to manipulate it, I've seen some odd problems with the XML libname in the past */





Also, you may find this paper useful for future reference (http://www2.sas.com/proceedings/forum2008/134-2008.pdf) (I've just added some comments to the code)


Message was edited by: simkinp
Ask a Question
Discussion stats
  • 2 replies
  • 148 views
  • 0 likes
  • 2 in conversation