Unix script for checking the user account status

Hi All,
i have created one unix script to check the status of the user in diff databases.
#!/bin/ksh
useracctreport.txt if [ ! -f hh ];
then
echo "Database file does not exist"
fi
echo "Enter Username"
read USER
echo "Enter the password"
stty -echo
read PASS
stty echo
for j in `cat users`
do
j="`echo $j| tr '[a-z]' '[A-Z]'`"
for i in `cat hh`
do
sqlplus -s $USER/$PASS\@$i <<EOF >> useracctreport.txt
column USERNAME format a8
column ACCOUNT_STATUS format a5
!echo "*****User $j Status in $i DB*****"
select USERNAME,ACCOUNT_STATUS from dba_users where username=('$j');
select OBJECT_TYPE,count(*) from dba_objects where owner='$j' group by object_type;
EOF
done
done
In log file ,i get the below error when its unable to connect to the DB.
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] | [INTERNAL]
where <logon> ::= <username>[<password>][@<connect_string>] | /
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] | [INTERNAL]
where <logon> ::= <username>[<password>][@<connect_string>] | /
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
ERROR:
ORA-01017: invalid username/password; logon denied
Is there any way i can supress this error?
and is there any other way i can make this script faster.Thanks a lot for your help

Hi,
The failing line is
sqlplus -s $USER/$PASS\@$i <<EOF >> useracctreport.txtYou should test the connect statement you provide to sqlplus. For example:
CONSTRING=$USER/$PASS\@$i
echo Connect string used: $CONSTRING
sqlplus -s $CONSTRING <<EOF >> useracctreport.txtCheck the echoed value. It's malformed. Correct it appropriately.
Yoann.

Similar Messages

  • Script for Checking the Server Status

    Hi All,
         I just need the script for monitoring the server status through the WLST.My scenario:I have 2 server in Running State.If any one of the server get failed or in not RUNNING state then i use the script for starting that server automatically.I tried some of the script but it is not working properly .If any one have the sample script please share with me.
    Regards,
    Ove.

    Hi Syed,
    Replication state is very easy to see in 4.x and earlier. The last changenumber in the supplier changelog is visible (on the root DSE IIRC), and each consumer suffix has an operational attribute "copiedfrom" that tells you the name of the supplier, the database generation id, and the last change replayed from the supplier.
    So a script that compares the results of
    ldapsearch -h <supplier> -s base -b "" "objectclass=*" lastchangenumber
    and
    ldapsearch -h <consumer> -s base -b <base_suffix> "objectclass=*" copiedFrom
    will show you if a replica has fallen out of sync. It won't tell you more than how many changes behind the replica is, though, because pre-5.x changenumbers are sequential integers, not timestamps.
    However, the change that corresponds to the changenumber is clearly visible under the "cn=changelog" suffix. So if you look at the change itself you can see the timestamp on it.
    For more info on the status of replication, you should be able to query the agreements on the supplier. Those live under the "Netscape Machine Data Suffix", which you can also find on the supplier's root DSE:
    ldapsearch -h <supplier> -s base -b "" "objectclass=*" netscapemdsuffix
    And of course the error logs will usually tell you if replication is failing outright.
    I may be off on some of the attribute names, but if you do some investigating along these lines, you should be able to figure it out.

  • Script for checking the replication process in Netscape Directory Sever 4.1

    Hi,
    We are using Netscape Directory Server 4.1.6 in our production environment. Where we want to know is there any script available to check the replication process. Or can we write a script to check the process.
    Waiting for your replies at the earliest.
    Thanks,
    Syed A.

    Hi Syed,
    Replication state is very easy to see in 4.x and earlier. The last changenumber in the supplier changelog is visible (on the root DSE IIRC), and each consumer suffix has an operational attribute "copiedfrom" that tells you the name of the supplier, the database generation id, and the last change replayed from the supplier.
    So a script that compares the results of
    ldapsearch -h <supplier> -s base -b "" "objectclass=*" lastchangenumber
    and
    ldapsearch -h <consumer> -s base -b <base_suffix> "objectclass=*" copiedFrom
    will show you if a replica has fallen out of sync. It won't tell you more than how many changes behind the replica is, though, because pre-5.x changenumbers are sequential integers, not timestamps.
    However, the change that corresponds to the changenumber is clearly visible under the "cn=changelog" suffix. So if you look at the change itself you can see the timestamp on it.
    For more info on the status of replication, you should be able to query the agreements on the supplier. Those live under the "Netscape Machine Data Suffix", which you can also find on the supplier's root DSE:
    ldapsearch -h <supplier> -s base -b "" "objectclass=*" netscapemdsuffix
    And of course the error logs will usually tell you if replication is failing outright.
    I may be off on some of the attribute names, but if you do some investigating along these lines, you should be able to figure it out.

  • Script for getting the online/offline status

    Hi all,
    After enabling checkbox of "Enable assistive access device" is possible to get the online/ offline status.From Menu we will get the status.Without doing this i want to get the apple mail account online/offline status.hope some help scripts for this.

    [That script|http://discussions.apple.com/message.jspa?messageID=11012484#11012484] could change the Online Status of all mail accounts. The following one will just report their Online Status. Is this what you are (were) asking for?
    --BEGINNING OF SCRIPT
    tell application "Mail" to activate
    tell application "System Events" to tell process "Mail"
    set theMenu to menu "Mailbox" of menu bar 1
    if enabled of menu item "Take All Accounts Online" of theMenu then
    return "All accounts are currently offline"
    else
    return "All accounts are currently online"
    end if
    end tell
    --END OF SCRIPT

  • Executing a powershell script for checking duplicate users while creating a AD user throug ADUC console.

    Hi,
    I have a text file in which some SamAccountNames are present.I need to check the file while creating a new users through ADUC console.If a username that is going to create through ADUC console is present in the file, then it should prompt a message
    that the user is already present in the text file.
    Is there any possibility of contacting the powershell script from the ADUC console.If so, then while creating a new user through ADUC console, what is the proceedure for executing that powershell script.
    please provide me the approriate solutions.
    Thanks
    Prasanthi k

    Run the below Powershell Script for users are exist or not in AD. Later you can create the users.
    #Find Users exist in AD or Not?
    #Biswajit Biswas
    $users = get-content c:\users.txt
    foreach ($user in $users) {
    $User = Get-ADUser -Filter {(samaccountname -eq $user)}
    If ($user -eq $Null) {"User does not exist in AD ($user)" }
    Else {"User found in AD ($user)"}
    Active Directory Users attributes-Powershell
    http://gallery.technet.microsoft.com/scriptcenter/Getting-Users-ALL-7417b71d
    Regards~Biswajit
    Disclaimer: This posting is provided & with no warranties or guarantees and confers no rights.
    MCP 2003,MCSA 2003, MCSA:M 2003, CCNA, MCTS, Enterprise Admin
    MY BLOG
    Domain Controllers inventory-Quest Powershell
    Generate Report for Bulk Servers-LastBootUpTime,SerialNumber,InstallDate
    Generate a Report for installed Hotfix for Bulk Servers

  • Standard Report, for checking the PR approval status by a certain User

    Hello Experts,
                          Is there any standard report in the SAP where we can find out for the given managers, if level 1 approver is Mr. X, then which all has been approved by Mr. X and and pending with subsequent approvers?
    Please help.
    thanks and regards,
    Yawar Khan

    Hi,
    Yes, standard report is available for PR approval status list using T-code ME5A - List Display of Purchase Requisitions and the following input data's are given .
    Purchasing Group                  :    ___
    Scope of List                         :  ALV
    Plant                                       :  _____  (if required)
    -  Assigned Purchase Requisitions to be ticked.
    -  Released Requisition Only to be ticked.
    -  Requisition for overall Release to be ticked.
    -  Requisition for Item-wise Release to be ticked.
    Now execute the report and then report top layout button click for  'Release indicator' option selected for released status confirmation purpose.  If release indicator status is 'X' means PR released, otherwise PR is not released.
    Hope, it is useful for you.
    Regards,
    K.Rajendran

  • Kindly let me know the transaction for checking the Status of par.User?

    Kindly let me know the transaction for checking the Particular Users Status?
    I mean to say,Which Transaction is he into?
    Or Is he/She Logged on to a particular System?
    Regards,
    Shashank.

    Hi,
    Go to Transaction SM04.You will find the List of Users And the List of transactions ther are currently using.
    Regards,
    Sujit

  • Safari 5 seems to have slowed the OS for my Admin user account

    After installing Safari 5 (now 5.0.2), and after a few Safari hangs and force quits, my OS for my Admin user account has become slow. Opening folders and seeing the contents is slow; moving small documents from folder to folder is very slow; cutting and pasting text in a MS Word document sometimes takes two or three tries, as the text highlighting cursor function has slowed. (Interestingly, Safari's basic click and pageload functions seem to work fairly normally, but with the same highlighting and copy/paste slowness that affects all other programs. Also, my mouse pointer moves quickly as per normal.)
    However, I created a new user account as a test comparison and found that the new user account is NOT slow. It works perfectly fine.
    Any thoughts on what I should do? Is my original Admin account corrupted? Is it possible to simply move my personal files (Word docs, iTunes songs, bookmarks) to the new user account and then delete my original Administrator account?
    What should I do? Thanks everyone.

    Well, it was worth a shot.
    How full is your hard drive? Always a good starting point for diagnosing slowdowns.
    Sometimes running periodic maintenance scripts helps, because it cleans some caches that a Safari reset won't. The scripts are supposed to run automatically in the wee hours of the morning when most people are computing, but the problem is that they only run if the computer is on and not sleeping. Not too realistic.
    This article in an excellent series of "keep the Apple sweet" articles talks about the scripts and how to run them manually:
    http://thexlab.com/faqs/maintscripts.html
    They are less important in later incarnations of Mac OSX as some o the tasks they do were shifted to start-up, but doing them is worth trying.
    Also use Activity Monitor to check for a runaway background process. It's possible that this could affect only one user account. If you've not used Activity Monitor before, make sure you change its "Show" option from the default of "My Processes" to "All Processes" or you might miss some nasty troublemakers. Also click in the "%CPU" column header to sort by processor usage. With no user apps running, (basically an idling computer) no single process should demand more than ~5 percent of the processor. Let AM display for a few minutes while you watch it, as some processes toggle back and forth as they activate.
    Running any anti-virus software? Most does more Mac-harm than Mac-good.
    Keep us posted!
    A

  • Where we check the Project closing status?T.code for List of Closing Projec

    Dear Guru's,
    Where can we check the Project closing status? Can we change the closing status if want to do some modification, and what is the transaction code that we to view the list of closing project.
    Regards,
    Kalyan

    1.You can find the project status ( all the  status )  in any project maintenance transaction for ex. Run Cj20n > Open you project> on the basic data tab you will find the project status.
    ( If you want to see the status of other  PS oject than click on that object, similarly you will get the status of that object on Basic data tab. )
    2.Yes you can change the closing status of proejct for midification. path is clickon the object for which you want to change the closed object > Edit> Status--> Close --> Undo.
    3.For the list of Project status go to CN41
    on the projectno. input line click on multiple selection--> give the proejct no. list for which you wanted to see the  status. -->enter --> Excute.
    Report will open in screen. in that report go to toolbar and click on 'choose filed' button.(F5) -->one pop up window will open -->right handside scroll down in that window >select 'status' field and move it to left side>enter
    project status will be shown against you project list. you can verify the same in maintenance txn.
    If you have activated user status the same will also get populated.
    You can downlaod the same in Excle file path is  : Evaluation menu>export>save to file. ( via filtering in Excle you call do all the analysis realted to project status how amny are in clised status etc. )
    Regards
    Nitin

  • Script check the AD accounts without login 90 days and disable it only

    Dear All
    How to create a script to check the AD user accounts (windows 2008) without login 90  days and disable it.
    Regards
    PK

    Something like this should work (actually, it's probably better to use lastLogonTimeStamp, not lastLogon):
    Search-ADAccount -usersonly -accountinactive -timespan "90"
    After that you can either export them to a csv file or just delete them straight away. But remember about the recently created users issue.
    If you are looking into more advanced solution, I have got experience with Adaxes. here is an example of how to achieve what you want with it: http://www.adaxes.com/tutorials_AutomatingDailyTasks_AutomaticallyDeprovisionInactiveActiveDirectoryUsers.htm

  • User exit or a badi for checking the vendor email id in me22n on me29n

    hi all,
    can anybody suggest me a user exit or a badi  for checking the email id of the vendor in me21n or me22n or me29n.
    i.e. a user exit or a BADI which gets hit either at the time of creation or release of a purchase order.
    plz suggest me a solution its urgent.
    regards,
    santosh

    Hi Santosh,
    Have you looked BADI <b>ME_PROCESS_PO_CUST</b> or user exits <b>EXIT_SAPMM06E_016</b> / <b>EXIT_SAPMM06E_017</b>?
    Hope this will help.
    Regards,
    Ferry Lianto
    Please reward points if helpful.

  • Scripts for changing the address of the user when they have been in the box for 6 months

    Scripts for changing the address of the user when they have been in the box for 6 months
    If users are in a folder for deactivated users and disabled users in Active Directory, and been there for 6 moths do: change email address in exchange to existing email address.old 
    Anyone have suggestions on how I can go about it?

    What is this "box"?  What is this "folder" you're asking about?  You'll likely get a better answer if you use standard terminology.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • The connection was denied because the user account is not authorized for remote login

    Using Terminal Server 2008 not able to get non administrator users to login to the remote desktop. Have tried from Windows server 2008 and from Windows servers 2003. Get error login in "The connection was denied because the user account is not authorized for remote login" from Windows Server 2008. Error "The requested session access is denied" from Windows Server 2000.

    Is that seriously the only way to do this? Doesn't this render the "Allow log on through Terminal Services" GP Setting useless?
    I would like to know this answer, as well.  I have created a new AD group for my assistant admins called "Domain Admins (limited)".  I have added this group to the GP setting "Allow log on through Terminal Services", but the
    assistant admins cannot log in through RDP.  It 'feels like' this is all I would need to do.
    Craig
    Found some good info
    here. There are really two things required for a user to connect to a server via RDP. You can configure one of them via Group Policy but not the other.
    1) Allow log on through Terminal Services can be configured through Group Policy, no problem.
    2) Permissions on the RDP-listener must also be granted.  If your user is a member of the local Administrators group or the local Remote Desktop Users group then this is handled.  If you are trying to utilize a new, custom group (as I am),
    then there isn't a way to do this via group policy (that I have found).
    EDIT: Found the answer.  I am creating a blog post to outline the steps.  They aren't hard, but they're not self-explanatory.  It deals with the Restricted Groups mentioned above, but it's still automate-able using Group Policy so that you
    don't have to touch each computer.  I think the above poster (Andrey Ganev) got it right, but
    I had trouble deciphering his instructions.
    Here is my blog post that walks through this entire process, step-by-step.

  • What is the tracking ID for checking the status of a sent text message??

    i don't know what the tracking ID is for checking the status of a sent text message...

    You didn't need to post here and start a new thread; you could have just done a search, i.e.,
    https://community.verizonwireless.com/thread/455106

  • User exit for checking the vendor emailid in me22n or me21n

    hi all,
         can anybody suggest me a user exit for checking the email id of the vendor in me21n or me22n or me29n.
       plz suggest me a solution its urgent.

    hi yaan,
           i checked with the user exit that u suggested me, it is getting triggered, i am able to check whether the vendor email id is present or not, but this is happening all the time that is even when the user dont want to send a email to the vendor i.e. he just wants to print the purchase order, even at that time this user exit is getting triggered and giving a message that the vendor email id is not maintained.
      the reson why this is happening is there is no import parameter to this user exit which gives the "medium of data transfer"  the user has entered. if i get this parameter visible inside the user exit, then i can check this parameter inside the user exit and do the required operation.   i checked up with all the user exits in "me" package and even the other related packages but none of them is getting triggered,
      do u know a user exit or badi which imports this parameter and also gets triggered at the time of creation of purchase order.
      plz give me a solution.
    regards,
    santosh.

Maybe you are looking for

  • RE: G3 iBook transfer via firewire to MBP...questions

    hello everyone, forgive me if this is the wrong section...but can someone help me with this... i have transfered all my necessary files from my iBook to my MBP (via firewire)but now i can not get my old entrouge to over ride/replace the one on my MBP

  • Equipment/asset management with LabVIEW

    I would like to write a basic equipment/asset managment program with LabVIEW, since I just haven't liked the commercial ones that I have tried for various reasons. My question is how can I manage the information using LabVIEW...? Is there any way to

  • Are there any free remote desktop programs

    Are there any free remote desktop or remote assistance programs available for Panther? I only need a server for the Panther computer, as I would be helping that user, but he would not need to help me. I was wondering if anyone knew of any. I wanted t

  • I have a requirement for the Standard report like QA33

    Hi All I have a requirement for the Standard report like QA33. The requirement is that, in the output of QA33, The Requisitioner, Purchasing group and Tracking Number should be displayed Please give me suggestions to do this I searched for User Exits

  • XML Custom Parser

    I am tryint to write a custom XML parser but I am having trouble accessing the Value fields. I need to use one of the Value Fields to determine which parser I need to use for my custom Class Objects. Below is my sample code and a sample XML Document