Reset DB user with a script

Hi All,
I'm trying to make a script to change the password of a DB user.
I have this now:
cd /oracle/VIS/db/tech_st/11.1.0/
. ./VIS_linux4.env
sqlplus / as sysdba
alter user xxtestuser identified by xxtestuser;
exitWhen I run the script the alter user part is not executed, it stops after starting sqlplus.
What do I need to change in my script?
Thank you.

Using << anything will redirect stdin to the shell script, as a so-called here document, until anything is encountered, where stdin goes back to normal.
Has nothing to do with Oracle and can be found in information on the bash shell or the Korn shell.
Exp is an obsolete utility in Oracle 10g and higher, and it is a command-line utility, so it should be called after EOF or before the call to sqlplus
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • Need help with a script applied by GPO

    Hello,
    I need to automate WebFeed insertion for Remote App Users at user logon.
    RDS 2012 R2 in place. Remote Apps are provided to W7 clients.
    Currently, WebFeed link must be inserted manually in each user's Control Panel\RemoteApp and Desktop Connections. There
    is no straight forward way from Microsoft.
    But there is a script and instruction I found on web...
    I followed the instruction... Created GPO. GPO applies to user but nothing happens.
    Can somebody check the script and the instruction that I could wrongly applied.
    In instruction there is no word about changing something in the script but only wcx file that the script should
    use.
    The script is below and here is my .wcx file:
    <?xml version="1.0? encoding="utf-8? standalone="yes"?>
    <workspace name="Enterprise Remote Access" xmlns="http://schemas.microsoft.com/ts/2008/09/tswcx" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <defaultFeed url="https://my_webserver_real_FQDN/rdweb/Feed/webfeed.aspx" />
    </workspace>
    I changed the quotes to vertical (") from (”) that
    were in my wcx when copied the lines from web.
    Still not works.
    I
    checked Application log, PowerShell and RemoteApp in eventviewer under user session
    Everything is clean.
    Were I can check the script execution log?
    When the user with applied script logs in, the icon of Remote
    connection appears for 10 seconds on the task bar and disappears.
    Looks like it's trying...
    Check please if the script really should not be touched and provide some troubleshooting
    steps.
    Thanks!
    INSTRUCTIONS from
    the link:
    http://www.concurrency.com/infrastru...rver-2012-rds/
    "Unfortunately
    Windows 7 clients are out of luck here. If you really want to use GPO to deploy
    RemoteApps to Windows 7 clients, then you have to jump through a few
    hoops.
    Create a new GPO and under User ConfigurationPoliciesWindows
    SettingsScripts, double click Logon and click the
    Show Files
    button. This will open an explorer window where you can copy files that will be
    saved within this GPO. Download the
    Install-RADCConnection.ps1 script from the TechNet gallery and
    save it there. Also create a new Text file named something like feed.wcx,
    open it in Notepad and paste in the following three lines of text:
    <?xml
    version=”1.0″ encoding=”utf-8″ standalone=”yes”?>
    <workspace
    name=”Enterprise Remote Access” xmlns=”http://schemas.microsoft.com/ts/2008/09/tswcx”xmlnss=”http://www.w3.org/2001/XMLSchema”>
    <defaultFeed
    url=”https://rds.domain.com/RDWeb/Feed/webfeed.aspx”
    />
    </workspace>
    Now select the PowerShell Scripts tab and
    click the Add button.
    Click Browse and select the .ps1 file and
    for the parameters enter the name of the wcx file. Click OK twice and you are
    ready to scope that policy to a set of users.   
    <#
    .SYNOPSIS
    Installs a connection in RemoteApp and Desktop Connections.
    .DESCRIPTION
    This script uses a RemoteApp and Desktop Connections bootstrap file(a .wcx file) to set up a connection in Windows 7 workstation. No user interaction is required.It sets up a connection only for the current user. Always run the script in the user's session.
    The necessary credentials must be available either as domain credentials or as cached credentials on the local machine. (You can use Cmdkey.exe to cache the credentials.)
    Error status information is saved in event log: (Applications and Services\Microsoft\Windows\RemoteApp and Desktop Connections).
    .Parameter WCXPath
    Specifies the path to the .wcx file
    .Example
    PS C:\> Install-RADCConnection.ps1 c:\test1\work_apps.wcx
    Installs the connection in RemoteApp and Desktop Connections using information
    in the specified .wcx file.
    #>
    Param(
    [parameter(Mandatory=$true,Position=0)]
    [string]
    $WCXPath
    function CheckForConnection
    Param (
    [parameter(Mandatory=$true,Position=0)]
    [string]
    $URL
    [string] $connectionKey = ""
    [bool] $found = $false
    foreach ($connectionKey in get-item 'HKCU:\Software\Microsoft\Workspaces\Feeds\*' 2> $null)
    if ( ($connectionKey | Get-ItemProperty -Name URL).URL -eq $URL)
    $found = $true
    break
    return $found
    # Process the bootstrap file
    [string] $wcxExpanded = [System.Environment]::ExpandEnvironmentVariables($WCXPath)
    [object[]] $wcxPathResults = @(Get-Item $wcxExpanded 2> $null)
    if ($wcxPathResults.Count -eq 0)
    Write-Host @"
    The .wcx file could not be found.
    exit(1)
    if ($wcxPathResults.Count -gt 1)
    Write-Host @"
    Please specify a single .wcx file.
    exit(1)
    [string] $wcxFile = $wcxPathResults[0].FullName
    [xml] $wcxXml = [string]::Join("", (Get-Content -LiteralPath $wcxFile))
    [string] $connectionUrl = $wcxXml.workspace.defaultFeed.url
    if (-not $connectionUrl)
    Write-Host @"
    The .wcx file is not valid.
    exit(1)
    if ((CheckForConnection $connectionUrl))
    Write-Host @"
    The connection in RemoteApp and Desktop Connections already exists.
    exit(1)
    Start-Process -FilePath rundll32.exe -ArgumentList 'tsworkspace,WorkspaceSilentSetup',$wcxFile -NoNewWindow -Wait
    # check for the Connection in the registry
    if ((CheckForConnection $connectionUrl))
    Write-Host @"
    Connection setup succeeded.
    else
    Write-Host @"
    Connection setup failed.
    Consult the event log for failure information:
    (Applications and Services\Microsoft\Windows\RemoteApp and Desktop Connections).
    exit(1)
    --- When you hit a wrong note its the next note that makes it good or bad. --- Miles Davis

    Use GPP for this. Do not use a script.  Post your issues in the GP forum.
    You should also visit the RDS forum to get information on how to distribute remote app links.
    ¯\_(ツ)_/¯

  • How can I compile all functions, procedures and packages with a script?

    I need to compile all functions, procedures and packages of 5 schemas (users) with a script.
    How can I do it?
    Thanks!

    you can create a script to select all invalid objects in those schemas Since Oracle 8 introduced NDS this approach has struck me as a trifle old fashioned. It's much simpler to loop round the query in PL/SQL and use EXECUTE IMMEDIATE to fire off the DDL statements. No scripts, no muss, no fuss.
    Having said that, the problem with this approach and also with using DBMS_UTILITY.COMPILE_SCHEMA is that they do not compile all the invalid objects in dependency order. This may result in programs being invalidated by the subsequent compilation of dependencies. This is due to the introduction of Java into the database.
    The UTLRP script is much better, because it (usually) avoids cyclic references. But you still may need to run it more than once.
    In general it is better to avoid sledgehammer recompilations (like DBMS_UTILITY.COMPILE_SCHEMA, which starts by invalidating all the objects). If we have twenty invalid objects, nineteen of which are dependencies of the twentieth, we actually only need to recompile the master object, as recompiling it will trigger the recompilation of all the others.
    Cheers, APC

  • How can I get a list of users with reset password ability?

    We are trying to tighten our security, but thanks to the environment we are in this is a bigger task than it should be. As part of this I have been asked to get a list of users who have the ability to reset other users passwords. there are the obvious suspects,
    domain admins, service desk etc., but we also appear to have random people who can do this because of a requirement during test or development stages way back. Is there a way to get this, I looked at using powershell but there doesn't seem to be much out there
    to give me a pointer, things like ADManager+ do not work, when I try to search on permissions it sits there doing nothing then crashes.
    Is there a way to build a function using powershell that can do this or is there some third party cmdlet or app that will provide me this info?
    Any help gratefully accepted.

    Hi,
    Based on my knowledge, except for those default groups users, such as domain admins and enterprise admins and so on, have reset password ability for other users, we can use delegation control to give other common users permissions to reset password for others,
    to view or delete Active Directory Delegated Permissions, please go through the below article:
    https://social.technet.microsoft.com/wiki/contents/articles/6477.how-to-view-or-delete-active-directory-delegated-permissions.aspx
    And if you were editing single user's security tab to give specific users reset password permissions, then I think we should create a script to get all those users, for scripting, please also post in the official scripting guys forum:
    https://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG
    Regards,
    Yan Li
    Regards, Yan Li

  • HT4798 I'd haven't been able to reset my password with my apple id, neither with the steps described in this article, what else can i do to reset my os x user password, thanks

    hi all,
    I have upgraded my macbook pro 13-inch mid 2010 with
    Mac OS X Lion 10.7.5 (11G63)
    and now my user account password is not working and i have tried to replaced it with my apple id as described on this web but it's been fruitless, what other option do i have to reset my user account password?
    thanks

    Welcome to the Apple Support Communities
    If you can't use your Apple ID to reset the user password, use this alternative method > http://discussions.apple.com/docs/DOC-4101

  • How to give readonly Permission rights to 1000 users with button using powershell script?

    $site = Get-SPSite
    -Identity "http://mysite/"
    $user = Get-SPUser
    -Identity "mydomain\myuser"
    -Web $site.RootWeb
    $assignment = New-Object
    Microsoft.SharePoint.SPRoleAssignment($user)
    $role = $site.RootWeb.RoleDefinitions[[Microsoft.SharePoint.SPRoleType]::Reader]
    $assignment.RoleDefinitionBindings.Add($role);
    foreach ($web in $site.AllWebs)
        if ($web.HasUniquePerm)
            $web.RoleAssignments.Add($assignment)
    With above script I can give Readonly permission to the users...but at a time I can give permission to only one user...Actually 1000 users requires these permissionMy requirement is I will have a textbox and a button.I will enter username in textbox
    and when i clicked button the required permission should be assigned to the user given in the textbox...can you please tell how can i achieve this........how make to run powershell script when button is clicked.

    Hello,
    Instead of applying security to user level, it'll be better to create a SharePoint group where you will add the users. and use the outof the box interface to give permissions.
    and for your button, just add the direct link to add user
    http://serverurl/_layouts/15/aclinv.aspx?GroupId=7&IsDlg=1 
    replacing the group ID by the id of your new group (you can see it in the url when your are in the group)
    Best regards, Christopher.
    Blog |
    Mail
    Please remember to click "Mark As Answer" if a post solves your problem or
    "Vote As Helpful" if it was useful.
    Why mark as answer?

  • Script Add bulk user with CSV, and set expiration date

    After importing the AD module, the line:
    Set-ADAccountExpiration -identity JohnDoe -timespan "365"
    Works just fine, but how would you automate this with a script that would read a csv-file. The -identity cmd dosen't seem to like my $SAM setup. Perhaps it's a better way to get-aduser and pipe it to set-accountexpiration. Is there a swift way to add the
    expire date to the user I just created with my CSV-file?
    Thanks!

    Thank You!
    You're very welcome.
    -AccountExpirationDate parameter of New-ADUser only seem to work with -DateTime, a specific date, while -TimeSpan is optimal for this solution.
    You can use Get-Date's AddDays method to generate a datetime object for use in this situation, see the code I'm posting below for an example.
    Now on to the next challange to warn me when they reach "32" days before expiration. Was thinking of running a Task Scheduled bath file that could collect number of days left and report it if below the mentioned days.
    Here's one method you can use for finding these users:
    $cutoffDate = (Get-Date).AddDays(32)
    Get-ADUser -Filter * -SearchBase 'OU=Users - TEST,DC=domain,DC=com' -Properties AccountExpirationDate |
    Where { $_.AccountExpirationDate -and $_.AccountExpirationDate -lt $cutoffDate }
    Just so you're aware, we generally try to keep threads to a single question.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Windows Server 2008 R2: Script create multi users with Windows Powershell

    Dear All,
    I have windows server 2008 R2 Active Directory Domain Service. I want to create multi users by using Windows PowerShell.
    Could you guide?
    BR,
    Khemarin Set
    [email protected]

    Dear Awinish,
    Your link very my solution. but i'm very basic with Powershell and I never have experience with it.
    This is the link original script that you are provide:
    function Select-FileDialog 
    param([string]$Title,[string]$Directory,[string]$Filter="CSV Files (*.csv)|*.csv")
    [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
    $objForm = New-Object System.Windows.Forms.OpenFileDialog
    $objForm.InitialDirectory = $Directory
    $objForm.Filter = $Filter
    $objForm.Title = $Title
    $objForm.ShowHelp = $true
    $Show = $objForm.ShowDialog()
    If ($Show -eq "OK")
    Return $objForm.FileName
    Else
    Exit
    $FileName = Select-FileDialog -Title "Import an CSV file" -Directory "C:"
    $ExchangeUsersOU = "OU=ExchangeUsers" # I don understand, I have all users are store in all-users ou
    $domain = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()
    $DomainDN = (([System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()).Domains | ? {$_.Name -eq $domain}).GetDirectoryEntry().distinguishedName
    $final = "LDAP://$DomainDN"
    $DomainPath = [ADSI]"$final"
    $cOU = $DomainPath.Create("OrganizationalUnit",$ExchangeUsersOU)
    $cOU.SetInfo()
    $UserInformation = Import-Csv $FileName
    $OUPath = "LDAP://$ExchangeUsersOU,$DomainDN" # I don understand
    $UserPath = [ADSI]"$OUPath"
    Write-Host "---------------------------------------------------------------"
    Write-Host "Creating LAB Users"
    Write-Host ""
    Write-Host "---------------------------------------------------------------"
    Foreach ($User in $UserInformation){
    $CN = $User.samAccountName
    $SN = $User.Surname
    $Given = $User.givenName
    $samAccountName = $User.samAccountName
    $Display = $User.DisplayName
    $LABUser = $UserPath.Create("User","CN=$CN")
    Write-Host "Creating User: $User.samAccountName"
    $LABUser.Put("samAccountName",$samAccountName)
    $LABUser.Put("sn",$SN)
    $LABUser.Put("givenName",$Given)
    $LABUser.Put("displayName",$Display)
    $LABUser.Put("mail","$samAccountName@$domain")
    $LABUser.Put("description", "Lab User - created via Script")
    $LABUser.Put("userPrincipalName","$samAccountName@$domain")
    $LABUser.SetInfo()
    $Pwrd = $User.Password
    $LABUser.psbase.invoke("setPassword",$Pwrd)
    $LABUser.psbase.invokeSet("AccountDisabled",$False)
    $LABUser.psbase.CommitChanges()
    Write-Host "Script Completed"
    If posible, could you help to correct script as: I have domain name: hello.net. All user are store in all-users ou.
    BR,
    Khemarin Set
    [email protected]

  • Script to find active users with responsibility

    Dear all,
    r12.0.4 on solaris 10
    I need a script to find out the users with all the responsibilities attached to the user ..can anyone share the query if u have ?
    Kai

    Kai,
    Please see (Note: 8576725 - Tom's Handy SQL for the Oracle Applications), 2.3. Users and Responsibilities.
    You can also submit the "Active Users" concurrent program.
    There are many scripts available in the forum, you can also use them.
    Query Responsibilities
    Re: Query Responsibilities
    Regards,
    Hussein

  • Capturing Users with running sql in shell script after every 10min

    Hi All,
    we have a strange prob. of database crash, therefore decided to check what users do when OS/DB crashes,
    i need your input in RUNNING/SCHEDULING such a script which gathers all active users with running SQL and append in a logfile so that we are aware of what happened when DB/OS Crashed.
    i can run this run a query from V$SESSION,V$SQL, and V$PROCESS but i need your input writing such a SHELL Script and scheduling can run by CRON.
    Regards.

    Here ya go.
    (Assuming you want a script to run against one sid)
    script:
    #!/bin/ksh
    # Set environment
    . $HOME/.profile
    export ORACLE_SID=your sid
    sqlplus <<! > /some_report_file
    / as sysdba
    sql you want to execute here*
    exit
    cron entry:
    0,5,10,15,20,25,30,35,40,45,50,55 * * * * /your/script/name/here > /dev/null 2>&1

  • Powershell script or command to Import AD USers with GUID

    I need to import few users with their GUID's from our Training domain to Production domain. Our requirement is Users need to login their existing pc's local profile, once they move to
    Production environment.
    Our setup;<o:p></o:p>
    Training domian:melbourne.com<o:p></o:p>
    Domin controller: Training<o:p></o:p>
    Production domain: melbourne.com<o:p></o:p>
    Domin controller:
    Production
    Note:
    I tried ADMT but it is not allowed to do for source and target as same domain name.
    It is really appreciate any one’s expertise on this scenario to import AD users and computers.

    You're not going to be able to force creation of an object with any specific guid.  That's not relevant to what you're trying to do any way.   You also won't be able to clone the SID, since a, it's not supported, and b, the sid contains the
    unique domain identifier which will be different for each domain even though the names are the same.
    You could use sidhistory to help fix the permissions (add the sid from the account in test to the sidhistory of the account in production).  But you'd need a trust relationship between the domains, and I'm not sure if that is supported when the domains
    have the same name. You might need to add a different UPN suffix and set accounts to migrate to have that suffix to get around that.  I've never actually looked into that situation.
    ADMT won't do it though.  You might have a command prompt utility that can do it in ADMT. But you should be able to do it with powershell by calling an api. You can probably use Ashley McGlone's sidhistory module for most of this.
    https://gallery.technet.microsoft.com/scriptcenter/PowerShell-Module-for-08769c67
    You will want to review the details and requirements relating to modifying sidhistory:
    http://msdn.microsoft.com/en-us/library/ms677982(v=vs.85).aspx
    Okay looking closer, you'll need to do this from C++.  The easiest way is probably to use the sidcloner binaries (https://code.msdn.microsoft.com/windowsdesktop/SIDCloner-add-sIDHistory-831ae24b#content
    ) and call them on demand.
    Honestly the best thing is probably get a consultant to come spend a few hours to do it for you.  Messing with sidhistory can be a huge time sink.

  • Help with Apple Script rewrite

    I can't wrap my brain around applescript. I found this program mp3gain. It is written in applescript. I just need it to go to folder abc download and run, then save it to a folder names abc done. I can reset the db from the script. Any help would be great. All the itunes stuff can be deleted.
    -- MacMP3Gain.applescript
    -- MacMP3Gain
    -- Created by Bery Rinaldo on Tue Jan 14 2003.
    -- Copyright (c) 2003-2005 Bery Rinaldo. All rights reserved.
    -- This AppleScript is used to wrap the command line version of mp3gain with a quaint GUI.
    -- This program is free software; you can redistribute it and/or modify it under the terms
    -- of the GNU General Public License as published by the Free Software Foundation; either
    -- version 2 of the License, or (at your option) any later version.
    -- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
    -- without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -- See the GNU General Public License for more details.
    -- You should have received a copy of the GNU General Public License along with this program; if not,
    -- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    -- This program includes a binary version of aacgain downloaded from here
    -- http://www.hydrogenaudio.org/forums/index.php?act=Attach&type=post&id=1461
    -- aacgain version 1.4.0, derived from mp3gain version 1.4.6
    -- copyright(c) 2001-2004 by Glen Sawyer
    -- AAC support copyright(c) 2004 David Lasker, Altos Design, Inc.
    -- uses mpglib, which can be found at http://www.mpg123.de
    -- AAC support uses faad2 (http://www.audiocoding.com), and
    -- mpeg4ip's mp4v2 (http://www.mpeg4ip.net)
    -- Check out the MP3Gain/AACgain web sites:
    -- http://mp3gain.sourceforge.net/
    -- http://altosdesign.com/aacgain/
    -- Version 1.0 - Initial release
    -- Version 1.01 - Added status updates to display while mp3gain is running
    -- Version 1.1 - 13-Feb-2003 - Added iTunes playlist support
    -- Version 1.2 - 18-Feb-2003 - Added "Process Sub-folders" option to process all folders below the selected folder.
    -- Version 1.3 - 20-Feb-2003 - Fixed program hang when "Allow Clipping" checkbox was unchecked.
    -- Version 1.4 - 23-Feb-2003 - Added target MP3 Gain dB value, added preferences file support for all controls
    -- Version 1.5 - 26-Feb-2003 - Integrate "Be Nice" feature from Michael Heinz. Added "Cancel" feature.
    -- Version 1.6 - 28-Feb-2003 - Minor GUI tweaks to "Be Nice" an "Target" buttons to disable while running.
    -- Version 1.7 - 01-Nov-2003 - Update to mp3gain 1.4.3, use -k (autoClip) option when "Allow Clipping" is unchecked
    -- Version 1.8 - 09-Nov-2003 - Update run_mp3gain.pl to handle iTunes 4 playlists
    -- Version 1.9 - 23-Aug-2005 - Update for Tiger & AAC
    property ref_folder : ""
    property ref_playlist : ""
    property running : false
    property mp3gain : ""
    property run_mp3gain : ""
    on clicked theObject
    if name of theObject is "Start" then
    if running is true then
    set title of button "Start" of window "MainWindow" to "Start"
    try
    set pids to do shell script "ps -auxww | egrep \"" & run_mp3gain & "|" & aacgain & "\" | grep -v grep | awk '{ print $2 }' | xargs kill"
    end try
    set running to false
    tell progress indicator "BusyBar" of window "MainWindow" to stop
    set visible of progress indicator "BusyBar" of window "MainWindow" to false
    tell window "MainWindow" to update
    set contents of text field "StatusMessage" of window "MainWindow" to "Processing aborted."
    set enabled of button "Start" of window "MainWindow" to false
    set enabled of button "Choose Folder" of window "MainWindow" to true
    set enabled of button "Choose Playlist" of window "MainWindow" to true
    set enabled of button "Clip" of window "MainWindow" to true
    set enabled of button "Sub" of window "MainWindow" to true
    set enabled of button "Target" of window "MainWindow" to true
    set enabled of button "Nice" of window "MainWindow" to true
    set targetchecked to state of button "Target" of window "MainWindow" as integer
    if targetchecked = 1 then
    set enabled of text field "TargetValue" of window "MainWindow" to true
    set targetvalue to 75
    try
    set targetvalue to contents of default entry "TargetValue" of user defaults as integer
    end try
    set contents of text field "TargetValue" of window "MainWindow" to targetvalue
    else
    set enabled of text field "TargetValue" of window "MainWindow" to false
    set contents of text field "TargetValue" of window "MainWindow" to 89
    end if
    set enabled of matrix "ARmatrix" of window "MainWindow" to true
    set ref_folder to ""
    set contents of text field "FolderPath" of window "MainWindow" to "No folder selected"
    set ref_playlist to ""
    set contents of text field "PlaylistName" of window "MainWindow" to "No playlist selected"
    tell window "MainWindow" to update
    else
    set clip to (state of button "Clip" of window "MainWindow") as integer
    set albumradio to current row of matrix "ARmatrix" of window "MainWindow"
    set options to " -q "
    if clip = 1 then
    set options to options & "-c "
    else
    set options to options & "-k "
    end if
    if albumradio = 1 then
    set options to options & "-a "
    else
    set options to options & "-r "
    end if
    set nicechecked to state of button "Nice" of window "MainWindow" as integer
    set targetchecked to state of button "Target" of window "MainWindow" as integer
    if targetchecked = 1 then
    set targetdb to integer value of text field "TargetValue" of window "MainWindow"
    set targetparam to targetdb - 89
    set options to options & "-m " & (targetparam as string) & " "
    end if
    set can_run to false
    if ref_playlist is not equal to "" then
    set the playlist_text to ""
    tell application "iTunes"
    set the track_count to the count of tracks of playlist ref_playlist
    repeat with z from 1 to the track_count
    tell track z of playlist ref_playlist
    copy {database ID} to {dbid}
    end tell
    set the playlist_text to the playlist_text & (dbid as string) & ","
    end repeat
    end tell
    activate
    if track_count = 0 then
    display dialog "The playlist is empty." buttons {"OK"}
    else
    set options to options & "-P " & playlist_text
    set can_run to true
    end if
    else
    set folder_path to POSIX path of ref_folder
    set sub to (state of button "Sub" of window "MainWindow") as integer
    if sub = 1 then
    set options to options & "-S -F \"" & folder_path & "\""
    set can_run to true
    else
    set command to "cd \"" & folder_path & "\" ; ls *.mp3 *.m4a 2> /dev/null"
    set output to do shell script command
    if output is equal to "" then
    display dialog "No MP3/M4A files were found in the specified folder." buttons {"OK"}
    else
    set options to options & "-F \"" & folder_path & "\""
    set can_run to true
    end if
    end if
    end if
    if can_run is equal to true then
    set enabled of button "Start" of window "MainWindow" to false
    set enabled of button "Choose Folder" of window "MainWindow" to false
    set enabled of button "Choose Playlist" of window "MainWindow" to false
    set enabled of button "Clip" of window "MainWindow" to false
    set enabled of button "Sub" of window "MainWindow" to false
    set enabled of button "Target" of window "MainWindow" to false
    set enabled of button "Nice" of window "MainWindow" to false
    set enabled of text field "TargetValue" of window "MainWindow" to false
    set enabled of matrix "ARmatrix" of window "MainWindow" to false
    set visible of progress indicator "BusyBar" of window "MainWindow" to true
    set uses threaded animation of progress indicator "BusyBar" of window "MainWindow" to true
    tell progress indicator "BusyBar" of window "MainWindow" to start
    tell window "MainWindow" to update
    if nicechecked = 1 then
    set command to "nice -n 1 "
    else
    set command to ""
    end if
    set command to command & "\"" & run_mp3gain & "\" " & options & " > /tmp/.mp3gain_output 2>&1"
    --display dialog command
    try
    ignoring application responses
    do shell script command & "&"
    end ignoring
    end try
    set running to true
    set title of button "Start" of window "MainWindow" to "Cancel"
    set enabled of button "Start" of window "MainWindow" to true
    tell window "MainWindow" to update
    end if
    end if
    else if name of theObject is "Choose Playlist" then
    tell application "iTunes"
    set allPlaylists to name of user playlists
    end tell
    activate
    set playlist_choice to choose from list allPlaylists with prompt "Which playlist?" multiple selections allowed 0
    if playlist_choice is false then --nothing selected, just stop
    set ref_playlist to ""
    set contents of text field "PlaylistName" of window "MainWindow" to "No playlist selected."
    else
    set ref_playlist to playlist_choice as string
    set contents of text field "PlaylistName" of window "MainWindow" to ref_playlist
    set ref_folder to ""
    set contents of text field "FolderPath" of window "MainWindow" to ""
    set state of button "Sub" of window "MainWindow" to false
    set enabled of button "Sub" of window "MainWindow" to false
    set enabled of button "Start" of window "MainWindow" to true
    tell window "MainWindow" to update
    end if
    else if name of theObject is "Sub" then
    set ischecked to state of button "Sub" of window "MainWindow" as integer
    try
    set contents of default entry "Sub" of user defaults to ischecked
    end try
    else if name of theObject is "Clip" then
    set ischecked to state of button "Clip" of window "MainWindow" as integer
    try
    set contents of default entry "Clip" of user defaults to ischecked
    end try
    else if name of theObject is "Nice" then
    set nicechecked to state of button "Nice" of window "MainWindow" as integer
    try
    set contents of default entry "Nice" of user defaults to nicechecked
    end try
    else if name of theObject is "Target" then
    set targetchecked to state of button "Target" of window "MainWindow" as integer
    try
    set contents of default entry "Target" of user defaults to targetchecked
    end try
    if targetchecked = 1 then
    set enabled of text field "TargetValue" of window "MainWindow" to true
    set targetvalue to 89
    try
    set targetvalue to contents of default entry "TargetValue" of user defaults as integer
    end try
    set contents of text field "TargetValue" of window "MainWindow" to targetvalue
    else
    set enabled of text field "TargetValue" of window "MainWindow" to false
    set contents of text field "TargetValue" of window "MainWindow" to 89
    end if
    else if name of theObject is "ARmatrix" then
    set albumradio to current row of matrix "ARmatrix" of window "MainWindow" as integer
    try
    set contents of default entry "AlbumRadio" of user defaults to albumradio
    end try
    else if name of theObject is "Choose Folder" then
    set ref_folder to choose folder with prompt "Choose the folder where the MP3/M4A files are stored"
    set contents of text field "FolderPath" of window "MainWindow" to ref_folder as string
    set ref_playlist to ""
    set contents of text field "PlaylistName" of window "MainWindow" to ""
    set state of button "Sub" of window "MainWindow" to true
    set enabled of button "Sub" of window "MainWindow" to true
    set enabled of button "Start" of window "MainWindow" to true
    tell window "MainWindow" to update
    end if
    end clicked
    on will finish launching theObject
    -- display dialog "IN the will finish launching thing"
    set running to false
    set mypath to POSIX path of (path to me as string)
    set aacgain to mypath & "Contents/Resources/aacgain"
    set run_mp3gain to mypath & "Contents/Resources/run_mp3gain.pl"
    try
    make new default entry at end of default entries of user defaults with properties {name:"AlbumRadio", contents:1}
    end try
    set albumradio to 1
    try
    set albumradio to contents of default entry "AlbumRadio" of user defaults as integer
    end try
    set current row of matrix "ARmatrix" of window "MainWindow" to albumradio
    my getpreferencebutton("Clip")
    my getpreferencebutton("Sub")
    my getpreferencebutton("Target")
    my getpreferencebutton("Nice")
    try
    make new default entry at end of default entries of user defaults with properties {name:"TargetValue", contents:89}
    end try
    set targetvalue to 89
    try
    set targetvalue to contents of default entry "TargetValue" of user defaults as integer
    end try
    set contents of text field "TargetValue" of window "MainWindow" to targetvalue
    set targetchecked to state of button "Target" of window "MainWindow" as integer
    if targetchecked = 1 then
    set enabled of text field "TargetValue" of window "MainWindow" to true
    else
    set enabled of text field "TargetValue" of window "MainWindow" to false
    set contents of text field "TargetValue" of window "MainWindow" to 89
    end if
    set visible of progress indicator "BusyBar" of window "MainWindow" to false
    tell window "MainWindow" to update
    set visible of window "MainWindow" to true
    end will finish launching
    on will close theObject
    quit
    end will close
    on changed theObject
    set targetdb to integer value of text field "TargetValue" of window "MainWindow"
    try
    set contents of default entry "TargetValue" of user defaults to targetdb
    end try
    end changed
    on idle
    -- display dialog "idle " & running
    if running is true then
    set psout to ""
    set stout to ""
    try
    set psout to do shell script "ps -auxww | grep \"" & run_mp3gain & "\" | grep -v grep"
    set stout to do shell script "grep -a -v '^$' /tmp/.mp3gain_output | tail -1"
    end try
    if stout = "" then
    if ref_playlist is not equal to "" then
    set stout to "Processing iTunes playlist " & ref_playlist & " ..."
    else
    set stout to "Processing folder " & ref_folder & " ..."
    end if
    else
    set stlen to length of stout
    if stlen > 75 then
    set firstpart to (characters 1 through 30 of stout) as string
    set startlast to stlen - 30
    set lastpart to (characters startlast through stlen of stout) as string
    set stout to firstpart & "..." & lastpart
    end if
    end if
    set contents of text field "StatusMessage" of window "MainWindow" to stout
    tell window "MainWindow" to update
    if psout is equal to "" then
    set running to false
    set title of button "Start" of window "MainWindow" to "Start"
    tell progress indicator "BusyBar" of window "MainWindow" to stop
    set visible of progress indicator "BusyBar" of window "MainWindow" to false
    tell window "MainWindow" to update
    set contents of text field "StatusMessage" of window "MainWindow" to "Processing complete."
    set enabled of button "Start" of window "MainWindow" to false
    set enabled of button "Choose Folder" of window "MainWindow" to true
    set enabled of button "Choose Playlist" of window "MainWindow" to true
    set enabled of button "Clip" of window "MainWindow" to true
    set enabled of button "Sub" of window "MainWindow" to true
    set enabled of button "Target" of window "MainWindow" to true
    set enabled of button "Nice" of window "MainWindow" to true
    set targetchecked to state of button "Target" of window "MainWindow" as integer
    if targetchecked = 1 then
    set enabled of text field "TargetValue" of window "MainWindow" to true
    else
    set enabled of text field "TargetValue" of window "MainWindow" to false
    set contents of text field "TargetValue" of window "MainWindow" to 89
    end if
    set enabled of matrix "ARmatrix" of window "MainWindow" to true
    set ref_folder to ""
    set contents of text field "FolderPath" of window "MainWindow" to "No folder selected"
    set ref_playlist to ""
    set contents of text field "PlaylistName" of window "MainWindow" to "No playlist selected"
    tell window "MainWindow" to update
    end if
    end if
    return 1
    end idle
    on will quit theObject
    if running is true then
    try
    set pids to do shell script "ps -auxww | egrep \"" & run_mp3gain & "|" & aacgain & "\" | grep -v grep | awk '{ print $2 }' | xargs kill"
    end try
    end if
    end will quit
    on getpreferencebutton(buttonname)
    try
    -- this is how to initialize the preferences mechanism...it will not reset the value if one exists already
    make new default entry at end of default entries of user defaults with properties {name:buttonname, contents:0}
    end try
    set value to 0
    try
    set value to contents of default entry buttonname of user defaults as integer
    end try
    if value = 1 then
    set state of button buttonname of window "MainWindow" to true
    else
    set state of button buttonname of window "MainWindow" to false
    end if
    end getpreferencebutton

    hi riker123
    it is written in applescript, but it is written for AppleScript Studio & Xcode which has now been superseded by AppleScriptObjC & Xcode, used under OSX 10.6
    Looking at your Mac specs you could use AppleScript Studio & Xcode
    to set this code up, you will find a copy of Xcode on your OSX installer disk.
    Not to discourage you but Xcode needs a bit of work to get the hang off,
    but that's part of the fun.
    Budgie

  • How to reset All users and delete their table?

    Hi,
    i want to know How to reset All users and delete their tables with username- system and password-manager.
    thanks

    Hi
    Here delete means truncate or drop?????
    If drop use the following statement to generate the script:
    select 'drop table ' || Owner || '.' || Table_Name || ';' from Dba_tables
    where owner in (<All_the_users_you_want_to_reset>);
    But before firing the above statement extract the DDL's to create all the users and put it in a file and just run that file to re-create the users.
    if its truncate then:
    select 'truncate table ' || Owner || '.' || Table_Name || ';' from Dba_tables
    where owner in (<All_the_users_you_want_to_reset>);
    Hope this Helps
    Regards

  • Site Login Behavior For SharePoint Foundation 2013 Users With Expired Passwords?

    What are the most user-friendly ways of getting external users with expired AD passwords back into the SharePoint site with a new working password?
    We already send automated email notifications to users reminding them to change their soon-to-expire passwords.  However, sometimes they miss seeing the email notifications before the password expires (such as after returning from vacation or just carelessness
    and lack of attention to email messages) or they see the warning messages and forget to act on it.
    When this happens and they try to log into the SharePoint site from the Internet, their login fails without telling the user the reason they can't log in is because their password expired.  So, they end up confused and call the help desk to get their
    password reset.
    Is there a way to set up SharePoint Foundation 2013 login in a similar way to the OWA login so that, when a user with a correct but expired password tries to log in, it gives them a prompt to set a new password right there rather than just an error indicating
    their login failed for unknown reasons or password is "incorrect?"

    It could be done. You get a different event log entry for an expired login attempt than for a wrong password, 4625 events denote a login failure and an error ID of 23 denotes a logon failure.
    A naff, but simple, approach would be to create a tool that checks your server logon event log for 4625 entries and then emails that user, or the help desk, or security, that they're trying to get onto your system with expired credentials.
    For a more polished experience you've got a lot more work and bluntly it's going to be impractical for you. You'd have to re-write sections of the SharePoint authentication process or intercept the process, both are risky and not a good idea to try.
    There's a really interesting paper here that might be of interest, it won't help you in your current situation but it might shed more light on the overall authentication/authorisation process.
    http://www.sans.org/reading-room/whitepapers/forensics/windows-logon-forensics-34132

  • Can the Terminal add a user(with all options) on a single line?

    Howdy All,
    Can the Mac Terminal add a user, with all options desired, on a single line?    If so, can I get an example of this single terminal line to work from?
    Thanks

    Thanks Drew!   You have some great thoughts there. Perhaps I should provide a clearer environment of each high school(4). All classrooms have a lock down Windows environment. (There are no Macs any where in any classrooms.) The mini-tower will be the only Mac on each high school campus. we're in Dell country. The desktops are locked in such a way that only the ghosted/installed software on each hard drive works and no other software can be installed. USB sticks can't run any exe, jar, or other executable file. Even the other drives on the network can't run them. This has been setup to prevent students from bringing games into the environment and running them. Only the single classroom in each high school, where Web Tech is taught, has a ftp tool installed. Students cannot bring and use their own laptops either. So there really isn't any stray ftp activity happening. You cannot "ftp" out of the network! And there is only the one Mac available per campus.  All this makes it certainly easier to maintain for sure. I am the only user in the school district they let run a personal laptop...mine has Ubuntu (tweaked).  My knowledge of Linux has led them to assign this project to me. They are MS based entirely and so is their knowledge base.
    I've got to teach the other 4 teachers how to manage the mini-tower.  Basically it is this:
         Start and stop Apache2,
         Start and stop vsftp,
         Add ftp users(students will only have directory:           /Library/Server/Web/Data/Sites/Default/studentlastname.firstname  )  Students will not log on to the min-   tower directly as any normal user would, but only through ftp. (I.E. no /home directory) ,
         Remove/delete students as needed
         (I'll pre-install cgi-bin scripts on these to keep it simpler on the other teachers and myself.)
    With this in mind, you can see why a basic script or single command line to install these students would be great! I want to keep it simple to avoid mistakes the teachers might make adding users. Once I understand adding a user (in a terminal) better on a Mac, I may write a script to make it happen for them.
    I'd also like to understand removing/deleting a student/user better to insure everything is gone when executed.
    I hope this clear things up. Any help is much appreciated.    THANKS!!!

Maybe you are looking for