BookmarkSubscribeRSS Feed
deleted_user
Not applicable
From metadata, how can I get all the users, their groups and their Authentication domains. Is any sample script available?
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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
deleted_user
Not applicable
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

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1949 views
  • 0 likes
  • 2 in conversation