# Locking a user using nsc api

**URL:** <https://techcommunity.softwareag.com/t/locking-a-user-using-nsc-api/187541>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-Add-on-Products, Natural-Security-and-Natural-SAF-Security, Natural-Other-Addons\
**Created:** [March 22, 2016, 5:07pm UTC](https://techcommunity.softwareag.com/t/locking-a-user-using-nsc-api/187541 "2016-03-22T17:07:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon70563098](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@anon70563098](https://techcommunity.softwareag.com/u/anon70563098)\
**Post date:** [March 22, 2016, 5:07pm UTC](https://techcommunity.softwareag.com/t/locking-a-user-using-nsc-api/187541/1 "2016-03-22T17:07:17Z")

</div>

There is a way to lock a user using a API call like nscus ? (Unix aix 7.1 , security 8.3.2)

---

<div class="post-metadata">

**Author:** ![Brian\_Johnson1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/brian_johnson1/32/163_2.png) [@Brian\_Johnson1](https://techcommunity.softwareag.com/u/Brian_Johnson1)\
**Post date:** [March 24, 2016, 1:12pm UTC](https://techcommunity.softwareag.com/t/locking-a-user-using-nsc-api/187541/2 "2016-03-24T13:12:19Z")

</div>

Yes, you can - at least if by lock you mean make a user inactive.

The code is generally like this:

PFUNCTION := ‘MO’  
PUSERID := #IN-USER  
PLOCKDATES(1,1) := _DATX  
\*  
CALLNAT ‘NSCUS’ PFUNCTION PUSERID PUSERID2 PRC PPFKEY(_)  
PPARM PPARM1 PPARM2 PTEXT(\*) PPARM3 PPARM4  
PNSC-MESSAGE

This is based on one of the PGMUSnnn examples.

---

<div class="post-metadata">

**Author:** ![anon70563098](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@anon70563098](https://techcommunity.softwareag.com/u/anon70563098)\
**Post date:** [March 29, 2016, 4:04pm UTC](https://techcommunity.softwareag.com/t/locking-a-user-using-nsc-api/187541/3 "2016-03-29T16:04:39Z")

</div>

Thank you Brian, i will develop a daily batch routine to verify users who dont logon for “n” days and lock it out (i was thinking in the same type of lock when a user type a wrong password n times) but your solution looks better.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:35pm UTC](https://techcommunity.softwareag.com/t/locking-a-user-using-nsc-api/187541/4 "2021-04-02T15:35:40Z")

</div>


