What is this script?

I have recently taken over duties on my church's website (it
was being done by a guy on the other side of the continent before),
there is a script in the <head> and I don't know what it
does.
<script type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue =
false;
for (i=0; i<(args.length-1); i+=2) eval(args
+".location='"+args[i+1]+"'");
//-->
</script>
I was told on another forum that this script is from
dreamweaver (MM = Macromedia) and that "All this function does is
manages a scripted element somewhere on the page that seeks to
change the current page location." It was suggested you might have
some more insight here.
So, the question. Does anyone know what kind of tag I would
look for to see if and where this script is being used.
Thanks for all your help.

That is the goto url behavior. From DW help:
"The Go to URL action opens a new page in the current window
or in the specified frame. This action is particularly useful for
changing the contents of two or more frames with one click. It can
also be called in a timeline to jump to a new page after a
specified time interval. "
If you want to see where it is called from, just search the
code for MM_goTOURL. If it isn't being called within the document,
then the function isn't needed anymore.

Similar Messages

  • HELP What does this Script Mean

    someone told me to go to this website barqs.com and all that came up was a code or java script and i am wondering if i was being fooled or hacked. plz tell me heres the script
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
    <c:set var="currpage" value="home" scope="request"/>
    <jsp:include page="_dispatch.jsp"/>
    what exactly does it mean can anyone tell me???

    Where are you downloading ML from? Have you bought it?

  • What does this script do? [Perl]

    Hi.
    First, an absolutely necessary foreword:
    I'm planning to buy a ThinkPad T410s. It has a nice special battery chip, making it possible to have much better means of power management.
    For instance, one can put in an additional (so called "Ultrabay") battery and the special kernel module "tp_smapi"
    (read more about it here: http://www.thinkwiki.org/wiki/Tp_smapi) lets one take control of how it is handled (see below)
    The thing is, the default behavior is to drain ultrabay completely, but this causes its capacity to deplete quickly. That's why there are certain tp_smapi's options like "force_discharge" which tell the laptop to ex. drain main battery first, the use ultrabay battery. But it is quite a hassle to manually switch to ultrabay when main runs out, etc.
    That's why such script has been created:
    http://www.thinkwiki.org/wiki/Talk:Code/tp-bat-balance
    It's supposed to manually switch main and ultrabay back and forth to ensure exual discharge all the time, as I understand it.
    But I cannot use it in my laptop if I am not 100% sure what it does! It is not really documented, and I'm not a coder.
    Understanding bash scripts isn't really rocket science, but with Perl, it is much different.
    So I kindly ask you:
    Could you please, in normal english describe what it does? (ex. which condition needs to be met to execute a specific command)
    Thanks in advance!
    PS.: And if you do, I could put the description into ThinkWiki's tp-bat-balance site, so that everybody (not only Perl programmers) know what it does

    i no longer have the script open (and i don't feel like reopening) so this is from memory...
    warnec wrote:1) how is $thresh defined? What is it supposed to do in these two funtions? Why is it added?
    $thresh is defined by the simple `my $thresh = 3` line that you quoted to me.  I assume it's there so that the script doesn't switch batteries the instance that BAT0 hits 99.999%, then back when BAT1 hits 99.998%, then back again when BAT0 hits 99.997% and so on, and so on.
    warnec wrote:$bat_remaining[0] > $bat_remaining[1] + $thresh
    $bat_remaining[1] > $bat_remaining[0] + $thresh
    the first statement means if battery zero's remaining percent is greater than (battery one's remaining percent plus 3), then...; and the second statement is just the reverse, if battery one's remaining percent is greater than (battery zero's remaining percent plus 3), then....  if neither of these statements are true, then the threshold his not met (the two battery's percentages are within 3% of each other) and no battery switching should happen.
    warnec wrote:
    2) why such a weird (at least to me) syntax?
    set_force_discharge(0,1);
    set_force_discharge(1,0);
    set_force_discharge(0,0);
    set_force_discharge(1,1);
    set_force_discharge takes two arguments.  the battery to set (BAT0 or BAT1) and the value to set it to (0 = don't discharge, 1 = discharge).
    so, the above statements would be equivalent to:
    tell BAT0 to discharge
    tell BAT1 to not discharge
    tell BAT0 to not discharge
    tell BAT1 to discharge
    which is exactly what you need to do depending on the results of your if statements.
    Last edited by brisbin33 (2010-06-14 21:48:57)

  • What is this: Script: chrome://global/content/bindings/general.xml:0

    I recently upgraded to the new Firefox and now receive a message of a Script file is not loading.
    Script: chrome://global/content/bindings/general.xml:0

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    Do a clean (re)install:
    * Download a fresh Firefox copy from http://www.mozilla.com/firefox/all.html and save the file to the desktop.
    * Uninstall your current Firefox version and remove the Firefox program folder before installing that copy of the Firefox installer.
    * Don't remove personal data if you uninstall the current version.
    * It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.

  • What does this script do? resource://gre/modules/XPCOMUtils.jsm:271

    Firefox (5) hangs, & eventually I get an "Unresponsive script" warning.

    https://developer.mozilla.org/en/JavaScript_code_modules/XPCOMUtils.jsm

  • What's Wrong With This Script

    A couple of years ago I was using an AppleScript file (thanks to someone else's assistance) but it no longer works.
    I have an extra internal drive, that is partitioned, and used for sequential daily backups. When the computer starts up, of course all the drives mount - but I prefer that they are off the desktop until neded.
    Rather than selecting the volumes and then dragging to the Trash, I found it easier to have a script run at startup which then asks if the drives should be unmounted.
    Things were great - until I upgraded to Tiger.
    I am hoping that someone can tell me what's wrong with the script so that I can start using it again. As you can probably tell, I don't have any experience in AppleScript. At the moment the script runs - it presents the dialogue box - and then just ends after a response, but the drives do not unmount.
    The partitions on the drive are called Monday Tuesday Wednesday Thursday Saturday
    The existing script is as follows:
    on run
    display dialog "Unmount All Backup Drives?" buttons {"Yes", "No"} default button 1
    set x to button returned of result
    if x is "Yes" then tell application "Finder" to eject "Monday"
    end run

    This relates to another (current) thread in AppleScript discussions.
    Your script works with Panther as that operating system allows INTERNAL drives to be "ejected" (and, if you eject one volume on a partitioned drive, all the volumes on that drive are ejected -- this explains why ejecting "Monday" actually ejected Monday through Friday).
    With Tiger, you would find that your script works exactly as expected with EXTERNAL drives, but INTERNAL drives need a different approach.
    To get behavior exactly as you had before, try this script:
    --BEGINNING
    display dialog "Unmount All Backup Drives?" buttons {"Yes", "No"} default button 1
    set x to button returned of result
    if x is "Yes" then set driveName to "Monday"
    set driveInfo to do shell script "diskutil list | grep \"" & driveName & "\""
    set driveID to last word of driveInfo
    do shell script "diskutil unmountDisk " & driveID & ""
    --END
    For reasons that aren't entirely clear to me, this approach, while it works reliably, is very slow -- on my fast machine, the unmount process takes nearly 20 seconds. (Using UNIX directly in Terminal, with the same command, is very quick.) (In the AS, the delay occurs in second "do shell script.")
    Another puzzle that has cropped up is described in the related thread "Applescript to Mount/Unmount a Disk . . ." (current). While the above approach works for Justin Surpless, it often prompts for a password -- unacceptable in his application. I've not seen this on my PPC (and I tried 10.4.7, which he's using); his may be an Intel Mac, if that could be the difference.

  • Html. script.inf some firefox exe what is this and how to get rid off

    when i click a genuine site, avast blocks this with html.script.inf.
    when i browse the firefox history, the exact site is not known, but the message ends in firefox.exe, which is shown as script.inf. I am using the latest firefox with all necessary updates.
    I have written to avast and to the site, excelforum and awaiting replies.
    What that firefox exe means? what is that script. How to stop this.When i browse, firefox alerts, if i want to leave that page, and sometimes, a script is being written, do you want to continue or stop. Why this behaviour

    nobody even see the post , i suppose, why c:program files\Mozilla firefox\firefox.exe is shown as html.script.inf file in the picture

  • What is this command script called missing kitty that initiated out of nowhere on my macbook pro?

    What is this command script called missing kitty that initiated out of nowhere on my macbook pro? It says it was created by a former Apple genius and it showed up 3 days after I had to have my macbook wiped clean and re-installed at the Genius bar due to a "software glitch" that locked up my firmware....

    https://discussions.apple.com/thread/2404816?start=0&tstart=0
    at the Apple Store called "Missing Kitty" that would allow you to install a script on the root level of the HD. After installing everything and making a user it would go in and delete the user so on the next restart the computer would start up a "brand new" and already have iLife installed.
    You can always call the genius bar for clarification
    Genius reservation http://www.apple.com/retail/geniusbar/

  • Firefox has crashed numerous times on me tonight, and I keep getting an unresponsive script error (Script: chrome://devany/content/main.js:254) regardless of what website I'm on. NoScript will not block this script, and it's popping up with an increasing

    Firefox has crashed numerous times on me tonight, and I keep getting an unresponsive script error (Script: chrome://devany/content/main.js:254) regardless of what website I'm on. NoScript will not block this script, and it's popping up with an increasing and alarming frequency. It's completely crippled my Firefox, and getting the a large enough window between unresponsive script warnings to get the Troubleshooting Information from Firefox took me a good 20 minutes. It's a very persistent script. I've already re-installed Firefox and restarted my computer, and scanned for viruses/malware. I'm on a Mac, if it makes a difference.
    == This happened ==
    Every time Firefox opened
    == Tonight. I can't say what site I was on, though I first noticed it on DeviantArt and thought it was their new layout producing problems. ==
    == User Agent ==
    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7

    yay, I had this same issue, and I too browsed deviantArt and also have got Deviantanywhere add-on installed. : D
    I'm so glad that You've found a solution and shared it with us.
    I was really getting worried that I'd done something to get malware installed on my 'puter. *Phew* !!
    I'm going to disable DeviantAnywhere after I post this and hopefully this will be fixed for me too!
    I actually hadn't kept my firefox up to date. but.. *shh...*
    I updated it and after I did, it told me that there was a script running that was not responding. : )
    yay for FireFox~
    ~QuinsY.

  • What am I missing in this script?

    Hello
    I am quite new to applescript and I am trying to develop an applescript for use with a filemaker database that I have been tasked to upgrade with new functionality. While learning how to do certain things I stumbled across the following:
    I create this script and run it...
    *set mountedFolder to "Our_Files:Analytical Results:"*
    *set myConnectionString to "afp://MyAccountName:[email protected]/Our_Files/Analytical Results/"*
    *tell application "Finder"*
    *if not (exists mountedFolder) then*
    *mount volume myConnectionString*
    *end if*
    *end tell*
    Works as expected. Mounts the server giving access to the desired folder. Now I run this next script...
    *set mountedFolder to "Our_Files:Analytical Results:"*
    *tell application "Finder"*
    *if exists folder mountedFolder then*
    *display dialog "The volume \"" & mountedFolder & "\" IS mounted!" buttons {"OK"} default button 1*
    else
    *display dialog "The volume \"" & mountedFolder & "\" is NOT mounted. Please reconnect." buttons {"OK"} default button 1*
    *end if*
    *end tell*
    Works as expected and tells me that the desired folder is accessible.
    But now I put both bits of code in the same applescript and run it, as so...
    *set mountedFolder to "Our_Files:Analytical Results:"*
    *set myConnectionString to "afp://MyAccountName:[email protected]/Our_Files/Analytical Results/"*
    *tell application "Finder"*
    *if not (exists mountedFolder) then*
    *mount volume myConnectionString*
    *end if*
    *if exists folder mountedFolder then*
    *display dialog "The volume \"" & mountedFolder & "\" IS mounted!" buttons {"OK"} default button 1*
    else
    *display dialog "The volume \"" & mountedFolder & "\" is NOT mounted. Please reconnect." buttons {"OK"} default button 1*
    *end if*
    *end tell*
    ...and I see the server briefly mount, then dismount, then the script blithely informs me that there is no access, of course. What am I missing in all of this? I had thought that perhaps it was an issue of needing to delay the next check and created a delay mechanism right after the mount statement but no matter how much time I give it it fails to mount and/or stay mounted. Any ideas?
    Thanks,
    Matt

    Hi.
    I'm not sure if the following will make any difference as I don't have a server handy to experiment with, but you might like to try them to see if it helps.
    1. You mentioned that running one script and then the other gave the hoped-for results, but the combined version did not. Rather than omitting the "end tell" from the end of the first script and omitting the "set mountedFolder to "Our_Files:Analytical Results:" " and the "tell application "Finder" " from the start of the second script when combining the two scripts (what you did seems logical - combining two Finder tell blocks into one), have you tried simply pasting the second script (in its entirety) after the first (also complete) so that the combined script now looks like the following? My idea is that it runs one then runs the other, without changing any code.
    *set mountedFolder to "Our_Files:Analytical Results:"*
    *set myConnectionString to "afp://MyAccountName:[email protected]/Our_Files/Analytical Results/"*
    *tell application "Finder"*
    *if not (exists mountedFolder) then*
    *mount volume myConnectionString*
    *end if*
    *end tell*
    *set mountedFolder to "Our_Files:Analytical Results:"*
    *tell application "Finder"*
    *if exists folder mountedFolder then*
    *display dialog "The volume \"" & mountedFolder & "\" IS mounted!" buttons {"OK"} default button 1*
    else
    *display dialog "The volume \"" & mountedFolder & "\" is NOT mounted. Please reconnect." buttons {"OK"} default button 1*
    *end if*
    *end tell*
    2. Another thing to try is the following slight modification to your original combined script - you could try it with and without the "else".
    *set mountedFolder to "Our_Files:Analytical Results:"*
    *set myConnectionString to "afp://MyAccountName:[email protected]/Our_Files/Analytical Results/"*
    *tell application "Finder"*
    *if not (exists mountedFolder) then*
    *mount volume myConnectionString*
    else
    *if exists folder mountedFolder then*
    *display dialog "The volume \"" & mountedFolder & "\" IS mounted!" buttons {"OK"} default button 1*
    else
    *display dialog "The volume \"" & mountedFolder & "\" is NOT mounted. Please reconnect." buttons {"OK"} default button 1*
    *end if*
    *end if*
    *end tell*
    I don't know if either of these suggestions will help, but I basically learn by adapting and expanding existing scripts and trying things various ways until I get the result which I want. Good luck.

  • What is wrong with this script (zlogin)

    I took this script directly from the Trusted Extensions Developers Guide and it's not working. The problem is in the syntax for the if() inside the nawk program, but the correct syntax is eluding me. I verified that both $4 and $zonepath are set properly, but for some reason they never compare to be equal even when they are so zlogin is never called. If I put an else and have it also print $2 then as you might guess zlogin is executed for every zone. Thanks for any tips!!
    #!/sbin/sh
    # Run the specified command in the zone that matches the specified label
    # Usage:
    # runwlabel "my-label" my-program
    [ ! -x /usr/sbin/zoneadm ] && exit 0 # SUNWzoneu not installed
    PATH=/usr/sbin:/usr/bin; export PATH
    # Get the zone path associated with the "my-label" zone
    # Remove the trailing "/root"
    zonepath=`getzonepath "$1" | sed -e 's/\/root$//'`
    # echo zonepath is ${zonepath}
    progname="$2"
    # echo progname is ${progname}
    # Find the zone name that is associated with this zone path
       for zone in `zoneadm list -pi | nawk -F: -v zonepath=${zonepath} '{
        # The problem is in this if()
        if ("$4" == "${zonepath}")
            print $2
       }'`; do
            # Run the specified command in the matching zone
            zlogin ${zone} ${progname}
        done
    exit

    if ("$4" == "${zonepath}")
    this if statement is inside nawk, therefore it may be referenceing nawks $4 variable instead of the shell scripts, its all about scope. Maybe try to assign $test = $4, and then use $test in the if statement.

  • Please assist with modifying this script to read in a list of servers and output results to excel

    Hello,
    I have an excellent script written by Brian Wilhite to gather the last logged in user using Powershell.
    http://gallery.technet.microsoft.com/scriptcenter/Get-LastLogon-Determining-283f98ae/view/Discussions#content
    My Powershell Fu is stumbling to modify this script to the following requirements:
    Currently the script must be loaded first into Powershell, then it can be executed.  I would rather edit the script in my Powershell ISE, add the .txt file to the script itself that gives a list of the servers I need to scan.  Then when I
    press Run Script in my ISE it executes.
    I would also like to output the results of the file to excel (.xls or .csv will do).  Currently the results look as follows:
    Computer : SVR01
    User : WILHITE\BRIAN
    SID : S-1-5-21-012345678-0123456789-012345678-012345
    Time : 9/20/2012 1:07:58 PM
    CurrentlyLoggedOn : False
    I would prefer it shows up like so:
    Computer User SID Time Currently LoggedOn
    SVR01 WILHITE\BRIAN S-1xxx 9/20/2012 1:07:58 PM FalseSRV02 WILHITE\BRIAN S-2xxx 9/26/2014 10:00:00 AM True
    Any help you can provide would be greatly appreciated.  I'll add the full script to the end of this post.
    Thank you.
    Function Get-LastLogon
    <#
    .SYNOPSIS
    This function will list the last user logged on or logged in.
    .DESCRIPTION
    This function will list the last user logged on or logged in. It will detect if the user is currently logged on
    via WMI or the Registry, depending on what version of Windows is running on the target. There is some "guess" work
    to determine what Domain the user truly belongs to if run against Vista NON SP1 and below, since the function
    is using the profile name initially to detect the user name. It then compares the profile name and the Security
    Entries (ACE-SDDL) to see if they are equal to determine Domain and if the profile is loaded via the Registry.
    .PARAMETER ComputerName
    A single Computer or an array of computer names. The default is localhost ($env:COMPUTERNAME).
    .PARAMETER FilterSID
    Filters a single SID from the results. For use if there is a service account commonly used.
    .PARAMETER WQLFilter
    Default WQLFilter defined for the Win32_UserProfile query, it is best to leave this alone, unless you know what
    you are doing.
    Default Value = "NOT SID = 'S-1-5-18' AND NOT SID = 'S-1-5-19' AND NOT SID = 'S-1-5-20'"
    .EXAMPLE
    $Servers = Get-Content "C:\ServerList.txt"
    Get-LastLogon -ComputerName $Servers
    This example will return the last logon information from all the servers in the C:\ServerList.txt file.
    Computer : SVR01
    User : WILHITE\BRIAN
    SID : S-1-5-21-012345678-0123456789-012345678-012345
    Time : 9/20/2012 1:07:58 PM
    CurrentlyLoggedOn : False
    Computer : SVR02
    User : WILIHTE\BRIAN
    SID : S-1-5-21-012345678-0123456789-012345678-012345
    Time : 9/20/2012 12:46:48 PM
    CurrentlyLoggedOn : True
    .EXAMPLE
    Get-LastLogon -ComputerName svr01, svr02 -FilterSID S-1-5-21-012345678-0123456789-012345678-012345
    This example will return the last logon information from all the servers in the C:\ServerList.txt file.
    Computer : SVR01
    User : WILHITE\ADMIN
    SID : S-1-5-21-012345678-0123456789-012345678-543210
    Time : 9/20/2012 1:07:58 PM
    CurrentlyLoggedOn : False
    Computer : SVR02
    User : WILIHTE\ADMIN
    SID : S-1-5-21-012345678-0123456789-012345678-543210
    Time : 9/20/2012 12:46:48 PM
    CurrentlyLoggedOn : True
    .LINK
    http://msdn.microsoft.com/en-us/library/windows/desktop/ee886409(v=vs.85).aspx
    http://msdn.microsoft.com/en-us/library/system.security.principal.securityidentifier.aspx
    .NOTES
    Author: Brian C. Wilhite
    Email: [email protected]
    Date: "09/20/2012"
    Updates: Added FilterSID Parameter
    Cleaned Up Code, defined fewer variables when creating PSObjects
    ToDo: Clean up the UserSID Translation, to continue even if the SID is local
    #>
    [CmdletBinding()]
    param(
    [Parameter(Position=0,ValueFromPipeline=$true)]
    [Alias("CN","Computer")]
    [String[]]$ComputerName="$env:COMPUTERNAME",
    [String]$FilterSID,
    [String]$WQLFilter="NOT SID = 'S-1-5-18' AND NOT SID = 'S-1-5-19' AND NOT SID = 'S-1-5-20'"
    Begin
    #Adjusting ErrorActionPreference to stop on all errors
    $TempErrAct = $ErrorActionPreference
    $ErrorActionPreference = "Stop"
    #Exclude Local System, Local Service & Network Service
    }#End Begin Script Block
    Process
    Foreach ($Computer in $ComputerName)
    $Computer = $Computer.ToUpper().Trim()
    Try
    #Querying Windows version to determine how to proceed.
    $Win32OS = Get-WmiObject -Class Win32_OperatingSystem -ComputerName $Computer
    $Build = $Win32OS.BuildNumber
    #Win32_UserProfile exist on Windows Vista and above
    If ($Build -ge 6001)
    If ($FilterSID)
    $WQLFilter = $WQLFilter + " AND NOT SID = `'$FilterSID`'"
    }#End If ($FilterSID)
    $Win32User = Get-WmiObject -Class Win32_UserProfile -Filter $WQLFilter -ComputerName $Computer
    $LastUser = $Win32User | Sort-Object -Property LastUseTime -Descending | Select-Object -First 1
    $Loaded = $LastUser.Loaded
    $Script:Time = ([WMI]'').ConvertToDateTime($LastUser.LastUseTime)
    #Convert SID to Account for friendly display
    $Script:UserSID = New-Object System.Security.Principal.SecurityIdentifier($LastUser.SID)
    $User = $Script:UserSID.Translate([System.Security.Principal.NTAccount])
    }#End If ($Build -ge 6001)
    If ($Build -le 6000)
    If ($Build -eq 2195)
    $SysDrv = $Win32OS.SystemDirectory.ToCharArray()[0] + ":"
    }#End If ($Build -eq 2195)
    Else
    $SysDrv = $Win32OS.SystemDrive
    }#End Else
    $SysDrv = $SysDrv.Replace(":","$")
    $Script:ProfLoc = "\\$Computer\$SysDrv\Documents and Settings"
    $Profiles = Get-ChildItem -Path $Script:ProfLoc
    $Script:NTUserDatLog = $Profiles | ForEach-Object -Process {$_.GetFiles("ntuser.dat.LOG")}
    #Function to grab last profile data, used for allowing -FilterSID to function properly.
    function GetLastProfData ($InstanceNumber)
    $Script:LastProf = ($Script:NTUserDatLog | Sort-Object -Property LastWriteTime -Descending)[$InstanceNumber]
    $Script:UserName = $Script:LastProf.DirectoryName.Replace("$Script:ProfLoc","").Trim("\").ToUpper()
    $Script:Time = $Script:LastProf.LastAccessTime
    #Getting the SID of the user from the file ACE to compare
    $Script:Sddl = $Script:LastProf.GetAccessControl().Sddl
    $Script:Sddl = $Script:Sddl.split("(") | Select-String -Pattern "[0-9]\)$" | Select-Object -First 1
    #Formatting SID, assuming the 6th entry will be the users SID.
    $Script:Sddl = $Script:Sddl.ToString().Split(";")[5].Trim(")")
    #Convert Account to SID to detect if profile is loaded via the remote registry
    $Script:TranSID = New-Object System.Security.Principal.NTAccount($Script:UserName)
    $Script:UserSID = $Script:TranSID.Translate([System.Security.Principal.SecurityIdentifier])
    }#End function GetLastProfData
    GetLastProfData -InstanceNumber 0
    #If the FilterSID equals the UserSID, rerun GetLastProfData and select the next instance
    If ($Script:UserSID -eq $FilterSID)
    GetLastProfData -InstanceNumber 1
    }#End If ($Script:UserSID -eq $FilterSID)
    #If the detected SID via Sddl matches the UserSID, then connect to the registry to detect currently loggedon.
    If ($Script:Sddl -eq $Script:UserSID)
    $Reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]"Users",$Computer)
    $Loaded = $Reg.GetSubKeyNames() -contains $Script:UserSID.Value
    #Convert SID to Account for friendly display
    $Script:UserSID = New-Object System.Security.Principal.SecurityIdentifier($Script:UserSID)
    $User = $Script:UserSID.Translate([System.Security.Principal.NTAccount])
    }#End If ($Script:Sddl -eq $Script:UserSID)
    Else
    $User = $Script:UserName
    $Loaded = "Unknown"
    }#End Else
    }#End If ($Build -le 6000)
    #Creating Custom PSObject For Output
    New-Object -TypeName PSObject -Property @{
    Computer=$Computer
    User=$User
    SID=$Script:UserSID
    Time=$Script:Time
    CurrentlyLoggedOn=$Loaded
    } | Select-Object Computer, User, SID, Time, CurrentlyLoggedOn
    }#End Try
    Catch
    If ($_.Exception.Message -Like "*Some or all identity references could not be translated*")
    Write-Warning "Unable to Translate $Script:UserSID, try filtering the SID `nby using the -FilterSID parameter."
    Write-Warning "It may be that $Script:UserSID is local to $Computer, Unable to translate remote SID"
    Else
    Write-Warning $_
    }#End Catch
    }#End Foreach ($Computer in $ComputerName)
    }#End Process
    End
    #Resetting ErrorActionPref
    $ErrorActionPreference = $TempErrAct
    }#End End
    }# End Function Get-LastLogon

     This should work:
    Get-LastLogon -Computername (Get-content .\Servers.txt) | Export-CSV .\Output.csv -NoTypeInformation
    I just tested it on my test domain and it did the trick.

  • How can I modify this script to return only certain rows of my mySQL table?

    Hi there,
    I have a php script that accesses a mySQL database and it was generated out of the Flex Builder wizard automatically. The script works great and there are no problems with it. It allows me to perform CRUD on a table by calling it from my Flex app. and it retrieves all the data and puts it into a nice MXML format.
    My question, currently when I call "findAll" to retrieve all the data in the table, well, it retrieves ALL the rows in the table. That's fine, but my table is starting to grow really large with thousands of rows.
    I want to modify this script so that I can pass a variable into it from Flex so that it only retrieves the rows that match the "$subscriber_id" variable that I pass. In this way the results are not the entire table's data, only the rows that match 'subscriber_id'.
    I know how to pass a variable from Flex into php and the code on the php side to pick it up would look like this:
    $subscriberID = $_POST['subscriberID'];
    Can anyone shed light as to the proper code modification in "findAll" which will take my $subscriberID variable and compare it to the 'subscriber_id' field and then only return those rows that match? I think it has something to do with lines 98 to 101.
    Any help is appreciated.
    <?php
    require_once(dirname(__FILE__) . "/2257safeDBconn.php");
    require_once(dirname(__FILE__) . "/functions.inc.php");
    require_once(dirname(__FILE__) . "/XmlSerializer.class.php");
    * This is the main PHP file that process the HTTP parameters,
    * performs the basic db operations (FIND, INSERT, UPDATE, DELETE)
    * and then serialize the response in an XML format.
    * XmlSerializer uses a PEAR xml parser to generate an xml response.
    * this takes a php array and generates an xml according to the following rules:
    * - the root tag name is called "response"
    * - if the current value is a hash, generate a tagname with the key value, recurse inside
    * - if the current value is an array, generated tags with the default value "row"
    * for example, we have the following array:
    * $arr = array(
    *      "data" => array(
    *           array("id_pol" => 1, "name_pol" => "name 1"),
    *           array("id_pol" => 2, "name_pol" => "name 2")
    *      "metadata" => array(
    *           "pageNum" => 1,
    *           "totalRows" => 345
    * we will get an xml of the following form
    * <?xml version="1.0" encoding="ISO-8859-1"?>
    * <response>
    *   <data>
    *     <row>
    *       <id_pol>1</id_pol>
    *       <name_pol>name 1</name_pol>
    *     </row>
    *     <row>
    *       <id_pol>2</id_pol>
    *       <name_pol>name 2</name_pol>
    *     </row>
    *   </data>
    *   <metadata>
    *     <totalRows>345</totalRows>
    *     <pageNum>1</pageNum>
    *   </metadata>
    * </response>
    * Please notice that the generated server side code does not have any
    * specific authentication mechanism in place.
    * The filter field. This is the only field that we will do filtering after.
    $filter_field = "subscriber_id";
    * we need to escape the value, so we need to know what it is
    * possible values: text, long, int, double, date, defined
    $filter_type = "text";
    * constructs and executes a sql select query against the selected database
    * can take the following parameters:
    * $_REQUEST["orderField"] - the field by which we do the ordering. MUST appear inside $fields.
    * $_REQUEST["orderValue"] - ASC or DESC. If neither, the default value is ASC
    * $_REQUEST["filter"] - the filter value
    * $_REQUEST["pageNum"] - the page index
    * $_REQUEST["pageSize"] - the page size (number of rows to return)
    * if neither pageNum and pageSize appear, we do a full select, no limit
    * returns : an array of the form
    * array (
    *           data => array(
    *                array('field1' => "value1", "field2" => "value2")
    *           metadata => array(
    *                "pageNum" => page_index,
    *                "totalRows" => number_of_rows
    function findAll() {
         global $conn, $filter_field, $filter_type;
          * the list of fields in the table. We need this to check that the sent value for the ordering is indeed correct.
         $fields = array('id','subscriber_id','lastName','firstName','birthdate','gender');
         $where = "";
         if (@$_REQUEST['filter'] != "") {
              $where = "WHERE " . $filter_field . " LIKE " . GetSQLValueStringForSelect(@$_REQUEST["filter"], $filter_type);     
         $order = "";
         if (@$_REQUEST["orderField"] != "" && in_array(@$_REQUEST["orderField"], $fields)) {
              $order = "ORDER BY " . @$_REQUEST["orderField"] . " " . (in_array(@$_REQUEST["orderDirection"], array("ASC", "DESC")) ? @$_REQUEST["orderDirection"] : "ASC");
         //calculate the number of rows in this table
         $rscount = mysql_query("SELECT count(*) AS cnt FROM `modelName` $where");
         $row_rscount = mysql_fetch_assoc($rscount);
         $totalrows = (int) $row_rscount["cnt"];
         //get the page number, and the page size
         $pageNum = (int)@$_REQUEST["pageNum"];
         $pageSize = (int)@$_REQUEST["pageSize"];
         //calculate the start row for the limit clause
         $start = $pageNum * $pageSize;
         //construct the query, using the where and order condition
         $query_recordset = "SELECT id,subscriber_id,lastName,firstName,birthdate,gender FROM `modelName` $where $order";
         //if we use pagination, add the limit clause
         if ($pageNum >= 0 && $pageSize > 0) {     
              $query_recordset = sprintf("%s LIMIT %d, %d", $query_recordset, $start, $pageSize);
         $recordset = mysql_query($query_recordset, $conn);
         //if we have rows in the table, loop through them and fill the array
         $toret = array();
         while ($row_recordset = mysql_fetch_assoc($recordset)) {
              array_push($toret, $row_recordset);
         //create the standard response structure
         $toret = array(
              "data" => $toret,
              "metadata" => array (
                   "totalRows" => $totalrows,
                   "pageNum" => $pageNum
         return $toret;
    * constructs and executes a sql count query against the selected database
    * can take the following parameters:
    * $_REQUEST["filter"] - the filter value
    * returns : an array of the form
    * array (
    *           data => number_of_rows,
    *           metadata => array()
    function rowCount() {
         global $conn, $filter_field, $filter_type;
         $where = "";
         if (@$_REQUEST['filter'] != "") {
              $where = "WHERE " . $filter_field . " LIKE " . GetSQLValueStringForSelect(@$_REQUEST["filter"], $filter_type);     
         //calculate the number of rows in this table
         $rscount = mysql_query("SELECT count(*) AS cnt FROM `modelName` $where");
         $row_rscount = mysql_fetch_assoc($rscount);
         $totalrows = (int) $row_rscount["cnt"];
         //create the standard response structure
         $toret = array(
              "data" => $totalrows,
              "metadata" => array()
         return $toret;

    Hi there,
    I have a php script that accesses a mySQL database and it was generated out of the Flex Builder wizard automatically. The script works great and there are no problems with it. It allows me to perform CRUD on a table by calling it from my Flex app. and it retrieves all the data and puts it into a nice MXML format.
    My question, currently when I call "findAll" to retrieve all the data in the table, well, it retrieves ALL the rows in the table. That's fine, but my table is starting to grow really large with thousands of rows.
    I want to modify this script so that I can pass a variable into it from Flex so that it only retrieves the rows that match the "$subscriber_id" variable that I pass. In this way the results are not the entire table's data, only the rows that match 'subscriber_id'.
    I know how to pass a variable from Flex into php and the code on the php side to pick it up would look like this:
    $subscriberID = $_POST['subscriberID'];
    Can anyone shed light as to the proper code modification in "findAll" which will take my $subscriberID variable and compare it to the 'subscriber_id' field and then only return those rows that match? I think it has something to do with lines 98 to 101.
    Any help is appreciated.
    <?php
    require_once(dirname(__FILE__) . "/2257safeDBconn.php");
    require_once(dirname(__FILE__) . "/functions.inc.php");
    require_once(dirname(__FILE__) . "/XmlSerializer.class.php");
    * This is the main PHP file that process the HTTP parameters,
    * performs the basic db operations (FIND, INSERT, UPDATE, DELETE)
    * and then serialize the response in an XML format.
    * XmlSerializer uses a PEAR xml parser to generate an xml response.
    * this takes a php array and generates an xml according to the following rules:
    * - the root tag name is called "response"
    * - if the current value is a hash, generate a tagname with the key value, recurse inside
    * - if the current value is an array, generated tags with the default value "row"
    * for example, we have the following array:
    * $arr = array(
    *      "data" => array(
    *           array("id_pol" => 1, "name_pol" => "name 1"),
    *           array("id_pol" => 2, "name_pol" => "name 2")
    *      "metadata" => array(
    *           "pageNum" => 1,
    *           "totalRows" => 345
    * we will get an xml of the following form
    * <?xml version="1.0" encoding="ISO-8859-1"?>
    * <response>
    *   <data>
    *     <row>
    *       <id_pol>1</id_pol>
    *       <name_pol>name 1</name_pol>
    *     </row>
    *     <row>
    *       <id_pol>2</id_pol>
    *       <name_pol>name 2</name_pol>
    *     </row>
    *   </data>
    *   <metadata>
    *     <totalRows>345</totalRows>
    *     <pageNum>1</pageNum>
    *   </metadata>
    * </response>
    * Please notice that the generated server side code does not have any
    * specific authentication mechanism in place.
    * The filter field. This is the only field that we will do filtering after.
    $filter_field = "subscriber_id";
    * we need to escape the value, so we need to know what it is
    * possible values: text, long, int, double, date, defined
    $filter_type = "text";
    * constructs and executes a sql select query against the selected database
    * can take the following parameters:
    * $_REQUEST["orderField"] - the field by which we do the ordering. MUST appear inside $fields.
    * $_REQUEST["orderValue"] - ASC or DESC. If neither, the default value is ASC
    * $_REQUEST["filter"] - the filter value
    * $_REQUEST["pageNum"] - the page index
    * $_REQUEST["pageSize"] - the page size (number of rows to return)
    * if neither pageNum and pageSize appear, we do a full select, no limit
    * returns : an array of the form
    * array (
    *           data => array(
    *                array('field1' => "value1", "field2" => "value2")
    *           metadata => array(
    *                "pageNum" => page_index,
    *                "totalRows" => number_of_rows
    function findAll() {
         global $conn, $filter_field, $filter_type;
          * the list of fields in the table. We need this to check that the sent value for the ordering is indeed correct.
         $fields = array('id','subscriber_id','lastName','firstName','birthdate','gender');
         $where = "";
         if (@$_REQUEST['filter'] != "") {
              $where = "WHERE " . $filter_field . " LIKE " . GetSQLValueStringForSelect(@$_REQUEST["filter"], $filter_type);     
         $order = "";
         if (@$_REQUEST["orderField"] != "" && in_array(@$_REQUEST["orderField"], $fields)) {
              $order = "ORDER BY " . @$_REQUEST["orderField"] . " " . (in_array(@$_REQUEST["orderDirection"], array("ASC", "DESC")) ? @$_REQUEST["orderDirection"] : "ASC");
         //calculate the number of rows in this table
         $rscount = mysql_query("SELECT count(*) AS cnt FROM `modelName` $where");
         $row_rscount = mysql_fetch_assoc($rscount);
         $totalrows = (int) $row_rscount["cnt"];
         //get the page number, and the page size
         $pageNum = (int)@$_REQUEST["pageNum"];
         $pageSize = (int)@$_REQUEST["pageSize"];
         //calculate the start row for the limit clause
         $start = $pageNum * $pageSize;
         //construct the query, using the where and order condition
         $query_recordset = "SELECT id,subscriber_id,lastName,firstName,birthdate,gender FROM `modelName` $where $order";
         //if we use pagination, add the limit clause
         if ($pageNum >= 0 && $pageSize > 0) {     
              $query_recordset = sprintf("%s LIMIT %d, %d", $query_recordset, $start, $pageSize);
         $recordset = mysql_query($query_recordset, $conn);
         //if we have rows in the table, loop through them and fill the array
         $toret = array();
         while ($row_recordset = mysql_fetch_assoc($recordset)) {
              array_push($toret, $row_recordset);
         //create the standard response structure
         $toret = array(
              "data" => $toret,
              "metadata" => array (
                   "totalRows" => $totalrows,
                   "pageNum" => $pageNum
         return $toret;
    * constructs and executes a sql count query against the selected database
    * can take the following parameters:
    * $_REQUEST["filter"] - the filter value
    * returns : an array of the form
    * array (
    *           data => number_of_rows,
    *           metadata => array()
    function rowCount() {
         global $conn, $filter_field, $filter_type;
         $where = "";
         if (@$_REQUEST['filter'] != "") {
              $where = "WHERE " . $filter_field . " LIKE " . GetSQLValueStringForSelect(@$_REQUEST["filter"], $filter_type);     
         //calculate the number of rows in this table
         $rscount = mysql_query("SELECT count(*) AS cnt FROM `modelName` $where");
         $row_rscount = mysql_fetch_assoc($rscount);
         $totalrows = (int) $row_rscount["cnt"];
         //create the standard response structure
         $toret = array(
              "data" => $totalrows,
              "metadata" => array()
         return $toret;

  • When I run this script nothing is output to the screen or spooled to a file

    When I run this script nothing is output to the screen or spooled to a file. What do I need to do to get output from this script.
    SET SERVEROUTPUT ON size 100000
    DECLARE
    v_schema     Varchar2(50);
    v_statement      Varchar2(500);
    v_name varchar2(30);
    v_id varchar2(8);
    v_pwd varchar2(16);
    v_acct varchar2(16);
    CURSOR get_schemas IS
    SELECT DISTINCT owner
    FROM all_tables
    WHERE table_name = 'USERID'
    ORDER BY owner;
    BEGIN
    OPEN get_schemas;
    LOOP
    FETCH get_schemas INTO v_schema;
    EXIT WHEN get_schemas%NOTFOUND;
              v_statement := 'SELECT name,usid,passwd,acctnum INTO v_name,v_id,v_pwd,v_acct FROM '||v_schema||'.userid';
              execute immediate v_statement;
              DBMS_OUTPUT.PUT_LINE('Name='||v_name||' ID='||v_id||' PW='||v_pwd||' AC='||v_acct);          
    END LOOP;
    CLOSE get_schemas;
    END;
    /

    Do I include several variables after the INTO or just
    one?
    How do I loop through the record and print the
    individual variables?
    I appreciate your assistance!He already gave you the answer above:
    v_statement := 'SELECT name,usid,passwd,acctnum FROM ' || v_schema ||
    '.userid';
    execute immediate v_statement
    INTO v_name, v_id, v_pwd, v_acct;
    If this is not printing any output, it is because you don't have a table named USERID... what are you trying to do?

  • Getting the name of the Action that runs this script

    If I create a action in photoshop to run a script called "test script", How can I determine within the "test script" what action name started running this script?  I'm trying to write a script to scale my images.  The scaling will be determined by what Action ran this script.
    Example
    Action Names are 5x7, 4x6, 8x10
    Eash action above will run the same script called "scale me"
    Within "scale me", the java code will determine that 4x6 started running "scale me"
    "scale me" will go to the section within the java code to scale the image loaded in Photoshop to a 4x6 size.
    The reason for writing the "scale me" code this way is that I can maintain only one script to scale my images.
    Any suggestions or help would be appreciated.
    Raymond

    Thanks for all your comments.  Micheal, I took your code for the "ActionReference()" object and it works great!  I completed my code and it is working okay (some more testing needed).
    *  My Scaling Impage Script  */
    var docRef = app.activeDocument;  //Pointer to current opened document
    finish:
    if (documents.length == 0)      // Check to see if image opened if not, error message
                alert('There are no opened images\r\r' +"Exiting Script");
                break finish;
    var savedState = docRef.activeHistoryState      // Save the history state
    var originalUnit = preferences.rulerUnits   // Save the existing ruler perferences - units
    var ref = new ActionReference();  //Pointer to current selected Action
    ref.putEnumerated( charIDToTypeID("Actn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );  // Point to selected Action
    var desc = executeActionGet(ref);
    var actionName = desc.getString( charIDToTypeID("Nm  ") );  // Get Name of seclected Action
    var actionSetName = desc.getString( charIDToTypeID("PrNm") ); // Get Group the selected Action belongs to
    var actionnumber = 100;    //actionname =  100  (No Action Defined as default)
    var portraitorienation = 0;  // Orientation default to portrait
    var resolutions = 300;  // resolution default to 300
    var sizeh = 999999;  // default size
    var sizew = 999999;  // default size
    var resolution = 300;
    var scaleup1 = 0;  //enlargement
    var scaleup2 = 0;  //enlargement
    var scaleflag = 0;
    var scaleflagg = 0
    //  Assumption is the long side is always defined in sizeh
    if (actionName=="4 x 5") { actionnumber =0;  sizeh = 1535; sizew = 1228;}
    if (actionName=="4 x 6") { actionnumber =1;  sizeh = 1842; sizew = 1228;}
    if (actionName=="5 x 7") { actionnumber =2;  sizeh = 2149; sizew = 1535;}
    if (actionName=="6 x 9") { actionnumber =3;  sizeh = 2127; sizew = 1842;}
    if (actionName=="8 x 10") { actionnumber =4;  sizeh = 3020; sizew = 2416;}
    if (actionName=="8 x 12") { actionnumber =5;  sizeh = 3624; sizew = 2416;}
    if (actionName=="11 x 14") { actionnumber =6;  sizeh = 4228; sizew = 3322;}
    if (actionName=="12 x 18") { actionnumber =7;  sizeh = 5436; sizew = 3624;}
    if (actionName=="12 x 24") { actionnumber =8;  sizeh = 7248; sizew = 3624;}
    if (actionName=="12 x 36") { actionnumber =9;  sizeh = 10872; sizew = 3624;}
    preferences.rulerUnits = Units.PIXELS
    var doch = parseInt (docRef.height);
    var docw = parseInt (docRef.width);
    scaleflag = doch-docw;
    if ( doch > docw ) { scaleflagg =1}
    if  (scaleflagg == 0)
                    portraitorienation = 1;  // Landscape Orientation
                    //alert("Seclected Landscape")
                    //alert(doch+" Height" +docw +" Width")
    var scale1 = docw - sizeh
    var scale2 = doch - sizeh
    if (docw > sizeh) {scaleup1=1}
    if (doch > sizeh) {scaleup2=1}
    // We know know what action was started (What size to scale to and the orientation - Landscape or Portrait)
          //      alert ( "Current selected action is: "+actionName+"\r\rin the action set: "+actionSetName +"\r\rAction Number is " +actionnumber +"\r\rDeminsions are (HxW):  "  +sizeh +", "+sizew );
            if (portraitorienation == 1)   //landscape if true
                            if (scaleup1 == 1)
                                            alert ( "This Photo is landscape\r\r"+ "The doc H x W are:  " +doch +" x " + docw +"\r\r" +"Resizing to (H X W:  " +sizew +", "+ sizeh + "\r\r"  + "Reduction");                               
                                            docRef.resizeImage (sizeh, undefined, resolution, ResampleMethod.BICUBICSHARPER)  // Reduction in size
                            else
                                            alert ( "This Photo is landscape\r\r"+ "The doc H x W are:  " +doch +" x " + docw +"\r\r" +"Resizing to (H X W:  " +sizew +", "+ sizeh + "\r\r"   + "Enlargement");                                       
                                            docRef.resizeImage (sizeh, undefined, resolution, ResampleMethod.BICUBICSMOOTHER)  //Enlargement in size
            else  // portrait
                        if (scaleup2 ==1)
                                            alert ( "This Photo is Portrait\r\r"+ "The doc H x W are:  " +doch +" x " + docw +"\r\r" +"Resizing to (H X W:  " +sizeh +", "+ sizew + "\r\r"  + "Reduction");                                                 
                                           docRef.resizeImage (undefined, sizeh, resolution, ResampleMethod.BICUBICSHARPER)
                            else
                                            alert ( "This Photo is Portrait\r\r"+ "The doc H x W are:  " +doch +" x " + docw +"\r\r" +"Resizing to (H X W:  " +sizeh +", "+ sizew + "\r\r"   + "Enlargement");
                                            docRef.resizeImage (undefined, sizeh, resolution, ResampleMethod.BICUBICSMOOTHER)
    preferences.rulerUnits = originalUnit  // Restore ruler perferences - units
    My script is a single file that is run by the Actions, I've created for each size and each action runs the same script.  When the script runs, it determines via "ActionReference();" what the current selected Action name is and then applies the scaling.  This script has logic for landscape and portrait and will scale using the different algorithms (bicubic xxxx) depending if it is reducing the image or enlarging.   The parametersfor the scaling is long side and constraint proportions.
    So if I have to add another size to the code, all I need to do is to add one line of code to the script, copy any of the existing Actions and rename the copied Action to the size and I am done.
    I'm not a experience programmer so pls don't laugh at my coding but have done some C, C++, Fortran (Yes I'm an electrical engineer) in my days.  A number of things has stumped me abit and one of them was the use of arrays which didn't work for me too well.  I was to use the array for storing my parameters of each size.  Another one that really got me puzzled was the use of the docRef = activeDocument object.  The docRef.height and docRef.width will tell you the dimensions of the document based on the units set for rules.  I set mine for pixels.  The problem I had was the statement if(docRef.height > docRef.width) { do some stufff}.  If I change the  > to < for the same document it alway gives me a "true" logical.  After some thoughts today, I suspect that true is anything not 0 and false is only 0.  I will try this out tonight.  This theory does not fit well with my understanding on how the if statement works in other languages.  Any comments on this would be appreciated.
    Oh and I noticed some extra code var declarations that is not needed such as the activeHistoryState - was determining if I need to use this or the perferences.rulerunits to restore my ruler perferences and apparently the activeHistoryState does not and forgot to remove from the code.

Maybe you are looking for

  • How to create the PDF file in WebDynpro?

    Hi.        How to create PDF file in Webdynpro? I have one WD screen In there i have one File Download action. Once i click that it will open one PDF file which consisting of all details. Pls reply me. with regards, Gobintah.R

  • Cannot determine comparator for Sortfield

    I have a DataGrid that gets its data from an HttpService. If the first row of the data from the http request has a null value for a given field, I get the "Cannot determine comparator for Sortfield" error. I think the simplest workaround would be to

  • User exit VA41 at save document

    Hi Freinds, Im using VA41 tcode to create contract. Before saving the contract, i want to do some validation. Is there any user exit for VA41 at save document. Thanx RR

  • Oracle UCM custom Criteria Workflow

    I am looking for some help. I am trying to create a criteria workflow based on a document type. I have used the command wfrelease to commit all metadata to the repository in the entry step. The user in the workflow will either approve the workflow or

  • Where are GB Instruments Stored?

    I'm just trying to figure out where Garageband instruments are supposed to be stored because right now I found copies in two locations: HD/Library/Application Support/Instrument Settings/Plug-In Settings and user/Library/Application Support/Instrumen