Service Desk Practitioners Forum
cancel

script to block users in HPSD

SOLVED
Go to solution
Highlighted
Pritam Majumder
Respected Contributor.

script to block users in HPSD

I want to block a no of users in HPSD. Is there any script available to do so?
7 REPLIES
George M. Meneg
Acclaimed Contributor.

Re: script to block users in HPSD

Hello,

It depends. Does these users have something in common that can group them together in a view?
menes fhtagn
Pritam Majumder
Respected Contributor.

Re: script to block users in HPSD

Actually I need to Block a no of users who have left the organisation. There is no grouping as such
LexTNS
Respected Contributor.

Re: script to block users in HPSD

Hi Pritam, If you can regocnize them on the fact (in a field) that they left the company you can make a view in which they all show and then use "change all" to check the switched off checkbox. After that they aren't able to log in anymore.
Hope this helps, Lex.
Pritam Majumder
Respected Contributor.

Re: script to block users in HPSD

Thanks. That is an option. But I do get a list of users from time to time which needs to be blocked. Thats why I am thinking of a script which can cater to that.
stoney_2
Respected Contributor.

Re: script to block users in HPSD

you should be able to use data exchange to block a large number of users. Use a script to call the data exchange. You'll have to do your import mapping and xls bit though.

cheers

peter
its a long way to the top if ya wanna
David L Anderso
Frequent Contributor.

Re: script to block users in HPSD

You can also use the SD API with the setDisabled method on the IAccount object to write a java servlet that would loop thru an array of accounts and block each one.

Or if you don't want to go to that trouble, you can write a SQL statement that sets the value of REP_ACCOUNTS.ACC_DISABLED = 1 for each of the accounts you want to block, but HP frowns on using SQL directly against the db. I had to write a script to block accounts that had a last PW modification date over 120 days old in order to satisfy our security folks.
Ondra Ernyei
Honored Contributor.
Solution

Re: script to block users in HPSD

Hello,

we're using sd_event and works fine:

sd_event -f inifile.ini -v name="usernameyouwanttoblock" block="1"

You'll have to define "name" and "block" in the appropriate import mapping.

I hope it helps,

Ondra