on 01-27-2011 10:56 PM
I need to lock users out of the system before I start up SAP. If the below script unlocks users can someone tell me how to lock all users?
update <sid>.USR02 set UFLAG=0 where BNAME='users' and MANDT=<client number>
And with an exception to keep some users unlocked.
Hi Chris,
I would suggest you to first lock all users and then unlock the needed users;
To lock:
update <sid>.USR02 set UFLAG=128 where BNAME='users' and MANDT=<client number>
The above query will lock all users, then run a separate query to unlock the BASIS or required users.
You can put both the queries in a script.
Regards,
SBK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So if I want to lock all users I just have to enter BNAME='users' and if I want to unlock an individual I enter there username in BNAME='csoden' for example?
update <sid>.USR02 set UFLAG=128 where BNAME='users' and MANDT=<client number>
I found this somewhere else can someone confirm its correct for me-
0 Not Locked
32 Locked Globally By Administrator
64 Locked Locally By Administrator
128 Locked Due To Incorrect Logons (Limited Term)
Thanks for your help
To lock or unlock users:-
To lock individual users-
update <sid>.USR02 set UFLAG=64 where BNAME='USERNAME' and MANDT=<CLIENT NUMBER>
To lock all users-
update <sid>.USR02 set UFLAG=64 where MANDT=<CLIENT NUMBER>
To unlock users change the UFLAG value to 0 in either script.
UFLAG values-
0 Not Locked
32 Locked Globally By Administrator
64 Locked Locally By Administrator
128 Locked Due To Incorrect Logons (Limited Term)
In some cases when running the script it will throw an error about sr1.USR02. This is either due to the SID/Schema needing to be in uppercase ie; SR1.USR02 or not being needed at all ie; USR02
Hi Chris,
Yes you are absolutely right. Lock all users by not including bname field in the query.
update <schema>.usr02 set uflag=64/128 where mandt='client no';
Then you can unlock individual users by setting uflag='0' and specifing the users in the bname field
update <schema>.usr02 set uflag=0 where bname ='DDIC' and mandt='client no';
Regards,
SBK
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.