<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to extract users on SAS VIYA? in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-extract-users-on-SAS-VIYA/m-p/832858#M25030</link>
    <description>&lt;P&gt;Hi SAS Communities,&lt;BR /&gt;&lt;BR /&gt;Is there a way to extract all the internal accounts on SAS 9.4 and VIYA?&lt;BR /&gt;The only way I think is to manually check the SASDM and try to update password from there to see the list of users.&lt;BR /&gt;For SAS VIYA, just get all the users on SAS Environment Manager.&lt;BR /&gt;Is there a script to run or a table to check to list down all the internal accounts?&lt;BR /&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Mon, 12 Sep 2022 10:53:11 GMT</pubDate>
    <dc:creator>jbond007</dc:creator>
    <dc:date>2022-09-12T10:53:11Z</dc:date>
    <item>
      <title>How to extract users on SAS VIYA?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-extract-users-on-SAS-VIYA/m-p/832858#M25030</link>
      <description>&lt;P&gt;Hi SAS Communities,&lt;BR /&gt;&lt;BR /&gt;Is there a way to extract all the internal accounts on SAS 9.4 and VIYA?&lt;BR /&gt;The only way I think is to manually check the SASDM and try to update password from there to see the list of users.&lt;BR /&gt;For SAS VIYA, just get all the users on SAS Environment Manager.&lt;BR /&gt;Is there a script to run or a table to check to list down all the internal accounts?&lt;BR /&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 10:53:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-extract-users-on-SAS-VIYA/m-p/832858#M25030</guid>
      <dc:creator>jbond007</dc:creator>
      <dc:date>2022-09-12T10:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract users on SAS VIYA?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-extract-users-on-SAS-VIYA/m-p/832889#M25032</link>
      <description>Viya doesn't have internal accounts apart from sasboot. Here is some code for Viya and SAS 9.4 for getting a user listing.&lt;BR /&gt;&lt;BR /&gt;Viya: &lt;A href="https://communities.sas.com/t5/Administration-and-Deployment/SAS-VIYA-Fetching-List-of-Users-Groups-Creation-Date/td-p/723793" target="_blank"&gt;https://communities.sas.com/t5/Administration-and-Deployment/SAS-VIYA-Fetching-List-of-Users-Groups-Creation-Date/td-p/723793&lt;/A&gt;&lt;BR /&gt;SAS 9.4: &lt;A href="https://github.com/greg-wootton/sas-programs/blob/main/Users%20and%20Groups/list_all_users.sas" target="_blank"&gt;https://github.com/greg-wootton/sas-programs/blob/main/Users%20and%20Groups/list_all_users.sas&lt;/A&gt;</description>
      <pubDate>Mon, 12 Sep 2022 13:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-extract-users-on-SAS-VIYA/m-p/832889#M25032</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2022-09-12T13:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract users on SAS VIYA?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-extract-users-on-SAS-VIYA/m-p/832899#M25035</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/422546"&gt;@jbond007&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Others may have input here that differs from this method. Hopefully, you'll get advice on multiple ways of doing this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For SAS Viya, you should be able to use the identities API through the&amp;nbsp;&lt;A href="https://go.documentation.sas.com/doc/en/sasadmincdc/v_031/calcli/n1vth8mtb8ipprn1prz5j26p3nvc.htm" target="_self"&gt;CLI&lt;/A&gt;, possibly in combination with the &lt;A href="https://github.com/sassoftware/pyviyatools" target="_self"&gt;pyviyatools&lt;/A&gt; scripts on GitHub. If you've not used the CLI before, &lt;A href="https://www.youtube.com/watch?v=v1636bkGp2c&amp;amp;list=PLVV6eZFA22QwrXd6nSDU18E6XgXSMOs87" target="_self"&gt;here's a great video&lt;/A&gt; to get you started. I believe&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/111375"&gt;@DarrellBarton&lt;/a&gt;&amp;nbsp;gives an example for identities.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 13:53:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-extract-users-on-SAS-VIYA/m-p/832899#M25035</guid>
      <dc:creator>joeFurbee</dc:creator>
      <dc:date>2022-09-12T13:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract users on SAS VIYA?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-extract-users-on-SAS-VIYA/m-p/833030#M25039</link>
      <description>&lt;P&gt;Thanks greg, ill check on this but does it include the creation date and the last password change? or its not possible?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 01:07:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-extract-users-on-SAS-VIYA/m-p/833030#M25039</guid>
      <dc:creator>jbond007</dc:creator>
      <dc:date>2022-09-13T01:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract users on SAS VIYA?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-extract-users-on-SAS-VIYA/m-p/833099#M25043</link>
      <description>&lt;P&gt;Another program in that same folder called "get_user_create.sas" does pull creation date for all users (not just internal).&lt;BR /&gt;&lt;A href="https://github.com/greg-wootton/sas-programs/blob/main/Users%20and%20Groups/get_user_create.sas" target="_blank" rel="noopener"&gt;https://github.com/greg-wootton/sas-programs/blob/main/Users%20and%20Groups/get_user_create.sas&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;To pull last password change you would probably need to use the modified date for the InternalLogin object associated with the Person object for internal accounts (the last time it was modified would not necessarily be a password change). I do not have a program that does this, but it would be possible for you to modify my program to do so. You would use the METADATA_GETNASN function to get the InternalLoginInfo association for the person object. If it exists, the account is internal. Then pull the MetadataUpdated attribute for the InternalLogin object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example based on the get_user_create.sas program:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Establish a connection to the Metadata server. This must be edited to provide the appropriate connection information. */

options metaserver="meta.demo.sas.com"
		metaport=8561
		metauser="sasadm@saspw"
		metapass="&amp;lt;password&amp;gt;"
		metaprotocol=bridge
		metarepository=foundation;

/* End edit. */

data users; /* Create a data set work.users. */

/* Initialize variables. */
length 
type 
id $ 17 
user_name 
user_dn 
user_mc 
user_uri
intlog_mm
intlog_uri $ 50
user_created
intlog_modified 8; 

call missing(of _character_);

label 	user_name="User Name"
		user_dn="User Display Name"
		user_created="User Created"
		intlog_modified="Internal Login Modified";	

format user_created intlog_modified datetime.;

/* Define search parameters. */

obj="omsobj:Person?@Id contains '.'";

/* Test if any users exist. */

user_count=metadata_resolve(obj,type,id);

/* If so, for each extract the name, display name, and metadata created attributes. */

if user_count &amp;gt; 0 then do i=0 to user_count;
	rc=metadata_getnobj(obj,i,user_uri);
	rc=metadata_getattr(user_uri,"Name",user_name);
	rc=metadata_getattr(user_uri,"DisplayName",user_dn);
	rc=metadata_getattr(user_uri,"MetadataCreated",user_mc);
	user_created=input(user_mc,datetime.);&lt;BR /&gt;&lt;BR /&gt;    /* If an internal account, get the internal login URI */
	rc=metadata_getnasn(user_uri,"InternalLoginInfo",1,intlog_uri);
	if rc &amp;gt; 0 then do;&lt;BR /&gt;&lt;BR /&gt;    /* Pull the MetadataUpdated attribute from that object. */
	rc=metadata_getattr(intlog_uri,"MetadataUpdated",intlog_mm);&lt;BR /&gt;&lt;BR /&gt;    /* Convert it from a string to a number. */
	intlog_modified=input(intlog_mm,datetime.);
	end;

/* Output if a user name is defined. */
	if user_name = '' then continue; else output;
end;

/* Drop unwanted variables.*/

keep user_name user_created user_dn intlog_modified;
run;

/* Sort the data set by date. */

proc sort data=users;
by user_created;
run;

/* Produce a report. */

proc report data=users; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Sep 2022 12:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-extract-users-on-SAS-VIYA/m-p/833099#M25043</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2022-09-13T12:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract users on SAS VIYA?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-extract-users-on-SAS-VIYA/m-p/833184#M25045</link>
      <description>&lt;P&gt;Hi Greg,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;the first program you mentioned works wonders. however, im still missing some users. It doesn't extract users inside the sas postgres (Web Infrastructure Platform Data Serverlike for example the default sas postgres user SharedServices and dbmsowser&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 16:51:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-extract-users-on-SAS-VIYA/m-p/833184#M25045</guid>
      <dc:creator>jbond007</dc:creator>
      <dc:date>2022-09-13T16:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract users on SAS VIYA?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-extract-users-on-SAS-VIYA/m-p/833187#M25046</link>
      <description>Hi Joe,&lt;BR /&gt;&lt;BR /&gt;I understand that this one would need download addtional plugins on the server but this may not be allowed is there a script we can run on SASStudio?</description>
      <pubDate>Tue, 13 Sep 2022 16:57:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-extract-users-on-SAS-VIYA/m-p/833187#M25046</guid>
      <dc:creator>jbond007</dc:creator>
      <dc:date>2022-09-13T16:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract users on SAS VIYA?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-extract-users-on-SAS-VIYA/m-p/833190#M25047</link>
      <description>Are you talking about the Viya program or the SAS 9.4 one?&lt;BR /&gt;&lt;BR /&gt;The external accounts used to sign into postgres like dbmsowner are stored credentials, not users. They can also be pulled, but it is a different question. On my github the list_users_and_logins.sas does this for SAS 9.4.</description>
      <pubDate>Tue, 13 Sep 2022 17:39:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-extract-users-on-SAS-VIYA/m-p/833190#M25047</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2022-09-13T17:39:45Z</dc:date>
    </item>
  </channel>
</rss>

