<?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 Re: Add User Programatically in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Add-User-Programatically/m-p/45644#M9440</link>
    <description>Everything you pointed is possible through the Open Metadata Interface, of course with the right authorization level.&lt;BR /&gt;
&lt;BR /&gt;
Not an easy task though.&lt;BR /&gt;
&lt;BR /&gt;
You'll have to code your needs into the correct XML request.&lt;BR /&gt;
&lt;BR /&gt;
Check the online publishing, everything is in there (at least the important facts):&lt;BR /&gt;
&lt;BR /&gt;
SAS 9.1.3 Open Metadata Interface User's Guide:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/omd_interug_9964.pdf" target="_blank"&gt;http://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/omd_interug_9964.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
    <pubDate>Thu, 18 Jun 2009 14:18:01 GMT</pubDate>
    <dc:creator>DanielSantos</dc:creator>
    <dc:date>2009-06-18T14:18:01Z</dc:date>
    <item>
      <title>Add User Programatically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-User-Programatically/m-p/45643#M9439</link>
      <description>Hi All,&lt;BR /&gt;
I want to set up a program (as a stored process) that will allow people in my company to be registered as a user via a web form.  On the public kiosk of our portal I have a url portlet pointing to a home page. I have a form on this page where a user requests access and then an admin adds the user and the user to groups and channels. I want to automate this part by following the below process.&lt;BR /&gt;
&lt;BR /&gt;
1.  User goes to our portal&lt;BR /&gt;
2.  User requests access adding;&lt;BR /&gt;
        a. Network Username&lt;BR /&gt;
        b. Full Name&lt;BR /&gt;
        c. Role&lt;BR /&gt;
        d. Department&lt;BR /&gt;
        e. Manager&lt;BR /&gt;
        f. Contact Number&lt;BR /&gt;
        g. Email&lt;BR /&gt;
        h. Groups they want access to (currently drawn from our metadata server)&lt;BR /&gt;
&lt;BR /&gt;
3.  User is added with the following details created;&lt;BR /&gt;
        a. User Full Name&lt;BR /&gt;
        b. Department added to the Description Field&lt;BR /&gt;
        c. Username added to logins with authentication domain as 'Default Auth'&lt;BR /&gt;
        d. Email &amp;amp; Phone added&lt;BR /&gt;
        e. Role,Department,Manager added as custom attributes&lt;BR /&gt;
        f. User assigned to the group 'Environ Users' &lt;BR /&gt;
&lt;BR /&gt;
4.  Email sent to both user and Admin notifying them they have been added.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
What I am looking for is a code snippet that shows me how I can programatically;&lt;BR /&gt;
a. Add a user to our metadata server&lt;BR /&gt;
b. Assign a login with DefaultAuth&lt;BR /&gt;
c. Add a description&lt;BR /&gt;
d. Add phone and email&lt;BR /&gt;
e. Add custom attributes.&lt;BR /&gt;
f.  Assign user to a group&lt;BR /&gt;
&lt;BR /&gt;
Any help is appreciated&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Cameron</description>
      <pubDate>Wed, 17 Jun 2009 13:52:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-User-Programatically/m-p/45643#M9439</guid>
      <dc:creator>CameronLawson</dc:creator>
      <dc:date>2009-06-17T13:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Add User Programatically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-User-Programatically/m-p/45644#M9440</link>
      <description>Everything you pointed is possible through the Open Metadata Interface, of course with the right authorization level.&lt;BR /&gt;
&lt;BR /&gt;
Not an easy task though.&lt;BR /&gt;
&lt;BR /&gt;
You'll have to code your needs into the correct XML request.&lt;BR /&gt;
&lt;BR /&gt;
Check the online publishing, everything is in there (at least the important facts):&lt;BR /&gt;
&lt;BR /&gt;
SAS 9.1.3 Open Metadata Interface User's Guide:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/omd_interug_9964.pdf" target="_blank"&gt;http://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/omd_interug_9964.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
      <pubDate>Thu, 18 Jun 2009 14:18:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-User-Programatically/m-p/45644#M9440</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2009-06-18T14:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Add User Programatically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-User-Programatically/m-p/45645#M9441</link>
      <description>It does involve some legwork, but it's far from impossible. Please back everythng up, and be 100% sure it works properly before putting it live though. I take no responsibility for any future problems you may have &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Firstly, do you understand the basics of navigating around the underlying metadata? If not read this first &lt;A href="http://www2.sas.com/proceedings/forum2008/134-2008.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/forum2008/134-2008.pdf&lt;/A&gt; (Sorry to blow my own trumpet)&lt;BR /&gt;
&lt;BR /&gt;
First you'll need to identify all of the appropriate objects and associations (I'd suggest you start with the 'Person' object, and have a dig around from there. You should get an understanding of all of the new objects you'll need to create and the existing ones you'll need to link to your new user (the authentication domain for example)&lt;BR /&gt;
&lt;BR /&gt;
Now you just need to set up your XML request. Here's a very crude &lt;ADDMETADATA&gt; request, just to highlight the basic principles ............&lt;BR /&gt;
&lt;BR /&gt;
filename inXML temp ;&lt;BR /&gt;
data _null_ ;&lt;BR /&gt;
		file inXML lrecl=2500 ;&lt;BR /&gt;
			put &lt;BR /&gt;
				"&lt;ADDMETADATA&gt;" /&lt;BR /&gt;
	  			"	&lt;METADATA&gt;" /&lt;BR /&gt;
				"		&lt;JOB id="&amp;amp;reposid2..$Job" name="Load_&amp;amp;tblName"&gt;" / /* Create a new job, with a new id (note the $ tells us to create a new id */&lt;BR /&gt;
				"			&lt;TREES&gt;" /&lt;BR /&gt;
				"				&lt;TREE objref="&amp;amp;JobtreeID."&gt;&lt;/TREE&gt;" / /* Put the new job under an existing tree */&lt;BR /&gt;
				"			&lt;/TREES&gt;" /&lt;BR /&gt;
				"		&lt;/JOB&gt;" /&lt;BR /&gt;
				"		 " /&lt;BR /&gt;
				"		&lt;TRANSFORMATIONACTIVITY id="&amp;amp;reposid2..$TransformationActivity" name="New Transformation Activity"&gt;" /  /* Create a new transformation Activity */&lt;BR /&gt;
				"			&lt;JOBS&gt;" /&lt;BR /&gt;
				"				&lt;JOB objref="&amp;amp;reposid2..$Job"&gt;&lt;/JOB&gt;" / /* Assosciate this TA with the 'new' job defined above */&lt;BR /&gt;
				"			&lt;/JOBS&gt;" /&lt;BR /&gt;
				"		&lt;/TRANSFORMATIONACTIVITY&gt;" /&lt;BR /&gt;
				"		 " /&lt;BR /&gt;
				"	&lt;/METADATA&gt;" /&lt;BR /&gt;
				"	&lt;REPOSID&gt;&amp;amp;reposid&lt;/REPOSID&gt;" /&lt;BR /&gt;
				"  	&lt;NS&gt;SAS&lt;/NS&gt;" /&lt;BR /&gt;
				"   &lt;FLAGS&gt;268435456&lt;/FLAGS&gt;" /&lt;BR /&gt;
				"&lt;/ADDMETADATA&gt;" /&lt;BR /&gt;
	;&lt;BR /&gt;
	run ;&lt;BR /&gt;
&lt;BR /&gt;
	proc metadata in = inXML ;&lt;BR /&gt;
	run ;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Hope this all makes sense for you&lt;BR /&gt;
&lt;BR /&gt;
Cheers&lt;BR /&gt;
&lt;BR /&gt;
Paul&lt;/ADDMETADATA&gt;</description>
      <pubDate>Fri, 19 Jun 2009 10:58:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-User-Programatically/m-p/45645#M9441</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-06-19T10:58:35Z</dc:date>
    </item>
  </channel>
</rss>

