Run script to remove user automatically

My mind is blank now. Can anyone provide an OS level example script to remove an oracle user automatically? OS: AIX 5.3L , Oracle 10g R2. The script should be called from OS level. Very appreciate.

to remove an oracle user automatically?Why ?
The script should be called from OS level
drop_user.sh :
export ORACLE_SID=MYDB
export ORACLE_HOME=/my_directories
sqlplus -s myuser/mypwd <<EOF
drop &1;
exit
EOFFrom OS prompt :
drop_user.sh MY_USER_TO_DROPNicolas.

Similar Messages

  • Need a Script for Removing User Profiles in Windows 7

    I am in need of a script that will allow me to remotely delete user profiles from multiple computers. I am an IT Admin over around 15-20 computers that are publicly used by many different people each day, and at least once a month we have to go into each
    computer individually..my computer, properties, profiles and delete them one by one. This is growing very tedious due to manpower and the number of computers we have to do this on. 
    I have absolutely zero knowledge in the scripting department so could somebody point me in the right direction on this? I would like to have a script that i can just run once a month or so and say "delete all profiles from computers x y and z that are
    over a few months old." Is this possible? Thanks in advance!

    Try this link - http://superuser.com/questions/643417/delete-user-profile-from-command-line-windows-7
    https://social.technet.microsoft.com/Forums/scriptcenter/en-US/7663ea51-9f4e-4fd7-9946-e16e65c3ed9d/remove-windows-7-user-profiles-via-powershell-script-initiated-on-logoff?forum=ITCG
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Running scripts from Java user permissions

    I have a web based application running on JBoss application server. It during its processing of certain requests has to call some cshell scripts using Runtime.exec(). Now it seems to be working fine in development environment, however on testing environment it seems to freeze. On further debugging, and digging up the issue it came up that it could be a permissions issue, as certain users have the permissions to run the scripts and some don't.
    The Question therefore would be that, once a script is executed from an app server, which user is used? and in order for the script to be executed who should be granted permissions.
    Thanks in advance.

    Peter__Lawrey wrote:
    When any application starts another application (java or otherwise) it does so as the same user by default.
    The user running the JBoss is the user used.
    This is how all OSes work (to my knowledge)
    Which operating system are you using?Thanks, in that case I have a second question. Is there a way to force a certain user? I mean somebody other than the one who started the app server programmatically?

  • Script to create user in OBIEE 10g

    In OBIEE 10g, is it possible to use a script to create users automatically.
    I need this option to import user from the LDAP because if the LDAP are not created in OBI adminsitration tool, they can´t enter in analyticas (BI Server error)

    I suggest you to read
    Oracle9i Database Performance Tuning Guide and Reference
    Release 2 (9.2)
    Part Number A96533-02
    Chapter 7. Using Plan Stability
    ~ Madrid

  • Need a script to delete user files and run on logout.

    Hi folks!
    I'm a total Mac novice so forgive me if I'm vague on anything here. I work in a library and we have recently acquired an iMac running Mountain Lion. The unit is primarily for use by Visually Impaired users however sighted folks can use it as well.
    What I need is something that will delete any files created/downloaded by the sighted users but that will not delete anyone else's files. I tried just using the Guest Account however that also deletes all the system preferences for that account including the dock setup which I need to stay the same.
    If possible I would like this to run on logout.
    For additional points anyone who can also find me something that will run automatically when the users sign in and will sign them out after 30 minutes would super spectacularly awesome.
    Thanks people!

    That being said, if you you still really want to do this you can create a logout hook and write a shell script to remove the files.  See "About Daemons and Services", Appendix B on writing a logout hook.
    But a far easier way is to create Account's login item that will cause a shell script to be launched to delete the files.  You can encapsulate the shell script so it runs as an application that can be added to the Login Items.  One such encapsulator is Platypus.
    Note, rather than delete them, if you want to ensure all the specific plists have specific settings, then create a master set of them and copy the master set into the Preferences directory (being careful to observe ownership and permissions settings of course).

  • Script to run against ALL AD users in a loop

    I am going to do a SharePoint upgrade this weekend from 2010 to 2013.
    I need this script to run against every Active Directory user automatically, not just one at a time. How do I get this get this script to do that? I figure I create a pipeline, I just don't know where.
    Here is the script:
    Param(
        [string]  $account = $(Read-Host -prompt
    "UserAccount")
    Add-PSSnapIn Microsoft.SharePoint.PowerShell
    foreach ($wa in get-SPWebApplication)
        Write-Host "$($wa.Name) | $($wa.UseClaimsAuthentication
        #http://technet.microsoft.com/en-us/library/gg251985.aspx
        $wa.UseClaimsAuthentication = $true
        $wa.Update()
        $account = (New-SPClaimsPrincipal -identity
    $account -identitytype 1).ToEncodedString()
        $zp = $wa.ZonePolicies("Default")
        $p = $zp.Add($account,"PSPolicy")
        $fc=$wa.PolicyRoles.GetSpecialRole("FullControl")
        $p.PolicyRoleBindings.Add($fc)
        $wa.Update()
        $wa.MigrateUsers($true)
        $wa.ProvisionGlobally()
    Please help me! Thank you!

    Hi,
    Need to do something like this
    $Users=Get-ADUser -filter *
    foreach ($User in $Users) {
    YOUR SCRIPT
    -Identity $Users
    YOUR SCRIPT
    YOUR SCRIPT
    YOUR SCRIPT
    Seidl Michael | http://www.techguy.at |
    twitter.com/techguyat | facebook.com/techguyat

  • Running script automatically at startup at system level

    Hi all,
    I am a newbie with MAC. I am looking for some application that is equivalent to Window's Task Scheduler - bascially, I have a bash script and I would like it to start running at startup and be always running in the background, no matter who logs into the computer, and whoever logged in can restrat the script if needed.
    Background info (if that helps understand what I am trying ot accomplish):
    I am using Selenium (a UI automation tool) to automate some web testing, and my script will be calling the Selenium library to start a server to listen for requests, and it will launch browser and run tests when a request comes in.
    Long story short about what I want:
    I would like to automate opening up a terminal and running a bash script when my MAC starts up, and have the script always running in the background regardless of which user is currently logged in, and I would like the user to be able to stop the script and restart it if it somehow gets stuck.
    I did some quick research and found out about Automator. I would like to find out/confirm if Automator is what and all I need? If not, what are my options out there?
    Any suggestion and advice would be greatly appreciated! Thank you so much for reading!

    I'm not sure whether this should be a LaunchDaemon or a LaunchAgent - if it requires user interaction as you sugest it should really be the latter, so that's what I'll show how to do.
    Open TextEdit, make sure the open document is set to plain text (not rich text), copy in the following text, then save it as user.bash_script.autostart in the folder /Library/LaunchAgents/.  Then restart the machine or load the plist using launchctl in terminal.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
              <key>RunAtLoad</key>
              <true/>
              <key>Label</key>
              <string>user.bash_script.autostart</string>
              <key>Program</key>
              <string>/path/to/bash script</string>
              <key>KeepAlive>
              <true/>
    </dict>
    </plist>
    This job will start the script as a daemon so that it's running for all users.  The KeepAlive key specifies that if the daemon quits launchd should automatically restart it.  It's up to you to make sure users have the correct permissions to quit the process if it gets stuck.
    Note: using a LaunchAgent means that a separate instance of this process will be created for each user who logs in, and that the process will not be running if no user is logged in.  if you need to have one running instance for all users you need to use a LaunchDaemon.  However, LaunchDaemons are not supposed to have user interaction, which it seems like you want.  more details would be helpful.

  • PS script to disable users / Audit and remove Groups / Hide from GAL have bits but need to put it together

    Hi All
    I am trying to get a script together to run against a specific OU (our disabled Users OU) to make the process of leavers more automated.
    I am trying to achieve the 4 main outcomes below
    1. Disable User account 
    2. Hide from GAL
    3. Export users group membership to a file based on SamAccountName
    4. Remove users from all groups except domain users
    I have some parts of this working from other peoples scripts i have found on the web but need to tie it all together which is proving to be beyond my basic scripting ability
    Below is what i have so far, this does disable users / hide from GAL and remove groups however as stated i would really like it to export the group membership to a file before removing them so i have a record should a mistake be made.
    $users= get-aduser -Filter {(Enabled -eq "True")} -SearchBase "ou=Disabled Accounts,dc=test2k8,dc=local"
    Function RemoveMemberships
    param([string]$SAMAccountName)
    $user = Get-ADUser $SAMAccountName -properties memberof
    $userGroups = $user.memberof
    $userGroups | %{get-adgroup $_ | Remove-ADGroupMember -confirm:$false -member $SAMAccountName}
    $userGroups = $null
    $users | %{RemoveMemberships $_.SAMAccountName}
    ForEach ($user in $users)
    set-aduser -identity $user.sAMAccountName -Enabled $false -replace @{msExchHideFromAddressLists=$true}
    exit
    If there is anyone here that can help i would be very grateful
    Many Thanks
    Nick

    Try this:
    $Users = get-aduser -Filter {(Enabled -eq "True")} -SearchBase "ou=DisabledAccounts,dc=test2k8,dc=local"
    Function Remove-GroupMembership
    [CmdletBinding()]
    param
    [parameter(ValueFromPipeline=$true)]
    $Identity
    process
    if ($Identity -is [string] -or !$Identity.memberof)
    $Identity = Get-ADUser $Identity -properties memberof
    Write-Verbose -message $Identity.samAccountname
    foreach ($Group in $Identity.memberof)
    Write-Verbose $Group
    Remove-ADGroupMember $Group -confirm:$false -member $Identity
    $Users | Remove-GroupMembership -verbose 4> c:\users\mmcnabb\desktop\groups.txt
    forEach ($User in $Users)
    set-aduser -identity $user.sAMAccountName -Enabled $false -replace @{msExchHideFromAddressLists=$true}
    It uses the verbose stream to redirect the groups out to a text file of your choice. Please note this is untested so please use with caution.

  • I have a MacBook that had Mcafee on it and went to great lengths to get it off.  Unfortunately after running all the remove scripts and support from mcafee, in my console it still shows com.apple.launchd{1} with message (com.mcafee.virusscan.VshieldEPoint

    I have a MacBook that had Mcafee on it and went to great lengths to get it off.  Unfortunately after running all the remove scripts and support from mcafee, in my console it still shows com.apple.launchd{1} with message (com.mcafee.virusscan.VshieldEPointInterface[7881]) Exeted with exit code:1  Then the next line says will start in 10 seconds and it repeats endlessly.

    Hi there,
    You're running an old version of Safari. Before troubleshooting, try updating it to the latest version: 6.0. You can do this by clicking the Apple logo in the top left, then clicking Software update.
    You can also update to the latest version of OS X, 10.8 Mountain Lion, from the Mac App Store for $19.99, which will automatically install Safari 6 as well, but this isn't essential, only reccomended.
    Thanks, let me know if the update helps,
    Nathan

  • How to run a FM using user wf-batch automatically

    Hai all,
    I have created one FM for updating production order number in a z-table.
    Whenever i create a production order the FM should be automatically run using wf-batch user and update the z-table.
    How i should do it?
    Regards,
    Kumar.

    Hi,
    you can also use RFC local destination used by workflow. It has name like LOCAL_WORKFLOW_XXX where XXX stands for client. So just call your FM with this destination.
    Cheers

  • Removing prompt to run scripts

    Hi,
    I wonder if there is a way to do the following in order to run a script:
    1. remove completely the prompt
    2. take the "current view- action pane" as the new prompt and coordinate this one to run the script with these parameters (at least taking the time dimension)
    Thanx in advance.
    Velázquez

    Nilanjan,
    Thanx for your response, in this case, i'd have to hard core every parameter in my script but by the time i run this, my calc is going to be made to every account, every month, every year, etc...  and this is something that I want to avoid.
    In your experience, is there any other possibility to perform this ?
    At least with a command ?
    Regards
    Velázquez

  • [SOLVED] Running a startup script as a user at boot once

    Hello!
    So, as the title suggests, I am trying to start a script as a specific user at boot. To avoid accidentally starting it multiple times, I don't want it to run every time to user logs in. So far I've looked into creating a custom systemd service to call a script as root then using 'sudo -u user script' to run said script.
    This almost worked, the script must have executed but, because it was starting a new task in a screen, it created a dead screen. Although I'm not entirely sure why (I suspect it has something to do with not running screen as the logged in user), I figured I would ask if anyone knew of a better way to do this. My solution so far is pretty convoluted.
    Side notes: This is running on a GUI-less server (hence the possibility of a user logging in multiple times or having multiple sessions open at once)
    Last edited by Lindenk (2013-07-09 15:33:45)

    Sure,
    Here's essentially the unit file -
    [Unit]
    Description=Runs a script to run a script to start a script to start a server
    [Service]
    ExecStart=/absolute/path/to/a/rootScript.sh
    [Install]
    WantedBy=multi-user.target
    And the root script
    #!/bin/bash
    #This script will run another script as the user 'server'
    sudo -u server /path/to/userScript.sh
    And the user script
    #insert possible setup stuff here
    screen -S serv -d -m /path/to/server/start.py
    #insert possible cleanup stuff here
    Also as a side note, I did already allow root to run commands as server without a password.
    EDIT: Another side note, the root script and user script do in fact work as intended when started individually. When running through systemd (at boot or not), the screen created is dead.
    Last edited by Lindenk (2013-07-09 14:36:54)

  • Run a powershell script on every user login/unlock

    Hi everybody
    I need to run a powershell (that opens an interactive dialog box) when every user log in or unlock session or remote connection to this server.  In other words it have to be run every time a user enters a credential. 
    I tried task scheduler, but it didn't work properly. I tried triggers like "on workstation unlock" and "on connection to user session". I change user and group to administrators but still it runs under the author user (me) . 
    I found out user login event id is 4801 and 4778. can I use these event ids to run powershell code? Can I check raising the event ids through my code? 
    any other idea please?
    Thanks in advance

    Im not going to block a logon! I want to run a powershell code for every user login. assume like a message after user login. this kind of message for me is showing to me after other users login.
    specifically this is a window from that I designed to execute on user login to show on the server and every user writes down in the text box the changes that is making on the server. this is a changes log solution to me. then I need to show every user to
    work properly.
    You can run a scheduled task at logon that can display a message.  You can define this task in Group Policy.
    You can also just use the standard user logon message which can also be defined in Group Policy.
    You can execute a script task whenever an unlock event happens.  This, too, can be defined in Group Policy.
    ¯\_(ツ)_/¯

  • How to remove the automatically recognized hyperlinks in PDF after converting from Word?

    Hi everyone!
    When converting Word to PDF, texts with "http", "www", or email addresses with "@" are automatically hyperlinked.
    The way Adobe Acrobat recognizes URLs is not by the text's underlying hyperlinks rather it is by the actual characters in the text.  If the text contains "http" or "www" it recognizes it as a URL address, if it contains "@", it recognizes it as an email address.
    I am aware that you could choose to disable the hyperlinks by going to Edit - Preferences - General - untick Create links from URLs. However, other users who have this ticked will still be able to click on the hyperlinks.
    In Word, you can specify whether to add a hyperlink or not, or to direct the hyperlink to a different path.  But in Adobe Acrobat, it automatically recognizes the hyperlink by its text.  I know it is possible to manually add a hyperlink to a PDF, but is it possible to remove the automatically recognized hyperlinks?
    Is there also some sort of ADM administrative template for this purpose?
    Thanks.
    .m.u.r.d.o.c.h.

    I was thinking it could be possible with a document-level script that
    removes all links, but then I saw that the link Acrobat adds are not real
    link objects, so a script can't remove them. Therefore I think the answer is
    no, you can't do it. The only way might be to use shorter addresses in order
    to confuse Acrobat into thinking they're just plain text. For example, use "
    google.com" instead of "http://www.google.com/". In my tests it remained as
    plain text.

  • "Run Scripts" giving a problem to create portal domain

    Hello All.
    I am new to weblogic portal development. Was trying to create my basic sample portal in weblogic_portal_10.3.4 with the help of documentation. I am getting in running scripts when I was creating the domain. I have followed the below steps, please help me if you find any issue with my steps.
    1. downloaded Weblogic_Portal_10.3.4 and installed in my windows 7 environment.
    2. launched eclipse for weblogic portal.
    3. opened portal prospective in eclipse.
    4. right click on server tab and selected "Oracle WebLogic Server 11gR1 (10.3.4)"
    5. opened "Domain Configuration Wizard"
    6. Selected "Create a new Weblogic domain" radio button.
    7. in the next screen for "Generate a domain configured automatically to support the following products"
    selected "Weblogic Portal 10.3.4" radio button
    8. in the next screen given the domain_name
    9. in the next screen provided the password/confirm-password for administrator user
    10. in the next screen selected JRocket SDK and development_mode for my domain.
    11. in the next screen just left all the default configuration for the datasources. ( non of the datasource is selected in their check boxes)
    12. in the next screen just clicked on "Next" button and "OK" on my popup
    13. in this screen "p13nDataSource" is selected on my left top window area, All 3 SQL Files are selected for loading database.
    Clicked on *"Run Scripts"*
    At this point i am getting an error saying : "CFGFWK-60839:  Database Load Failed!"
    java.lang.Exception: SQLException when executing file file:/C:/Oracle/Middleware/wlportal_10.3/p13n/db/derby/seq_drop_tables.sql
         at com.oracle.cie.domain.jdbc.JDBCDataLoader.load(JDBCDataLoader.java:183)
         at com.oracle.cie.wizard.domain.gui.tasks.JDBCConfigGUITask$LoadDatabaseThread$1.run(JDBCConfigGUITask.java:1673)
    Caused by: java.sql.SQLNonTransientConnectionException: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
         at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
         at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
         at com.oracle.cie.domain.jdbc.JDBCConnectionTester.createConnection(JDBCConnectionTester.java:272)
         at com.oracle.cie.domain.jdbc.JDBCDataLoader.load(JDBCDataLoader.java:154)
         ... 1 more
    Caused by: org.apache.derby.client.am.DisconnectException: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
         at org.apache.derby.client.net.NetAgent.<init>(Unknown Source)
         at org.apache.derby.client.net.NetConnection.newAgent_(Unknown Source)
         at org.apache.derby.client.am.Connection.<init>(Unknown Source)
         at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
         at org.apache.derby.client.net.NetConnection40.<init>(Unknown Source)
         at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown Source)
         at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
         at com.oracle.cie.domain.jdbc.JDBCConnectionTester.createConnection(JDBCConnectionTester.java:273)
         at com.oracle.cie.domain.jdbc.JDBCDataLoader.load(JDBCDataLoader.java:154)
         at com.oracle.cie.wizard.domain.gui.tasks.JDBCConfigGUITask$LoadDatabaseThread$1.run(JDBCConfigGUITask.java:1674)
    Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
         at java.net.Socket.connect(Socket.java:529)
         at java.net.Socket.connect(Socket.java:478)
         at java.net.Socket.<init>(Socket.java:375)
         at java.net.Socket.<init>(Socket.java:189)
         at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:206)
         at org.apache.derby.client.net.OpenSocketAction.run(Unknown Source)
         at org.apache.derby.client.net.NetAgent.<init>(Unknown Source)
         at org.apache.derby.client.net.NetConnection.newAgent_(Unknown Source)
         at org.apache.derby.client.am.Connection.<init>(Unknown Source)
         at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
         at org.apache.derby.client.net.NetConnection40.<init>(Unknown Source)
         at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown Source)
         at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
         at com.oracle.cie.domain.jdbc.JDBCConnectionTester.createConnection(JDBCConnectionTester.java:272)
         at com.oracle.cie.domain.jdbc.JDBCDataLoader.load(JDBCDataLoader.java:154)
         at com.oracle.cie.wizard.domain.gui.tasks.JDBCConfigGUITask$LoadDatabaseThread$1.run(JDBCConfigGUITask.java:1673)
    CFGFWK-60839:  Database Load Failed!
    Please help me if you find any problem with the steps that I am following to create my weblogic_portal_domain.
    I was following the steps mentioned at : http://docs.oracle.com/cd/E15919_01/wlp.1032/e14252.pdf to create my domain to start portal development.

    Those are the WLP 10.3.2 instructions. But, the 10.3.4 instructions in the tutorial (http://docs.oracle.com/cd/E26806_01/wlp.1034/e14252/setup_dev_env.htm#i1014619) are wrong, too.
    In 10.3.4, with derby, Run Scripts doesn't work any longer; it should still work the other database (Oracle, SQL Server, etc.). Instead, for derby, just create the domain, accepting any warning dialogs about databases that come up. After that finishes, in the domain directory, run create_db.cmd (on windows) or create_db.sh (on *nix and Mac). It should create the derby database files in the domain, and include everything needed.
    I'll send a note to get the docs updated.
    Greg

Maybe you are looking for

  • Pages to ePub

    This was the subject of my query of 2 June 2010. At that time, it sounded like a most fuzzy subject. Today, ePub has become an export option for Pages authors. Meanwhile, I discovered that it's a trivial task to convert a Pages document manually into

  • Unable to connect Ipad to wifi.

    I am trying to connect the Ipad  to a new network other than the one I usually use.password/username is correct,I see the network sign going round & round trying to connect but it doesnt seem to connect.Even tried to reset network.Any thing else I ne

  • SD questions - very urgent

    kindly send me SD Questions [email protected] thanks

  • Acc Entrie in Inter Company STO

    Dear All, What are the acc entries we need to get in case of Inter Company STO, like when we do the GR against PO we will get Stock acc Dr & PL-vendor will get Cr. I want to know for these below transactions.... When we do the Goods Issue from Supply

  • OSPF equal cost - loops

    Hi Please see attached diagram. When I traceroute from the Cisco 892 router (on the top) to an 10.31.48.0 address the packages is looped between the two cisco 2821 routers two times before the package is delivered. Type escape sequence to abort. Trac