Thursday, March 29, 2012

How to permanently disable an Account through ldif in Oracle Internet Directory:


 

How to permanently disable an Account through ldif in Oracle Internet Directory:

Step:1

Note: make sure the object class oracleUserV2 is already added to users.

Create disable.ldif

*************************************

dn: cn=qasim1,cn=users,dc=hostname,dc=com

changetype: modify

replace: orclisenabled

orclisenabled: DISABLED

************************************

If orclUserV2 is not already there, then the disable.ldif would be like:

***********************************

dn: cn=qasim1,cn=users,dc=hostname,dc=com

changetype: modify

objectclass: orclUserV2

orclisenabled: DISABLED

***********************************

Step:2

execute following command at shell:


 

ldapmodify -h hostname -p 389 –D cn=orcladmin -w oracle -c -f disable.ldif


 


 

Note: You can add as many users as you want in the same format in disable.ldif

How to enable an Account through ldif in Oracle Internet Directory:

Step: 1


 

Create enable.ldif


 

*****enable.ldif*************

dn: cn=qasim1,cn=users,dc=hostname,dc=com

changetype: modify

replace: orclisenabled

orclisenabled: ENABLED

*****************************


 

Step: 2


 

execute following command at shell:


 

ldapmodify -h hostname -p 389 –D cn=orcladmin -w oracle -c -f enable.ldif


 

--> It will change the status of user from Disabled to Enabled.

--> You can add multiple users in enable.ldif like:


 

dn: cn=qasim1,cn=users,dc=hostname,dc=com

changetype: modify

replace: orclisenabled

orclisenabled: ENABLED


 

dn: cn=qasim2,cn=users,dc=hostname,dc=com

changetype: modify

replace: orclisenabled

orclisenabled: ENABLED


 

dn: cn=qasim3,cn=users,dc=hostname,dc=com

changetype: modify

replace: orclisenabled

orclisenabled: ENABLED


 

--> If you want to hide password in ldapmodify command for security reazons, you can simply add -q, like:


 

ldapmodify -h hostname -p 389 -D cn=orcladmin -q -c -f enable.ldif


 

It will ask password for orcladmin and will execute enable.ldif

No comments:

Post a Comment