Script that will warn users after 9 minutes of idle

If i have a group policy to lock screen set for 10 minutes. what would be the best way to have a pop up or notification that will appear when the workstation is about to lock in 20 seconds
in order to help the users?
From what i can tell i can not implement the message part in group policy. I'm thinking some type of script that literally warns the user after 9 minutes and 40 seconds of idle time. Seems like the easiest way to do it would be in a log on script.
How should i go about doing this? Please advise

> Would I have to create the task on every client computer?
Basically: Yes. It's just a matter of HOW you create the task :)
I'd suggest using
https://technet.microsoft.com/library/cc725745.aspx
Greetings/Grüße,
Martin
Mal ein
gutes Buch über GPOs lesen?
Good or bad GPOs? - my blog…
And if IT bothers me -
coke bottle design refreshment (-:

Similar Messages

  • Script that will help validate if there is any data loss after a DB restore

    Hi,
    I need to write a single script that will perform the following
    operations:
    1)return me the highy accessed tables across all databases.
    2)List the count, Min and Max system date of the highy accessed tables returned from step 1.
    The idea is to validate if there is any data loss to the highly transactional tables after a database restore operation has been performed.
    Thanks.

    Hello,
    I would also like you to see nice blog by Aron,you can modify the script a bit to change according to your need
    http://sqlblog.com/blogs/aaron_bertrand/archive/2008/05/06/when-was-my-database-table-last-accessed.aspx
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
    Hello Shanky,
    The post would not be helpful too much for OP's requirement. The post was talking about when was the database last accessed. DMLs are not capturing in the script and also there will be many variant forms that can be applied for DML. Hence, I do not think,
    the script would help too much. 
    Or Am I missing something? 
    Latheesh as i mentioed OP has to modify the script little bit may be add User_seek,user_update,user_scans.Still IMO there is no *perfect* way to actually analyze this.So I pointed out point in my original post.Also unless he has some timestamp he cannot
    see min time when it was accessed ,max time can be taken from last user seek,scan,lookup time. Motive was to lethim know what he was trying to achieve cannot be axactly obtained by using sys.dm_index_usage_stats.Below query will give most accessed table
    : Source (Query)
    SELECT
    t.name AS 'Table',
    SUM(i.user_seeks + i.user_scans + i.user_lookups)
    AS 'Total accesses',
    SUM(i.user_seeks) AS 'Seeks',
    SUM(i.user_scans) AS 'Scans',
    SUM(i.user_lookups) AS 'Lookups'
    FROM
    sys.dm_db_index_usage_stats i RIGHT OUTER JOIN
    sys.tables t ON (t.object_id = i.object_id)
    GROUP BY
    i.object_id,
    t.name
    ORDER BY [Total accesses] DESC
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • I need a script that will find the computer a user last logged into.

    I am still learning scripting, I need a script that will allow me to pull in usernames from a csv file. Find what computer they last logged into and output that to an csv file.
    I have looked all over and can't find exactly what I need.
     I found the following script but I need  to add the resuitsize unlimited but can not figure out where to put it we have a large environment. Also I need to be able to grab username from a csv file. Any assistance you can provide is appreciated.
    ##  Find out what computers a user is logged into on your domain by running the script
    ##  and entering in the requested logon id for the user.
    ##  This script requires the free Quest ActiveRoles Management Shell for Active Directory
    ##  snapin  http://www.quest.com/powershell/activeroles-server.aspx
    Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
    $ErrorActionPreference = "SilentlyContinue"
    # Retrieve Username to search for, error checks to make sure the username
    # is not blank and that it exists in Active Directory
    Function Get-Username {
    $Global:Username = Read-Host "Enter username you want to search for"
    if ($Username -eq $null){
    Write-Host "Username cannot be blank, please re-enter username!!!!!"
    Get-Username}
    $UserCheck = Get-QADUser -SamAccountName $Username
    if ($UserCheck -eq $null){
    Write-Host "Invalid username, please verify this is the logon id for the account"
    Get-Username}
    get-username resultsize unlimited
    $computers = Get-QADComputer | where {$_.accountisdisabled -eq $false}
    foreach ($comp in $computers)
    $Computer = $comp.Name
    $ping = new-object System.Net.NetworkInformation.Ping
      $Reply = $null
      $Reply = $ping.send($Computer)
      if($Reply.status -like 'Success'){
    #Get explorer.exe processes
    $proc = gwmi win32_process -computer $Computer -Filter "Name = 'explorer.exe'"
    #Search collection of processes for username
    ForEach ($p in $proc) {
    $temp = ($p.GetOwner()).User
    if ($temp -eq $Username){
    write-host "$Username is logged on $Computer"

    If you are querying by user "resultset size" will be of no use.
    You also have functions that are never used and the body code doe snot look for users.
    Here is what you scrip looks like if printed well.  It is just a jumble of pasted together and unrelated items.
    ## Find out what computers a user is logged into on your domain by running the script
    ## and entering in the requested logon id for the user.
    ## This script requires the free Quest ActiveRoles Management Shell for Active Directory
    ## snapin http://www.quest.com/powershell/activeroles-server.aspx
    Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
    $ErrorActionPreference = "SilentlyContinue"
    # Retrieve Username to search for, error checks to make sure the username
    # is not blank and that it exists in Active Directory
    Function Get-Username {
    $Global:Username = Read-Host "Enter username you want to search for"
    if ($Username -eq $null) {
    Write-Host "Username cannot be blank, please re-enter username!!!!!"
    Get-Username
    $UserCheck = Get-QADUser -SamAccountName $Username
    if ($UserCheck -eq $null) {
    Write-Host "Invalid username, please verify this is the logon id for the account"
    Get-Username
    get-username resultsize unlimited
    $computers = Get-QADComputer | where { $_.accountisdisabled -eq $false }
    foreach ($comp in $computers) {
    $Computer = $comp.Name
    $ping = new-object System.Net.NetworkInformation.Ping
    $Reply = $null
    $Reply = $ping.send($Computer)
    if ($Reply.status -like 'Success') {
    #Get explorer.exe processes
    $proc = gwmi win32_process -computer $Computer -Filter "Name = 'explorer.exe'"
    #Search collection of processes for username
    ForEach ($p in $proc) {
    $temp = ($p.GetOwner()).User
    if ($temp -eq $Username) {
    write-host "$Username is logged on $Computer"
    I suggest finding the original code then use the learning link at the top of this page to help you understand how it works in Powershell.
    ¯\_(ツ)_/¯

  • Script that enables mail users and kicks out two csv files

    I am working on a script that will mainly be used as a scheduled task to enabled mailuser by calling the update-recipient command. 
    But before it calls that command it will get for various issues that can cause errors.
    Missing PrimarySMTP
    Display name having a space at front or back.
    The external email address being blank.
    I have IF statements setup to check for those and then call a function that will save into an array the issue for that user. 
    Here is the script
    <#
    .SYNOPSIS
    Enable-MailUsers Synced Mail Users in the Exchange environment
    THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE
    RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.
    Version .9, 30 June 2014
    .DESCRIPTION
    This script mail-enables Synced Mail Users and creates a CSV report of mail users that were enabled.
    The following is shown:
    * Report Generation Time
    .PARAMETER SendMail
    Send Mail after completion. Set to $True to enable. If enabled, -MailFrom, -MailTo, -MailServer are mandatory
    .PARAMETER MailFrom
    Email address to send from. Passed directly to Send-MailMessage as -From
    .PARAMETER MailTo
    Email address to send to. Passed directly to Send-MailMessage as -To
    .PARAMETER MailServer
    SMTP Mail server to attempt to send through. Passed directly to Send-MailMessage as -SmtpServer
    .PARAMETER ScheduleAs
    Attempt to schedule the command just executed for 10PM nightly. Specify the username here, schtasks (under the hood) will ask for a password later.
    .EXAMPLE
    Generate the HTML report
    .\Enable-MailUsers.ps1 -SendMail -MailFrom [email protected] -MailTo [email protected] -MailServer ex1.contoso.com -ScheduleAs SvcAccount
    #>
    param(
    [parameter(Position=0,Mandatory=$false,ValueFromPipeline=$false,HelpMessage='Send Mail ($True/$False)')][bool]$SendMail=$false,
    [parameter(Position=1,Mandatory=$false,ValueFromPipeline=$false,HelpMessage='Mail From')][string]$MailFrom,
    [parameter(Position=2,Mandatory=$false,ValueFromPipeline=$false,HelpMessage='Mail To')]$MailTo,
    [parameter(Position=3,Mandatory=$false,ValueFromPipeline=$false,HelpMessage='Mail Server')][string]$MailServer,
    [parameter(Position=4,Mandatory=$false,ValueFromPipeline=$false,HelpMessage='Schedule as user')][string]$ScheduleAs
    # Sub Function to neatly update progress
    function _UpProg1
    param($PercentComplete,$Status,$Stage)
    $TotalStages=5
    Write-Progress -id 1 -activity "Mail enabled Objects" -status $Status -percentComplete (($PercentComplete/$TotalStages)+(1/$TotalStages*$Stage*100))
    #Sub Function create ErrObject output
    function _ErrObject{
    Param($name,
    $errStatus
    If(!$err){
    Write-Host "error detected"
    $script:err = $True
    $ErrObject = New-Object -TypeName PSObject
    $Errobject | Add-Member -Name 'Name' -MemberType Noteproperty -Value $Name
    $Errobject | Add-Member -Name 'Comment' -MemberType Noteproperty -Value $errStatus
    $script:ErrOutput += $ErrObject
    # 1. Initial Startup
    # 1.0 Check Powershell Version
    if ((Get-Host).Version.Major -eq 1)
    throw "Powershell Version 1 not supported";
    # 1.1 Check Exchange Management Shell, attempt to load
    if (!(Get-Command Get-ExchangeServer -ErrorAction SilentlyContinue))
    if (Test-Path "D:\Exchsrvr\bin\RemoteExchange.ps1")
    . 'D:\Exchsrvr\bin\RemoteExchange.ps1'
    Connect-ExchangeServer -auto
    } elseif (Test-Path "D:\Exchsrvr\bin\Exchange.ps1") {
    Add-PSSnapIn Microsoft.Exchange.Management.PowerShell.Admin
    .'D:\Exchsrvr\bin\Exchange.ps1'
    } else {
    throw "Exchange Management Shell cannot be loaded"
    # 1.2 Check if -SendMail parameter set and if so check -MailFrom, -MailTo and -MailServer are set
    if ($SendMail)
    if (!$MailFrom -or !$MailTo -or !$MailServer)
    throw "If -SendMail specified, you must also specify -MailFrom, -MailTo and -MailServer"
    # 1.3 Check Exchange Management Shell Version
    if ((Get-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.Admin -ErrorAction SilentlyContinue))
    $E2010 = $false;
    if (Get-ExchangeServer | Where {$_.AdminDisplayVersion.Major -gt 14})
    Write-Warning "Exchange 2010 or higher detected. You'll get better results if you run this script from an Exchange 2010/2013 management shell"
    }else{
    $E2010 = $true
    $localserver = get-exchangeserver $Env:computername
    $localversion = $localserver.admindisplayversion.major
    if ($localversion -eq 15) { $E2013 = $true }
    #Get date
    $filedate = get-date -uformat "%m-%d-%Y"
    $filedate = $filedate.ToString().Replace("0", "")
    #Get the valid users that are not mail-enabled
    _UpProg1 1 "Getting User List" 1
    #$Users = Get-mailuser -ResultSize unlimited -OrganizationalUnit "R0018.COLLABORATION.ECS.HP.COM/Accounts/AbbVienet/Users" | ?{$_.legacyexchangeDN -eq ""}
    $i = 0
    $output = @()
    $errOutput = @()
    $err = $False
    #2 Process users
    ForEach ($User in $Users){
    $i++
    _UpProg1 ($i/$Users.Count*100) "Updating Recipients" 2
    If ($user.ExternalEmailAddress -eq $null){
    _ErrObject $user.Name, "Missing External Email Address"
    ElseIf($user.DisplayName -NotLike "* "){
    _ErrObject $user.Name, "DisplayName contains a trailing space"
    ElseIf($user.DisplayName -NotLike "_*"){
    _ErrObject $user.Name, "DisplayName contains a Leading space"
    ElseIf($user.PrimarySmtpAddress -eq $null){
    _ErrObject $user.Name, "Missing Primary SMTP address"
    Else{
    #Disable EmailAddressPolicy on these users
    Set-Mailuser $User.Name -EmailAddressPolicyEnabled $false
    #pass to Update-recipient
    Update-Recipient $User.Name
    $LEDN = Get-MailUser $User.Name | Select {$_.LegacyExchangeDN}
    If ($LEDN -ne ""){
    $object = New-Object -TypeName PSObject
    $X500 = "x500:" + $LEDN.'$_.LegacyExchangeDN'
    $object | Add-Member -Name 'Name' -MemberType Noteproperty -Value $User.Name
    $object | Add-Member -Name 'x500' -MemberType Noteproperty -Value $X500
    $output += $object
    #Creating CSVFile Output
    _UpProg1 99 "Outputting CSV file 3" 3
    $CSVFile = "c:\scripts\Mail-enable\Mailenabled_$((Get-Date).ToString('MM-dd-yyyy_hh-mm-ss')).csv"
    If($err){
    $ErrCSVFile = "c:\scripts\Mail-enable\ProblemUsers_$((Get-Date).ToString('MM-dd-yyyy_hh-mm-ss')).csv"
    $errOutput | Select-Object Name, Comment | ConvertTo-CSV -NoTypeInformation > $ErrCSVFIle
    $Output | ConvertTo-Csv -NoTypeInformation > $CSVFile
    if ($SendMail)
    _UpProg1 95 "Sending mail message.." 4
    If($err){
    Send-MailMessage -Attachments $CSVFile,$ErrCSVFile -To $MailTo -From $MailFrom -Subject "Enable Mail Users Script" -BodyAsHtml $Output -SmtpServer $MailServer
    Else{
    Send-MailMessage -Attachments $CSVFile -To $MailTo -From $MailFrom -Subject "Enable Mail Users Script" -BodyAsHtml $Output -SmtpServer $MailServer
    if ($ScheduleAs)
    _UpProg1 99 "Attempting to Schedule Task.." 4
    $dir=(split-path -parent $myinvocation.mycommand.definition)
    $params=""
    if ($SendMail)
    $params+=' -SendMail:$true'
    $params+=" -MailFrom:$MailFrom -MailTo:$MailTo -MailServer:$MailServer"
    $task = "powershell -c \""pushd $dir; $($myinvocation.mycommand.definition) $params\"""
    Write-Output "Attempting to schedule task as $($ScheduleAs)..."
    Write-Output "Task to schedule: $($task)"
    schtasks /Create /RU $ScheduleAs /RP /SC DAILY /ST 22:00 /TN "Enable Mail Users" /TR $task
    The Problem is that when I look at the $errOutput I see things but when I pipe the $erroutput to convertTo-CSV I get this within the CSV file. I think its because I an calling a function to do the updating. But not sure.
    Jeff C

    Hi Jeff,
    Any updates? If you have any other questions, please feel free to let me know.
    A little clarification to the script:
    function _ErrObject{
    Param($name,
    $errStatus
    If(!$err){
    Write-Host "error detected"
    $script:err = $True
    $ErrObject = New-Object -TypeName PSObject
    $Errobject | Add-Member -Name 'Name' -MemberType Noteproperty -Value $Name
    $Errobject | Add-Member -Name 'Comment' -MemberType Noteproperty -Value $errStatus
    $script:ErrOutput += $ErrObject
    $errOutput = @()
    _ErrObject Name, "Missing External Email Address"
    $errOutput
    _ErrObject Name "Missing External Email Address"
    $errOutput
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna Wang
    TechNet Community Support

  • IDCS6(MAC) 10.9.4 - a script that will make an anchored object and paste in clipboard contents

    I'm trying to create a script that will create an anchored object that will paste in clipboard contents.
    So far I have:
    var frameRef = app.selection[0];
        var parentObj = frameRef.insertionPoints.item(0);
        var anchorFrame = parentObj.rectangles.add();
    And this works fine, creating an inline object, that can further be defined (with anchor point settings etc).
    However, it is when I go to use app.paste() or app.pasteInto() that all hell breaks loose.
    The line of code I added was:
    anchorFrame.content = app.pasteInto();
    and the error I get is:
    What am I doing incorrectly?
    Colin

    @Colin – For the paste command you like to use, you have to:
    1. First select an object, in your case the added rectangle object
    2. Then use the pasteInto() method from the app object
    3. There is no content property for a rectangle object
    Watch out what is selected after you added the rectangle.
    What you have is a selection of the text frame when you start your code in line one.
    Adding a rectangle will not change that selection.
    The following code will do the job.
    However, if you use pasteInto() the pasted objects could be only partly visible inside the frame.
    Depends on the size and position of the added rectangle relative to the original copied page items.
    Make sure that you give the rectangle a proper size after or while you are adding it:
    var frameRef = app.selection[0];
    var parentObj = frameRef.insertionPoints.item(0);
    //Will add a rectangle sized 40 x 40 mm
    var anchorFrame = parentObj.rectangles.add({geometricBounds:[0,0,"40mm","40mm"]});
    app.select(null); //Optional
    app.select(anchorFrame);
    app.pasteInto();
    Uwe

  • Is there an AppleScript or Automator Script that will wake a Mac from Sleep?

    Is there an AppleScript or Automator Script that will wake a Mac from Sleep?

    Frank and All,
    The following answer to your question above is complicated, but I hope it explains why my question was formed with so much frustration in it.
    I have an OpenOffice(OO) Macro that was launched with Calendar at 6pm each business night. It ran properly in all Apples operating systems until I Hit Maverick(OSX10.9). From then on, the AppleScript would run from one to 3 days, then would disappear from the Calendar entry. The Calendar alert would still run, but the "OpenFile" section of the alert would disappear. I also was running elgato EyeTV HD during the day, so I would use energy saver to put my MacBook Pro to sleep at 12 Midnight and wake it again at 9am. I picked up a used Mac Mini to do the EyeTV stuff, provide AppleTV the files in H264 format through iTunes' media share, and found it had plenty of power to do the 6pm automated stuff simultaneously as well. Because I still wanted to run the OpenOffice Macro on my MacBook Pro at 6pm, and wanted to use it for a host of other things when I was on the road, I wanted it to sleep most of the time and only wake up automatically to run the 6pm OO Macro. When I called Apple about the issue I was having with Maverick and Calendar loosing the OpenFile command as part of the Alert Message, they told me the no longer supported answering AppleScript Questions but they now would support Automator questions. I pointed out that the OpenFile would also fail after one to three days if I used a Calendar Alert to launch an Automator App. At first, I did not like Automator, but now I see why Apple is pushing us to use it. Automator adds a TIME STAMP ID to the Apps developed in Automator so the first time you launch the App after a change to it, you must reply to a dialog message saying that this is the first time you are running this version of the App. If a Scammer has replaced your app with one that can reek havoc on your computer, the replacement app will not run unless you are there to agree that you know where the modified app came from and click the OK button to continue (BRILLIANT, Enhanced Security idea on Apples part). I also noticed that after Mountain Lion, the Applescript delay timing was all screwed up as well. Well I tried to use LaunchD Task Scheduler to circumvent the Calendar Problem and that worked until I upgraded to Yosemite Last week. Then LaunchD no longer worked and I am only into a few days of using The Calendar Launched Automator App to see if it will continue to run.
    But I think I solved the dilemma I was having with opening an Automator App in a Sleeping Mac. I Googled up the following question, "AppleScript to wake up computer".  I went thru several complex responses until I found this on that is INCREDIBLE EASEY! What came back was a brettterpstra.com  response from Feb 20th,2014. What it said, in a Quick Tip: caffeinated your Terminal Article,  if you wanted to wake a Mac from sleep, use the Terminal command named "Caffeine -u -t 1". I placed it in an Automator Most Used Action called "Run Shell Script -- Caffeine -u -t 1" and it worked!  Now, I can put my Mac to Sleep but at 6pm, the Automator App will launch, run the "Caffeine -u- -t 1" command and proceed to work as if I had awakened the Mac From Sleep mode by pressing a keyboard key and had run the Automator Script with a double click.
    Sorry for the long, drawn-out reply, but maybe this will help others.

  • Simple script that will export the coordinates (layer bounds - top left x,y)

    Hi,
    I'm looking for a simple script that will export the coordinates (layer bounds - top left x,y) of the layers to an seperate xml/txt file.

    Your screen capture looks like it's from Photoshop.
    In InDesign sub layers are page items, the containing layer has no dimension. So you could get all the page item's x, y, width, height. But you might have to consider groups and then the layering could be very complex. The stacking order could also get complex. Page items have an index, but it's relative to its parent container.

  • "A script that will delete perfstat snapshots older than 90 days with SPPURGE..."

    Hello to all my fine Oracle related friends...We are all one large extended Family...
    I want to create a script that will execute SPPURGE on Perfstat for snapshots that are older than 90 days.
    Now, I have Grid 12c Cloud Control up and running for all the Databases that we have...
    Should I use Grid 12c to execute the SPPURGE and just pass the parameters in like that?
    Or should I go "Old School" and make a Shell Script and schedule it in the crontab?
    What would you guys do?
    I want implement this for 41 "Standard Edition" Databases....some are "Data Guard".....
    Thanks,
    Xevv.

    Xevv Bellringer wrote:
    Hi Ed,
    I tried executing this manually and it's not deleting the snapshots at all.
    begin
    statspack.purge(trunc(sysdate-90),true);
    end;
    I even let it for an entire day and then altered the code like this...But when I execute it, it doesn't deleted the data..
    begin
    statspack.purge(trunc(sysdate-1),true);
    end;
    When I do a select sysdate -1 from dual; it gives the correct date?
    Could there be a "NLS Setting" some where causing this?
    How do you determine that it is not deleteding data?  (please show evidence)
    How, and how often, are you collecting a statspack snapshot?  (please show evidence)

  • PL/SQL to create a temp table that will be dropped after session ends

    Is it possible in PL/SQL to create a temp table that will be dropped after the session ends? Please provide example if possible. I can create a global temp table in PL/SQL but I am not sure how (if possible) to have it 'drop' once the session ends.
    DB: 10g
    OS: Wiindoze 2003 Server
    :-)

    As others have mentioned (but probably not clearly explained), Oracle treats temporary tables differently to SQL Server.
    In SQL Server you create a temporary table and it gets dropped (automatically I assume, I dont do SQL Server) after the session finishes. This will obviously allow each session to "request" a temporary table to use, then use it, and not have to worry about cleaning up the database after the session has finished.
    Oracle takes a different approach...
    On the assumption that each session is likely to be creating a temporary table for the same purposes, with the same structure, Oracle let's you create a Global Temporary Table a.k.a. GTT (which you've already come across). You only have to create this table once and you leave it on the database. This then means that any code written to use that table doesn't have to be dynamic code and can be verified and checked at compile time, just like code written for any other table. The difference of a GTT from a regular table is that any data you put into that table can only be seen by that session and will not interfere with any data of other sessions and, when you either commit, or end the session (depending on the "on commit delete rows" or "on commit preserve rows" option used when creating the GTT), that data from your own session will automatically be removed and hence the table is cleaned up that way, whilst the actual table itself remains.
    Some people from SQL Server backgrounds try and create and drop tables dynamically in their PL/SQL code, but this leads to problems...
    SQL> ed
    Wrote file afiedt.buf
      1  begin
      2    execute immediate 'create table my_temp (x number)';
      3    insert into my_temp values (1);
      4    execute immediate 'drop table my_temp';
      5* end;
    SQL> /
      insert into my_temp values (1);
    ERROR at line 3:
    ORA-06550: line 3, column 15:
    PL/SQL: ORA-00942: table or view does not exist
    ORA-06550: line 3, column 3:
    PL/SQL: SQL Statement ignoredi.e. the code will not compile for direct DML statements trying to use that table.
    They then try and get around this issue by making their DML statements dynamic too...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure my_proc is
      2  begin
      3    execute immediate 'create table my_temp (x number)';
      4    execute immediate 'insert into my_temp values (''A'')';
      5    execute immediate 'drop table my_temp';
      6* end;
    SQL> /
    Procedure created.... which looks great and it compiles ok... but... when they try and run it...
    SQL> exec my_proc;
    BEGIN my_proc; END;
    ERROR at line 1:
    ORA-01722: invalid number
    ORA-06512: at "SCOTT.MY_PROC", line 4
    ORA-06512: at line 1... oops the code has a bug in it. Our DML statement was invalid.
    This is really something that would have been caught at compile time, if the statement had been a direct DML statement rather than dynamic. And thus we see the problem with people trying to write all their code as dynamic SQL... it's more likely to contain bugs that won't be detected at compile time and only come to light at run time... sometimes only under certain conditions and sometimes once it's got into a production environment. Bad Idea!!!! ;)
    Far better to never create tables (or most other database objects) at run time. Just create them once as part of the database design/implementation and use them as required, allowing you to catch the most common coding errors up front before they get anywhere near a test environment or worse still, a production environment.

  • VB or Powershell script that Authenticates a user in AD, and if successful will run a program

    I am looking for a script Powershell or VB that will authenticate a user to a group in AD, and if successful, kick off cscript X:\Deploy\Scripts\LiteTouch.wsf
    Any help would would be greatly appreciated 

    Hi,
    Have you looked through the script repository yet?
    http://gallery.technet.microsoft.com/scriptcenter
    Don't retire TechNet! -
    (Don't give up yet - 12,700+ strong and growing)

  • [solved] pm-utils, how to run a script as logged-in user AFTER resume

    All the scripts in /etc/pm/sleep.d are run as root. Is there any way for me to put a script such that it runs as my logged-in user AFTER all the scripts in /etc/pm/sleep.d. I tried putting su -c "command" - <username> but that doesn't have the full user environment, hence dbus session bus doesn't work yet.
    EDIT: Solved: see solution by lucke below.
    Last edited by ngoonee (2009-11-14 20:40:50)

    It might help to know what command you're having trouble with--perhaps there's a better/easier way to execute it.
    The scripts in /etc/pm/sleep.d are called in numeric order during suspend.  That is, if you have a script titled 44-myfix-for-foo, it will run before a script titled 88-myfix-for-bar.  These scripts are then executed in reverse order upon resume.

  • Have a CS2 script that will not run in CS3. Can someone help?

    I have a script that was written for me to find a certain paragraph style and replace the paragraph with an anchored text frame containing the text from the paragraph. I moved the script over to CS3 and updated the style names for my new document, but nothing happens when I try to run the script. I'll flow the script in after my opening post.

    //find paragraph style text and replace with text in anchored text frame
    myDoc = app.activeDocument
    myPstyle = myDoc.paragraphStyles.itemByName("Teaching Tip");
    app.findPreferences = app.changePreferences = null;
    app.findPreferences.appliedParagraphStyle = myPstyle;
    myFinds = myDoc.search("", false, false, undefined, {appliedParagraphStyle:myPstyle});
    for (var j = myFinds.length - 1; j >= 0; j--) {
    makeAnchor(myFinds[j]);
    if ((j > 0) && (j % 100 == 0)) {
    myDoc.save(myDoc.fullName);
    function getParentTextFlow(theTextRef) {
    // Returns reference to parent story or text of cell, as appropriate
    if (theTextRef.parent.constructor.name == "Cell") {
    return theTextRef.parent.texts[0];
    } else {
    return theTextRef.parentStory;
    function makeAnchor(theText) {
    // Transfers contents of theText into new anchored frame that replaces theText
    var myStory = getParentTextFlow(theText);
    var myAnchLocation = theText.insertionPoints[-2].index;
    var myTF = myStory.insertionPoints[myAncLocation].textFrames.add();
    myStory.recompose();
    makeInchWide(myTF);
    myTF.applyObjectStyle(myDoc.objectStyles.item("Teacher's Tip", true));
    theText.move(LocationOptions.atEnd, myTF.parentStory);
    myAnchStory = myTF.parentStory;
    theText.move(LocationOptions.atEnd, myAnchStory);
    myAnchStory.texts[0].appliedParagraphStyle = myDoc.paragraphStyles.item("Teaching Tip");
    myTF.fit(FitOptions.frameToContent);
    makeInchWide(myTF);
    function makeInchWide(theObj) {
    // Makes theObj one inch wide
    //Save user's measurement preferences
    userHoriz = myDoc.viewPreferences.horizontalMeasurementUnits;
    userVert = myDoc.viewPreferences.verticalMeasurementUnits;
    myDoc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.inches;
    myDoc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.inches;
    var myBounds = theObj.geometricBounds;
    myBounds[3] = myBounds[1] + 3;
    theObj.geometricBounds = myBounds;
    myDoc.viewPreferences.horizontalMeasurementUnits = userHoriz
    myDoc.viewPreferences.verticalMeasurementUnits = userVert

  • Is there any software that will delete video after I crop in iMovie

    Ok, I've spent days reading posts and googling for answers. I'm ready to spend $$ if I need to. We're all aware of how iMovie won't let us delete unwanted video. I'm trying to fix a wedding video some hack did in SVHS. I got it from DVD to Video_TS to DV using MPEG Streamline and imported the video clips to iMovie. (By "video clips", I am mean the DV files.)
    There are 7 DV files from a 69-minute video. I am creating tons of smaller "clips" from these DV files - like 5 to 15-second clips - because I want to use transitions in between them.
    My understanding of what's happening in iMovie as I do this is as follows:
    - Let's say I begin with the first DV file that is 1.9 GB, about 10 minutes long.
    - I create a 10-second clip from that by (a) selecting my start and end points, (b) clicking Edit>copy, (c) clicking on the clip pane, (d) clicking Edit>paste.
    - Now I have a new 10-second clip.
    - But! I also have 1.9 GB of unused video behind that clip, right?
    - I repeat the process maybe 30 or 40 more times until I've edited the original 10-minute DV file (clip) and what do I have?
    - Do I have 40 10-second clips each with 1.9 GB of unwanted video behind it??
    As I said, with 7 DV files at 1.9 GB each that need to be sliced into multiple clips for transition effects, etc, this will shut down my MB quick. I've only done this with 3 DV files so far and I have 12 GB of HD space left. I will obviously not be able to finish the project this way. What a disaster!
    So here's the million dollar question -- Is there ANY 3rd party software that will allow me to slice these DV files into small clips and permanently delete the unused video?
    I don't care if I use something that "replaces" iMovie or something that works with iMovie. Like I said, I'm ready to spend the money to save the time, disk space, and aggravation. Note I worked in video production (many) years ago so I'm not afraid of something "technical" (editing concepts aren't new to me). However, I'm far from being an expert on what's out there these days.
    I should also note that the original wedding video (DVD) did not have any chapters or anything of the sort. The ONLY way I can edit this is to import the entire file as it was converted to DV. It's not like I can import only the video I want to use. I hope that makes sense. I do not have access to the source video either - only this pathetic DVD he calls a wedding video.
    Thanks in advance so much for any help. I never would've gotten this far without all the posts!
    MacBook   Mac OS X (10.4.7)   2 GHz Intel Core Duo, 1 GB DDR2 SDRAM
    MacBook   Mac OS X (10.4.7)   2 GHz Intel Core Duo, 1 GB DDR2 SDRAM
    MacBook   Mac OS X (10.4.7)   2 GHz Intel Core Duo, 1 GB DDR2 SDRAM

    - Do I have 40 10-second clips each with 1.9 GB of unwanted video behind it??
    Not to worry. When we Copy and Paste within a project, iMovie HD creates a new clip thumbnail for the Timeline/Clips pane, then simply adds a new pointer to the source video. The source material is not duplicated.
    When you Copy a clip and Paste a clip to a DIFFERENT project then Yes, the clip's entire source video file is duplicated. (When Copying between projects, be sure to Copy and Paste all the clips together so iMovie duplicates the source files just one time.)
    Next time, you might consider setting your iMovie 6 preferences to limit the length of imported clips to 3 minutes — or whatever duration you want. Then each imported clip will have its own source file. When you discard an entire clip its file will be discarded too, shrinking the size of the project.
    If you have no need to preserve the clips as clips you could export the project to a Full Quality movie that you import to a new project. Everything will arrive as a single clip, which may be okay here. Then discard your old project. The project will be smaller, containing just the stuff on the Timeline.
    If the Timeline contains most of the source material — just split into small clips — there may not be a lot of "extra" material in the project. To get an estimate of how large the Timeline really is, open the "Timeline Movie.mov" that's inside the Cache folder of the project in QuickTime Player. QT Player's Show Movie Info window will show the size of the material it represents.
    Karl

  • How can I autorun a script that will process an XML file on open?

    I am using Frame 11. I have a registered script that looks for event notification Constants.FA_Note_PostOpenXML. When this event fires, the script is supposed to examine the root element (so I only edit appropriate XML files), then make some edits to the file. Specifically, I want to be able to delete empty pages, remove room for side heads, and fix table formatting (such as left indent, which I can't directly access, apparently, in the EDD or R/W rules). The snippet of code that starts doing the work follows:
    Notification(Constants.FA_Note_PostOpenXML,true);
    function Notify(note, object, sparam, iparam) {
        switch (note) {
            case Constants.FA_Note_PostOpenXML:
                doTheWork();
                break;
    function doTheWork() {
        var doc, flow, root, elemName, mPageAttrib, topicElem, topicElemName, allAttribs;
        doc = app.ActiveDoc;
        flow = doc.MainFlowInDoc;
        root = flow.HighestLevelElement; // will always get something even if unstructured document
        while(root.ObjectValid()) { //only do something for structured docs
            elemName = getElementName(root);
            ...more code to do stuff....
    I then check the root element name, and if it matches, I make some changes. This code works fine when run manually. But, when run as a registered script, the app.ActiveDoc object is invalid, and there is no structure to edit. (I added debug line if(!doc.ObjectValid()){alert("not valid");}, which is not included above.) It appears that the Constants.FA_Note_PostOpenXML event fires as soon as the XML file is opened, but BEFORE Frame actually reads it.
    Does anyone have any recommendations on how to work around this? Is there another event I could use instead of Constants.FA_Note_PostOpenXML? Is there any other way to automatically manipulate an XML file when it loads?
    Thanks in advance

    The Notify event receives four parameters: note, object, sparam, and iparam. For the event you are using, object should be the document object of the FrameMaker document being opened. So, you should be able to use this:
    doTheWork(object);
    Make sure you update your doTheWork function to receive the Doc object:
    function doTheWork(doc) {
        var flow, root, elemName, mPageAttrib, topicElem, topicElemName, allAttribs;
        flow = doc.MainFlowInDoc;
        root = flow.HighestLevelElement; // will always get something even if unstructured document
        while(root.ObjectValid()) { //only do something for structured docs
            elemName = getElementName(root);
            ...more code to do stuff....
    -Rick

  • In need of a script that will update tv shows on external hard-drive

    Hi everyone I have a really specific question about scripts. Okay, so my dad regularly downloads various TV shows and movies etc
    and I have a neighbor named Darian who once a week gives me an external hard drive and I update a whole bunch of TV shows. Now my problem is that each time he gives me the hard drive, it takes me about 20-30 mins to update all of the TV shows because they
    are in different TV show folders, I was wondering if it is possible to make a script that when run would automatically copy all of the shows onto Darian's hard drive and then all I have to do is copy the movies which is pretty quick, here's another problem,
    all of the movies and tv shows are not on my computer but on my dad's computer, so when I copy the stuff I have to access his pc through the network and I always have to type his username and password to access his pc, so if someone could tell me if it is
    possible, the code I need and how to run it or pretty much any help, I would be very gratful, thanks in advance (:

    The best we can do is point you at the resource page and let you figure out what it is you are trying to ask:
    http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx
    Rather than ask a whole shopping list of questions rey to figure out the first step that you need to take and ask a question about that..
    I also believe that it would be good for you to get a book on how to use Windows in a home network.  All of what you ask can be done without any scripts.  It is all part of basic WIndows and is designed to make this possible and easy for home users
    but you stil need to study how the system works.
    ¯\_(ツ)_/¯

Maybe you are looking for

  • How to clean line items

    Hi, This is in 11.5.10.2. For Balance Sheet review/clean up of GL Accounts, we are facing following Problems. When we query a particular GL account the number of lines fetches are more than 6 lakhs line items due to which we are not able to extract c

  • Converter help

    Hi i am facing a usage error in the arguments of the converter command when i issue the following: C:\new\jck\bin>converter -out JCA -classdir c:\new\jck\samples\src\com\sun\javacard\samples\wallet 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x6:0x1 1.3 the fo

  • Can't 'save as' jpeg file

    I have a group of PSD files that my client wants to have as JPG files. I just went to do a "save as" on one of these and JPEG is not one of the types of files listed. In fact there are only eight file types listed instead of the list of dozens of typ

  • How  can I burn "iTunes store files in MP3 formats?

    how  can I burn "iTunes store files in MP3 formats? is there a way ?

  • Verification Failed on all OS downloaded installers

    Every time I've downloaded an OS installer (I'm trying to go back to 10.4.6 from 10.4.7), I get Verification Failed when I try to mount the .dmg file. I don't get this with the QT re-installers, just the OS installers, whether Combo or the regular PP