Modifying a Script in IPCC

Hi,
I've IPCC Express Premium package 4.0(3) _Build080. Our script is setup in a way that when a caller dials company’s main number and presses number 2, it takes them to the Queue (Support Queue) by triggering "CSQ-SUPPORT" Contact Service Queue. Now we've come across scenarios that sometime an inside employee needs to transfer an already existing call directly to the Queue (i.e. by transferring the call to an specific extension). What we're doing right now  since there is no extension exist for the Q, we transfer them to the Route Point (i.e. 7000) in which the entire welcome prompt is played again and asking them to press number 2 for support queue!  My question is: would there be a way that we can directly transfer call to the Q by dialing an extension/route point or etc?
There are certainly scenarios that for example an account manager need to transfer a customer directly to the Q without having to transfer them to the route point (which plays the entire script again) and asking them to press number 2 for the Queue.
Any help would be greatly appreciated.
Thanks,
Ehsan

Hi Romam,
Thanks for prompt reply.
Note that I'm by no means expert in CRS scripting and would appreciate if you could be more elaborative. I've a couple of questions:
1- How can I configure additional trigger DN for the application, for example 4444?
2- Should I create this number in Callmanager as well? (Because the script doesn't get played when doing call transfer... right?)
3- I created "Get Call Contact Info" with a Switch step at the very beginning of the script as you instructed:

Similar Messages

  • I need help modifying a script in IPCC

    I am running UCCX Premium 5.0(2)SR02_Build045. I have a script in place, but need to modify it. Basically a call comes into my main menu and gets distributed to a contact service queue. If no agents are available the call is queued and the caller is prompted to leave a voicemail after 2 mins. If the caller continues to hold they will stay in queue. I need to modify the script so that all callers are dequeued after 15mins. The call can be terminated or routed back to my operator (0). Any help appreciated I am a scripting newbie!
    By the red arrow is the QueueTransfersLoop. I need to modify this loop to terminate after 15mins.
    Thanks!!
    Chris

    Hi Chris,
    You need to drop the get reporting statistic step in some place of the queue loop, in the get reporting statistic step properties you have to choose for the Report Object parameter the one that says "CSQ IPCC Express", in the Field parameter you have to choose "Current Wait Duration", the Row Identifier is a string variable that has the value of the CSQ name and finally Result Statistic is an integer variable that you have to set to 0.
    After that you need an if statement, in that step you have to compare the value of the Integer variable with some value, in this case the 15mins that you need (you have to compare the values in seconds). It's better to compare the value with a ".equals()" and also with a ">="  because it could be that the call has being queued a little bit more than 15 mins.
    Check the screenshot, that works for me.
    Gabriel.

  • 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;

  • Modify Powershell Script

    Hello
    How can I modify this script to target all Users OU in one domain to move all disabled accounts from each Users OU to move to the Disabled Users OU?
    Search-ADAccount –AccountDisabled –UsersOnly –SearchBase “OU=Users,OU=test,OU=domain,DC=domain,DC=com”  | Move-ADObject –TargetPath “OU=Disabled Users,DC=domain,DC=com”
    The above script will work for but only for one OU, I need it to target all OU=Users OU.
    Thanks

    Hi Rover,
    I‘m writing to check if the suggestions were helpful, if you have any questions, please feel free to let me know.
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Urgent:How to modify a script without changing the print programme

    Hi all,
    Can any body pls tell me <b>How to modify a script without changing the print programme</b>
    Give m esome real time examples.
    Good points willbe rewarded
    Thanks

    Hi
    You can write a external Subroutine to fetch the extra data into the script program
    see the following sample code
    How to call a subroutine form SAPscripts
    The Form :
    /:PERFORM CDE_CENT IN PROGRAM ZKRPMM_PERFORM_Z1MEDRUCK
    /:USING &EKKO-EBELN&
    /:CHANGING &CDECENT&
    /:ENDPERFORM
    The report :
    REPORT zkrpmm_perform_z1medruck .
    DATA : BEGIN OF it_input_table OCCURS 10.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_input_table.
    déclaration de la table output_table contenant les
    variables exportées
    DATA : BEGIN OF it_output_table OCCURS 0.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_output_table.
    DATA : w_ebeln LIKE ekko-ebeln,
    w_vbeln LIKE vbak-vbeln,
    w_zcdffa LIKE vbak-zcdffa.
    FORM CDE_CENT
    FORM cde_cent TABLES input output.
    it_input_table[] = input[].
    it_output_table[] = output[].
    READ TABLE it_input_table INDEX 1.
    MOVE it_input_table-value TO w_ebeln.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = w_ebeln
    IMPORTING
    output = w_ebeln.
    SELECT SINGLE zcdffa FROM ekko
    INTO w_zcdffa
    WHERE ebeln = w_ebeln.
    it_output_table-name = 'CDECENT'.
    MOVE w_zcdffa TO it_output_table-value.
    MODIFY it_output_table INDEX 1.
    output[] = it_output_table[].
    ENDFORM.
    COPING SCRIPT
    There are some Standard Sap Scripts in SAP. We cant directly execute them in scripts we have to use some T-codes and by giving some input to the required fields we can see the output printform.
    I will show one example. There are some Standard Sap Scripts such as MEDRUCK which is a standard Sap Script for Purchase Order and RVINVOICE01 for billing and so on...
    To see oupt of MEDRUCK go to T-code ME9F give purchase order number and execute select one number and click on dislplay messages button on application tool bar you can find the print form of MEDRUCK.
    You cannot change the Standard Sap Scripts but you can use Standard Sap Scripts and Copy them to userdefined Script and can make changes to them and replace standard Sap Script with usedefind script.
    Ex: Go to SE71,
    on menu bar u find Utilities->copy from Client. click on it u ll find new screen showing
    Form name:
    Source Clinet:
    Target Form:
    give Form name as usedefined form name EX: ZFORM1
    Source client as 000 and
    Target form as MEDRUCK.
    execute.
    Now, the standard from MEDRUCK is copyied to your form ZFORM1.
    NOW, go to SE71 and give form name as ZFORM1 and do some changes to the form such as adding logo any thing. save and Activate.
    Now, you have done changes to the Form ZFORM1 and u have to replace your form with standard SAP Script.
    Go to NACE Transaction.
    on Applications select EF for purchase order and click Output types button on application tool bar.
    now select NEU as output types dobule click on Processing Routines.
    now click on Change option on application tool bar and on right side u find MEDRUCK in form place replace MEDRUCK with ZFORM1 and SAVE.
    go back twice and now go to T-code ME9F give the purchase order number and execute and select one option and click on display messges button .
    you will find the changes that you have done in ZFORM1. so we cant chage the standard Sap Scripts by copying the Standard Sap Scripts we can chage and replace with our forms
    Refer
    https://forums.sdn.sap.com/click.jspa?searchID=4089895&messageID=3239299
    Regards
    Message was edited by:
            Kiran Sure(skk)

  • Script -asjob (modified bgping script)

    Hello,
    I liked very much the original bgping script (http://poshtips.com/bgping-a-high-performance-bulk-ping-utility/)
    I thought, it would be nice to modify the script for query multiple servers (for example, get some information from them, like Serial Number, asap).
    So..
    Ive cut the lines i didnt need (IP address checking, results etc.. ) and left only JOB related lines..
    Param ([int]$BatchSize=3)
    #list of servers
    $source = Get-Content .\servers_FQDN.txt
    #scriptblock
    $blok = {gwmi win32_bios |select serialnumber}
    $elapsedTime = [system.diagnostics.stopwatch]::StartNew()
    $result = @()
    $itemCount = 0
    ## checking running jobs
    if (get-job|? {$_.name -like "Script*"}){
    write-host "ERROR: There are pending background jobs in this session:" -back red -fore white
    get-job |? {$_.name -like "Script*"} | out-host
    write-host "REQUIRED ACTION: Remove the jobs and restart this script" -back black -fore yellow
    $yn = read-host "Automatically remove jobs now?"
    if ($yn -eq "y"){
    get-job|? {$_.name -like "Script*"}|% {remove-job $_}
    write-host "jobs have been removed; please restart the script" -back black -fore green
    exit
    $offset = 0
    ## measure object
    $itemCount = $source.count
    Write-Host "Script will run against $itemcount servers!"
    ## Script start time mark
    write-host " Script started at $(get-date -Format ("yyyy/MM/dd hh:mm:ss")) ".padright(100) -back darkgreen -fore white
    write-host " (contains $itemCount unique entries)" -back black -fore green
    $activeJobCount = 0
    $totalJobCount = 0
    write-host "Submitting background jobs..." -back black -fore yellow
    ## end of clean, verified code
    for ($offset=0; $offset -le $itemCount;$offset += $batchSize){
    $activeJobCount += 1; $totalJobCount += 1; $HostList = @()
    $HostList += $source |select dnshostname |sort |get-unique |select -skip $offset -first $batchsize
    $j = invoke-command -computername $($source) -scriptblock $blok -asjob
    $j.name = "Script`:$totalJobCount`:$($offset+1)`:$($HostList.count)"
    write-host "+" -back black -fore cyan -nonewline
    write-host "`n$totaljobCount jobs submitted, checking for completed jobs..." -back black -fore yellow
    $recCnt = 0
    while (get-job |? {$_.name -like "Script*"}){
    foreach ($j in get-job | ? {$_.name -like "Script*"}){
    $temp = @()
    if ($j.state -eq "completed"){
    $temp = @()
    $temp += receive-job $j
    $result += $temp
    remove-job $j
    $ActiveJobCount -= 1
    write-host "-" -back black -fore cyan -nonewline
    if ($result.count -lt $itemCount){
    sleep 3
    write-host " "
    write-host " Script finished at $(get-date) ".padright(60) -back darkgreen -fore white
    write-host (" Number of hosts : {0}" -f $($result.count)) -back black -fore green
    write-host (" Elapsed Time : {0}" -f $($ElapsedTime.Elapsed.ToString())) -back black -fore green
    write-host "TEMP variable: $temp"
    $result
    write-host " Script completed all requested operations at $(get-date -Format ("yyyy/MM/dd hh:mm:ss")) ".padright(60) -back darkgreen -fore white
    write-host (" Elapsed Time : {0}" -f $($ElapsedTime.Elapsed.ToString())) -back black -fore green
    There is a bug i didnt discovered yet, the $result table containts $temp*number_of_jobs ... why?
    If i run this script against 10servers, divided by 2 (batchsize 2), it would create 5 background jobs. While $temp contains serial number from every single server, $result will multiply it * 5.
    I can use $temp as result as well, but original author used $result for a reason ...
    I  think the problem starts with line
    foreach($jinget-job|?{$_.name
    -like"Script*"}){
    ...  can u correct this script, so i will get results only 1 time?  In case of 10 servers with batchsize of 2, it will create 5jobs containing 2 queries ...
    Elapsed time is now ~24sec, i think it should be done in around 6..

    .. ah.. figured it out..
    wrong:
    $HostList += $source |select dnshostname
    |sort |get-unique
    |select -skip $offset
    -first $batchsize
     $j = invoke-command
    -computername $($source)
    -scriptblock $blok -asjob
    correct:
    $HostList += $source |sort |get-unique |select -skip $i -first $batchsize
    $j = invoke-command -computername $Hostlist -scriptblock $blok -asjob

  • Ruined my contacts with Apple Script, need someone to help me modify the script to undo what I did!

    Hi all, so all my contacts started with "+1". The goal was to erase the "+" and just have all of them start with "1". However, I messed up royally. I ran the following script, which made all my contacts start with "1+1". :
    tell application "Contacts"
              repeat with eachPerson in people
                        repeat with eachNumber in phones of eachPerson
                                  set theNum to (get value of eachNumber)
                                  if (theNum starts with "1+") then
                                            set value of eachNumber to "1" & theNum
                                  end if
                        end repeat
              end repeat
    save
    end tell
    This is messed up in 2 ways. Firstly, I meant to write "+1" in the script, but instead I wrote "1+". Secondly, even if I had written "1+", it still wouldn't make sense, because I'd effectively be telling the program to just add "1" in front of what's already there, including the "+1".
    Could someone please tell me how to modify this script to say:
    If the contact starts with "1+1", then erase the "1+1". Then I would need another script to take all my numbers and add "1" in front of them.

    What you want to do is simply delete the first few characters from the phone number, yes?
    How about something like this:
                             repeat with eachNumber in phones of eachPerson
                                            set theNum to (get value of eachNumber) as string
                                            if (theNum starts with "1+1") then
                     set myFixedNum to (characters 3 thru -1) of theNum
                                            else if (theNum starts with "+1") then
                                                           set myFixedNum to (characters 2 thru -1) of theNum
                                            end if
                                            set value of eachNumber to (myFixedNum as string)
                              end repeat
    That will take you from 1+1 or +1 to 1 in one easy step.

  • Modifying standard script

    helo experts i modified standard script medruck into some zscript and i made some changes but its not showing the changes in the print preview why?and whats is the ME9F can any one explain the steps for modifying a standard sap script as per the requirements?or if u show any link it will be helpful...

    Hi,
    You need to go to transaction NACE and replace standard SAPScript with your custom SAPScript.
    Path: NACE -> Select EF (Application) -> Click Output Types button -> Select NEU (if you use standard one) -> Double click on Processing Routine -> Click Change mode ->  Replace Medruck with your custom SAPScript -> Save.
    ME9F is the standard program to create PO message output. In your case, perhaps it can be used to generate and/or print SAPScript.
    Regards,
    Ferry Lianto

  • How to modify the scripts

    hi,
    any body could u help me regarding "how to modify the scripts?
    how to  add disclaimer terms in footer window? that is not connected in stand program?
    give any realtime seniro with screen -shot .
    give one realtime seniro  plz.
    i will be waiting for reply.
    regards,
    eswar.

    Hi,
    go to SE71 T code
    enter the std script, display
    from the second page Copy the script to the ZSCRIPT with EN as lang
    and do the modifications in that Zscript and that has to be attached in the NACE t code for the related Output type and Driver program.
    for example
    for PO MEDRUCK is the std Script Copy it to ZMEDRUCK and do the changes.
    then in NACE select the output type NEU and attache it to SAPFM05P program and remove the MEDRUCK and keep ZMEDRUCK.
    reward if useful
    Regards

  • Modify shell script for alerts...

    Hello,
    had a question with regards to a simple script i wrote...it take care of our every hour archive backup...NOT GOOD IN SHELL SCRIPTING....i get e-mail every single time its backed up.....i want this script to be modified in a way...where i get e-mail notification only and only if the backup fails for whatever reason...here is the script..can someone help me modifying this script....
    export MMSG=/tmp/$$.mail
    export ADDR="[email protected]"
    export ORACLE_SID=test
    export ORACLE_HOME=/u01/oracle/10g
    rm -f $$MMSG > /dev/null 2>&1
    echo "ARCHIVE BACKUP STARTED: "'date'
    echo "ARCHIVE BACKUP STARTED: "'date' > $MMSG
    /u01/oracle/10g/bin/rman target / @/home/oracle/scripts/archive_1.scr >> $MMSG 2>&1
    echo "ARCHIVE BACKUP COMPLETED: "'date'
    echo "ARCHIVE BACKUP COMPLETED: "'date' >> $MMSG
    if [ -f $MMSG ]
    then
    mailx -s "Archive Backup Status" $ADDR < $MMSG
    fi
    rm -f $MMSG > /dev/null 2>&1
    -------------------------------------------------------------------------------------------------------

    Try this:
    export MMSG=/tmp/$$.mail
    export ADDR="[email protected]"
    export ORACLE_SID=test
    export ORACLE_HOME=/u01/oracle/10g
    rm -f $$MMSG > /dev/null 2>&1
    echo "ARCHIVE BACKUP STARTED: "'date'
    echo "ARCHIVE BACKUP STARTED: "'date' > $MMSG
    /u01/oracle/10g/bin/rman target / @/home/oracle/scripts/archive_1.scr >> $MMSG 2>&1
    rc=$?
    if [ $rc -eq 0 ]
    then
      echo "ARCHIVE BACKUP COMPLETED: "'date' 
      echo "ARCHIVE BACKUP COMPLETED: "'date' >> $MMSG
    else
      echo "ARCHIVE BACKUP FAILED: "'date' 
      echo "ARCHIVE BACKUP FAILED: "'date' >> $MMSG
      mailx -s "Archive Backup Status" $ADDR < $MMSG
    fi

  • Cannot modify logic script on BPC 10.0

    Hello All,
    I need to change a simple logic in our existing logic script. I changed, validated and hit a save button. It says that "The Script Logic file has been updated". However, my change is not saved. When I open a script Logic after I saved, I see the original one only.
    I talked to BASIS team to check the PROCTIMEOUT on server and found that it has 3600. Which is two times higher than SAP recommended. There are about 200 lines in logic scripts.
    Could you please help why I can not modify the logic scripts?
    Thank you very much in advance!!!
    Thanks
    Indra

    Hi Indra,
    I dont think its related to the timeout settings of a DIA process. Could you please check if you have proper authorizations to Update the script Logic in BPC  ?
    Regards
    Ram

  • Can someone help me modify a script file?

    Hi Everyone!
    I am working on a couple videos in AE that need subtitles.
    I found this script that would work for me really well:
    // Subtitle generator by !Rocky
    // modified by Colin Harman ( http://colinharman.com/ ) to work on a Mac
    // Save this code as
    // "subtitles.jsx"
    // Create a text file with your subtitles.
    // Each line of text is one on-screen line.
    // To have several lines on-screen at the same time,
    // simply separate them with a pipe ( | ) character.
    // eg "Character 1 talks|Character 2 interrupts"
    // Create a new text layer in your comp, adjust its position,
    // make sure the text's centered, so it looks nice
    // Add markers (Numpad *) where each subtitle line must be shown/hidden.
    // With the text layer selected, run the script, and select the subtitles file.
    // Enjoy!
    function makeSubs() {
      var layer = app.project.activeItem.selectedLayers[0];
      if (layer.property("sourceText") != null) {
       var textFile = File.openDialog("Select a text file to open.", "");
       if (textFile != null) {
        var textLines = new Array();
        textFile.open("r", "TEXT", "????");
        while (!textFile.eof)
         textLines[textLines.length] = textFile.readln();
        textFile.close();
        var sourceText = layer.property("sourceText");
        var markers = layer.property("marker");
        for (var i = sourceText.numKeys; i >= 1; i--)
         sourceText.removeKey(i);
        var line = 0;
        var subTime, subText;
        for (var i = 1; i <= markers.numKeys; i++) {
         subTime = markers.keyTime(i);
         sourceText.setValueAtTime(0, " ");
         if ((i % 2) == 0) {
          subText = " ";
         else {
          subText = textLines[line].replace("|", "\x0d\x0a");
          line++;
         sourceText.setValueAtTime(subTime, new TextDocument(subText));
    makeSubs();
    Except there is one problem. With this script, the first marker makes the first line show, the second marker makes the first line disappear and the third marker makes the second line show. (etc..)
    Can this be modified in a way that the first marker would make the first line show, the second marker would make the second line show (etc..) As I don't need "empty" subtitles in this case.
    Thanks,
    Daniel

    Hi,
    I get an error at line 50 but it seems to be working fine. I will test it on one of the videos later today.
    Thanks for the help!

  • How to modify Smartforms & Script on new Macbook

    Hi there
    I am new to Macbook but i have install SAP JAVA GUI.
    Able to work on SAP, but not able to work on SAMRTFORMS & SAP SCRIPT
    Can any one tell me how to modify them on MACBOOK,
    Thanks  in ADVANCE.

    Hello,
    unfortunately, authoring functionality for smart forms is only available in SAP GUI for Windows.
    See [note 736147|https://service.sap.com/sap/support/notes/736147].
    Best regards
    Rolf-Martin

  • Modifying existing script - modifying how data is written out to csv

    I have an existing script written in Powershell 3.0 that gathers data from my virtual machines.  It's working to give me the data, but I'd like to modify how it writes it out.  Currently the data looks as follows:
    I would prefer the output to be all one one line as follows:
    Here is my script.  How would I modify this to give me the .csv file with all data for each server on one line?
    #param (
    $inputFile = "C:\Apps\Powershell\IP_Mac\testlist.txt"
    $csvFile = "C:\Apps\Powershell\IP_Mac\results.csv"
    $report = @()
    foreach($Computer in (gc -Path $inputFile)){
    get-wmiobject -computer $Computer win32_logicaldisk -filter "drivetype=3" | ForEach-Object {
    $device = $_.deviceid
    $freespce = ($_.freespace/1GB).tostring("0.00")+"GB"
    $Totalspce = ($_.size/1GB).tostring("0.00")+"GB"
    if(Test-Connection -ComputerName $Computer -Count 1 -ea 0) {
    $Networks = Get-WmiObject Win32_NetworkAdapterConfiguration -ComputerName $Computer | ? {$_.IPEnabled}
    foreach ($Network in $Networks) {
    $IPAddress = $Network.IpAddress[0]
    $SubnetMask = $Network.IPSubnet[0]
    $DefaultGateway = $Network.DefaultIPGateway
    $DNSServers = $Network.DNSServerSearchOrder
    $MACAddress = $Network.MACAddress
    $OutputObj = New-Object -Type PSObject
    $OutputObj | Add-Member -MemberType NoteProperty -Name ComputerName -Value $Computer.ToUpper()
    $OutputObj | Add-Member -MemberType NoteProperty -Name IPAddress -Value $IPAddress
    $OutputObj | Add-Member -MemberType NoteProperty -Name SubnetMask -Value $SubnetMask
    $OutputObj | Add-Member -MemberType NoteProperty -Name Gateway -Value ($DefaultGateway -join “,”)
    $OutputObj | Add-Member -MemberType NoteProperty -Name DNSServers -Value ($DNSServers -join ",")
    $OutputObj | Add-Member -MemberType NoteProperty -Name MACAddress -Value $MACAddress
    $OutputObj | Add-Member -MemberType NoteProperty -Name device -Value $device
    $OutputObj | Add-Member -MemberType NoteProperty -Name Totalspce -Value $Totalspce
    $OutputObj | Add-Member -MemberType NoteProperty -Name freespce -Value $freespce
    #$OutputObj
    $report += $OutputObj
    Write-Output $report
    $report | Select-Object -Property $properties | Export-Csv -Path $csvFile -NoTypeInformation
    Thank you.

    Try it like this:
    #param (
    $inputFile = "C:\Apps\Powershell\IP_Mac\testlist.txt"
    $csvFile = "C:\Apps\Powershell\IP_Mac\results.csv"
    $report = foreach($Computer in (gc -Path $inputFile)){
    $devices = get-wmiobject -computer $Computer win32_logicaldisk -filter "drivetype=3" | ForEach-Object {
    $device = $_.deviceid
    $freespce = ($_.freespace/1GB).tostring("0.00")+"GB"
    $Totalspce = ($_.size/1GB).tostring("0.00")+"GB"
    New-Object PSObject -property @{device=$device;freespce=$freespce;Totalspce=$Totalspce}
    if(Test-Connection -ComputerName $Computer -Count 1 -ea 0) {
    $Networks = Get-WmiObject Win32_NetworkAdapterConfiguration -ComputerName $Computer | ? {$_.IPEnabled}
    foreach ($Network in $Networks) {
    $IPAddress = $Network.IpAddress[0]
    $SubnetMask = $Network.IPSubnet[0]
    $DefaultGateway = $Network.DefaultIPGateway
    $DNSServers = $Network.DNSServerSearchOrder
    $MACAddress = $Network.MACAddress
    $OutputObj = New-Object -Type PSObject
    $OutputObj | Add-Member -MemberType NoteProperty -Name ComputerName -Value $Computer.ToUpper()
    $OutputObj | Add-Member -MemberType NoteProperty -Name IPAddress -Value $IPAddress
    $OutputObj | Add-Member -MemberType NoteProperty -Name SubnetMask -Value $SubnetMask
    $OutputObj | Add-Member -MemberType NoteProperty -Name Gateway -Value ($DefaultGateway -join “,”)
    $OutputObj | Add-Member -MemberType NoteProperty -Name DNSServers -Value ($DNSServers -join ",")
    $OutputObj | Add-Member -MemberType NoteProperty -Name MACAddress -Value $MACAddress
    $i = 0
    Foreach ($dev in $devices) {
    $OutputObj | Add-Member -MemberType NoteProperty -Name device$i -Value $dev.device
    $OutputObj | Add-Member -MemberType NoteProperty -Name Totalspce$i -Value $dev.Totalspce
    $OutputObj | Add-Member -MemberType NoteProperty -Name freespce$i -Value $dev.freespce
    $i ++
    $OutputObj
    Write-Output $report
    $report | Select-Object -Property $properties | Export-Csv -Path $csvFile -NoTypeInformation
    You were writing a row for each drive, I basically just wrote the drive information to an array and looped through that array when adding members.  I tested this and it worked for me.  Note that you can't have the same value names when you add-member
    so I appended a numeral to differentiate them.
    I hope this post has helped!

Maybe you are looking for

  • Mac pro (2013) fails to see usb 3.0 connected drives in boot selection screen

    Hi, I am using the late MacPro and have three drives attached via an USB 3.0 hub (Anker Uspeed USB 3.0 7 Port Hub). The hub has a VIA VL812 chipset with the latest firmware update (9081) - I have verified this. My problem is, when I enter the boot de

  • PL-SQL Solve: Using INSTR and SUBSTR

    I am trying to work on this and cannot get a solution. Please help You have to use INSTR and SUBSTR to solve Question: You have the following acceptable value Numberic: 0-34 80-100 or Non Numberic X S U D- D D+ Im have to use INSTR and SUBSTR functio

  • Order Processing

    I ordered an iphone though telesales yesterday around 12 or so, I received the confirmation and that my order was being processed at 2:21pm When should I expect to receive my package? Friday or Monday?

  • IBooks Library not synching between iPad & Macbook Pro

    I've loaded PDFs into my iPad and Macbook Pro ibook libraries, but they are not synching between the devices. All synching has been turned on in preferences on my Mac, iTunes and iPad. Any suggestions as to how to get both devices listing same ibook

  • Add pre-saved text to selected Purchase Orders

    Hello Gurus. I have a question. I know that I can have a Purchasing Text saved on a specific vendor so that every time I create a Purchase Order for that particular vendor, the text will be included and printed. What I'm looking for is a text that I