BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sameer112217
Quartz | Level 8

I am aware of the how to delete the users manually from SAS Management Console but can anyone tell me how to delete users from SAS Management Console using script/code in SAS EG.

 

Any response would be welcome

1 ACCEPTED SOLUTION
10 REPLIES 10
Kurt_Bremser
Super User

Look at the sample programs for synchronization of users and groups with SAS metadata (see my answer to your previous question).

Use the "extract part" to get the current metadata, remove the unwanted users, and then run the sync process against the reduced userbase.

 

Or simply do it by synchronizing with your external userbase, if you have such (UNIX passwd/group or some LDAP source).

sameer112217
Quartz | Level 8

I am not an admin but doing this on adhoc basic

 

do I need to use the MDUCMP (MASTER=libref, TARGET=libref, CHANGE=libref, EXCEPTIONS=<libref.>dataset , <EXTERNONLY=0|1>, <AUTHDOMCOMPARE=name|keyid>) for update?

 

http://support.sas.com/documentation/cdl/en/bisecag/63082/HTML/default/viewer.htm#p0z36im6qsfk3ln1ad...

 

 

/* Extract identity information from the metadata (target).*/
%mduextr(libref=meta);

/* Compare AD (master) to metadata (target).3*/ 
%mducmp(master=adir, target=meta, change=updates);

/* Validate the change tables.*/
%mduchgv(change=updates, target=meta, temp=work, errorsds=work.mduchgverrors);

/* Load  the  changes into the metadata.4*/
%mduchglb(change=updates); 
JJP1
Pyrite | Level 9

Hi @Kurt_Bremser ,

 

sorry to ask in this thread, i am unable to raise new thread,

i need to do the clean up on SAS SMC for users: userid,name,display name.description options in SAS SMC.

how do i copy  the resulting library (meta) to a new location

Actually i am running below  code in SAS EG and iam getting error as  "ERROR: Libname META is not assigned."

 

%mduextr(libref=meta);

would you please suggest how can i copy to new location and them modify and then  update the data directly in SAS SMC please

 

JJP1
Pyrite | Level 9

I want to clean up the userid,displayname,jobid and email fields.
So i got below code from you on SAS site please.
So iam trying to understand the code.
here library
adir = i am giving myown work path
updates = i am giving my own work path
So i run below macro in eg and it got extracted into work library using mduextr .

thanks @Kurt.Iam ver new to SAS Admin please.sorry to trouble you with simple things,
even though myimportad.sas is present in include path,

it is telling WARNING: Physical file does not exist.
Iam sorry for my poor communication.
Basically iam trying below code to do clean up and given my own directory for adir ,updates library
and iam not able to get "Extract identity information from AD (".

Request to please point me in right direction please.

 

Kurt_Bremser
Super User

Given your as yet limited knowledge of SAS coding, I would strongly advise you against any attempts at programmatically changing SAS metadata. I started to use (and adapt) the SAS-supplied importpw program when I was a quite accomplished (so they say) SAS coder and admin (with >10 years of SAS experience), and I tested and used it BEFORE I ever went live with our first metadata-driven SAS setup (9.1.3). The risk of doing something fatal to your SAS installation, from which you can't recover on your own, is simply too big. Get help from a local SAS consultant, and watch what he/she does, and have every step explained to you.

Specifically, I will not try to assist you here; I don't want to be even remotely responsible for the ensuing disaster.

sas_royal
Calcite | Level 5
Hi, Thanks for providing solution. I have requirement to delete only metadata details of users through sas code instead of manually doing from SMC. We have pam authentication process not AD.

Didn't get how will synchronization code will work for single user deletion and need your support here so that I can use this code for single user deletion or multiple from metadata only.
kodurukiran
Calcite | Level 5

Hi

 

I am actually trying the option which you have shared last year to delete the user accounts through the SAS script using defined macros.

1. I have extracted the metadata (library say ABC) and copied the resultant metadata library to another library (library say XYZ)

2. I have tried deleting the user in Person table in library XYZ first and sync back by taking XYZ as master. But after running the macro %mducmp, I do not see any updates in change library person tables

 

Could you pls advise, is this correct approach to remove users using script ?

 

Thank you.

 

Regards

Kiran

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 10 replies
  • 3791 views
  • 4 likes
  • 5 in conversation