Get list of files and programs touched by AS400/iSeries service account - sql

I am trying to get a list of the programs (RPG/CL/SQL) and files a service account on the iSeries has touched. The idea is that having this list we can tie specific permissions (I know this will really complicate things) to the user account in order to achieve a more secure application specific service account. Is there any way to do this and maybe get a report by running a command. Maybe there is a SQL statement?
Please excuse me if my terms are not appropriate, I am still new to the iSeries.

The audit journal will have what you are looking for....if so configured.
http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/rzarl/rzarlusesecjnl.htm
The newest 7.1 TR includes stored procedures to allow easy read of journals.
https://www.ibm.com/developerworks/community/wikis/home/wiki/IBM%20i%20Technology%20Updates/page/DISPLAY_JOURNAL%20(easier%20searches%20of%20Audit%20Journal)
Charles

So though Charles' answer might be the one one should set up to get a thorough report. I wound up doing the following as suggested by one of my peers.
Please note that my goal though not properly explained as so, was to create an application specific user/service account for a program. This is to avoid using one with many privileges and thus gain some security.
1.Go through the source code (in my case classic ASP) and jot down all the names of the procedures used by that program.
2.Create a CL program that outputs the program references to a display file. Then export the file's contents onto Excel and massage where necessary.
PGM
DSPPGMREF PGM(MYLIB/PGM001) OUTPUT(*OUTFILE) OUTFILE(MYLIB/DSPPGMREF) OUTMBR(*FIRST *REPLACE)
DSPPGMREF PGM(MYLIB/PGM002) OUTPUT(*OUTFILE) OUTFILE(MYLIB/DSPPGMREF) OUTMBR(*FIRST *ADD)
ENDPGM
I was told however that service programs references cannot be displayed with DSPPGMREF. So the following was done for those.
PGM
ADDLIBLE LIB(ABSTRACT) POSITION(*LAST)
MONMSG MSGID(CPF0000)
WRKOBJR OBJ(SRVPGM01) OBJTYPE(*SRVPGM) OUTPUT(*OUTFILE) OUTFILE(MYLIB/WRKOBJR) MBROPT(*REPLACE)
WRKOBJR OBJ(SRVPGM02) OBJTYPE(*SRVPGM) OUTPUT(*OUTFILE) OUTFILE(MYLIB/WRKOBJR) MBROPT(*ADD)
WRKOBJR OBJ(SRVPGM03) OBJTYPE(*SRVPGM) OUTPUT(*OUTFILE) OUTFILE(MYLIB/WRKOBJR) MBROPT(*ADD)
ENDPGM
Thank you for all your help. I apologize that my answer is a little more specific than my question but in the end this was what I wanted to achieve, I had to generalize to ask the question. I'd thought i'd post post my answer anyways in case it helps someone in the future.

Related

Visual Basic - How do you store variables after closing the console?

I've been facing some problems in one of my coding tasks. The question asks me to "store two usernames and passwords after closing the console. These accounts will represent two users that have already registered."
I was told to create a simple registration system for a practice exam paper. I gave the user the option to register an account, however, (pre-made) registered accounts are not saved after console closure.
Do anyone of you know how to store these variables? It would help me solve a few other problems regarding different tasks.
Thanks!
I assume that "coding task" refers to some school related work, so you do not need to consider security questions.
Just write the username ans passwort combination into a text file. Writing to and reading from a text file should be straight forward. A bit more sophisticated would be a database, sqlite is quite easy for this task.
If you get stuck at coding, just post your code here.

SQL Anywhere 12 Log Searching

We have an ERP Program used to create and manage stock / orders. Somehow an order has vanished - this should not be possible. It should be possible to cancel an unwanted order, but never delete it completely.
The order in question was created, printed and sent to a customer - and then disappeared. I know the Primary key and Table info, and want to search the log to see if this was somehow deleted, or perhaps there was a rollback.
How can I translate/search the log in this way?
Please note: I did not write this program, and its not my job to fix it.
I just need to diagnose the issue and contact the SW Vendor, if required, and have them fix it. As such I cannot post any code.
With so little information it is hard to give a definitive answer.
I'd start by searching the regular logs. If you have some kind of audit trail mechanism that would be a great help!
If a search through the regular logs doesn't find you the answer then I would:
Get a copy of the database
Go through the REDO logs using the appropriate DBA tools. Since I'm not an sqlanywhere DBA I would get help from one.
When I found the place in time where the order was deleted I would find any other information I could get. The user that did the commit or users that where logged on at the time (I don't know exactly what kind of information you can get here). Also, go back to the other logs you may have and check around that time stamp.
To learn exactly how to go through the redo logs of an SQL Anywhere database you should first try your google luck and then ask in Database Administrators.
Solved!!!!
The Sybase Central tool has an option (which I couldn't find in the manual and missed the first time I looked), which can translate a log file into a series of statements and create a *.SQL file.
Tools -> SQL Anywhere -> Translate Log File -> Follow wizard (which hopefully for you is in a language that you speak, for me it was not).

Can I use an API such as chef to automatically create, name and set passwords to multiple servers?

I am new to this so forgive me for not understanding the lingo.
I have been using rackspace cloud control panel to build multiple virtual servers, i use them for maybe a couple of hours then i delete them. I need these servers to all have specific and unique names such as: "server1, server2, server3, etc." I also need them to have a specific password unlike the randomly generated password that is assigned by default.
I have been creating each individual server manually (based on an image that's set up) then I have to go back and reset the password andreboot all of them. Doing each one manually is a bit time consuming and I'm sure there is an easier way. Please help me figure this out.
I've been doing some searching but I haven't found anything too relevant to my problem on top of that I'm not too familiar with programming and such.
Basically what I'm looking to do is automatically create these servers with their appropriate names and passwords already built in from the start. I'm not sure if some sort of "API" is the answer, or if there's some sort of script that can be written, or both.
Any assistance is much appreciated.
thanks,
Chris

Noob Guidance on a Parallel Task Workflow (without Visual Studio)

This is going to be my first workflow, and I could use a little guidance.
I have a list I'm using for requests when a user needs their profile changed (eg: change of office location). The change has to be done in AD, PeopleSoft, and another database. Right now, I have it set up so requesters submit an item to a list, and Alerts go out to the different people responsible for making the updates in AD, PeopleSoft, etc. However, there has been enough frustration with missed emails and the like that I've been asked to track via workflow.
So essentially, I need to track a request that goes out to multiple users who will then need to confirm that the task has been completed. I found !(http://officeimg.vo.msecnd.net/en-us/files/989/238/ZA102615287.jpg), which is a very good representation of what I want to do, but does a very confusing job of explaining how to do it: http://office.microsoft.com/en-us/sharepoint-help/all-about-approval-workflows-HA102771433.aspx
Can someone point me to the workflow type that I need and the steps to implement? OOB/SPDesigner please, I don't have VS on my machine.
Thanks,
Scott
I will start by saying that implementing parallel tasks in a single workflow is hard.
What you can do is customise the OOB approval workflow (the one mentioned in the article) to suit your needs. This will give you an insight on how Sharepoint Workflows work and are designed.
It will look confusing at start (very confusing) since like i said is a complex workflow to setup, until you start to understand how it works.
make sure you make a copy of the approval workflow before modifying it so you can still use it if needed.

Unzip HTML Email Bodies from a SQL Server database

I am in the process of migrating from a recruitment ATS called Bullhorn, who also acted as our mail server. We have been provided with a backup of our data which includes all our emails stored in a table - so far so good. However, each of those emails' bodies is stored in the database table as an Image type as a zipped binary (Not so helpful).
I'm pretty stumped with how to get this stuff out. There is a forum in which there is a thread dedicated to this but predictably Bullhorn are not so enthusiastic spending time supporting customers who are migrating away. Here is the thread: http://supportforums.bullhorn.com/viewtopic.php?f=34&t=1672
As I explain in that thread, I have used a program called Chilkat with which I can successfully read a table row, decompress the Email Body Column and display the raw HTML in the console window. But now, I don't really know where to go. I've read in to Datasets and Table Adapters but I'm not too sure how I can get the Chilkat software to work on data within that dataset.
So, I wonder if anyone can help out with this and provide some guidance?
Or.... I've been reading about using SQL to store binaries and it seems it has it's own compression - so could I use a CLR as a stored procedure to be able to give better access to this data.
Ultimately, I'd like to be able to output this in to either a CSV file or use GeniusConnect to recreate an Outlook file - ultimately ending up in Gmail.
Any help will be greatly appreciated.
(Originally posted not being logged in - added this to stop it being flagged as a duplicate)
Thanks!
Chris