Write Progress through Whole Script (instead of Timer or through per function)

Hello Team,
Is it possible to use the write-progress to begin a the top of a script and run through each function of the script (instead of a timer or per function) and at the end of the script complete?
For example, here I use a timer:
for ($i =1;$i = le 100; $i++)
function sWriteLogInformation
out-file
-FilePath $strLog
-Input Object
-Append: $true
-Confirm:$false
-encoding "Unicode"
Write-Host -Object $strText
Get-Process $ProcessName -ErrorAction SilentlyContinue
If (-not $?)
strText = "Application is not running."
Write-Host $strText
Else
Stop-Process -processname $processName
write-Host "Application Closed"
Write Progress -Activity "Please wait..$strText" -status "$i% Complete" -percentComplete $i;
start-sleep milliseconds 50
But I would rather it go through each of the steps/function in the script and close when finished.
Any input appreciated.
Thanks!

Two suggestions:  
Move the function outside of the for loop, there's no reason to define the same function 100 times.  It may not be a problem with this script, but with a large data set it will affect performance.  And it's just plain bad practice.
Move the Write-Progress command to follow the initial for statement so it is displayed immediately instead of after processing the first item.
As jrv suggested, you can have multiple write-progress statements that provide more information for each step, perhaps like this:
function sWriteLogInformation ($strText) {
out-file
-FilePath $strLog
-Input $strText
-Append: $true
-Confirm:$false
-encoding "Unicode"
Write-Host -Object $strText
for ($i =1;$i = le 100; $i++) {
Write Progress -Activity "Please wait.." -status "Checking $ProcessName" -percentComplete $i
If (Get-Process $ProcessName -ErrorAction SilentlyContinue) {
Write Progress -Activity "Please wait.." -status "Stopping $ProcessName" -percentComplete $i
Stop-Process -processname $processName
sWriteLogInformation "$processName stopped at $(get-date)"
} Else {
sWriteLogInformation "$processName not running."
Write Progress -Activity "Please wait.." -status "Inserting artificial delay" -percentComplete $i
start-sleep milliseconds 50
Not sure where $ProcessName or $strLog are being defined.  I modified your script to clean it up a bit and remove some unnecessary code.
I hope this post has helped!

Similar Messages

  • Write-Progress in PowerShell script for installing Missing Updates

    Hi, I had a previous question here
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/88931488-3b2c-4c08-9ad3-6651ba9bbcef/action?threadDisplayName=progress-indicator-for-installing-missing-sccm-2012-r2-updates
    But that method is not working as expected.  The progress bar displays then continues to increment past 100 throwing an error each time.
    I'm thinking I could use a foreach loop for the missing updates but I'm just lost when it comes to Powershell syntax.
    For example:
    # Get the number of missing updates
    [System.Management.ManagementObject[]] $CMMissingUpdates = @(GWMI -ComputerName $server -query "SELECT * FROM CCM_SoftwareUpdate WHERE ComplianceState = '0'" -namespace "ROOT\ccm\ClientSDK") #End Get update count.
    $result.UpdateCountBefore = "The number of missing updates is $($CMMissingUpdates.count)"
    #Install missing updates.
    #Begin example code, not tested.
    Foreach ($update in $CMMissingUpdates)
    $i++
    If ($CMMissingUpdates.count) {
    $CMInstallMissingUpdates = (GWMI -ComputerName $server -Namespace "root\ccm\clientsdk" -Class "CCM_SoftwareUpdatesManager" -List).InstallUpdates($CMMissingUpdates)
    Do {
    Start-Sleep -Seconds 15
    [array]$CMInstallPendingUpdates = @(GWMI -ComputerName $server -query "SELECT * FROM CCM_SoftwareUpdate WHERE EvaluationState = 6 or EvaluationState = 7" -namespace "ROOT\ccm\ClientSDK")
    #end my example code.
    #The code below is working to install updates but Write-Progress isn't.
    If ($CMMissingUpdates.count) {
    #$result.UpdateCountBefore = "The number of missing updates is $($CMMissingUpdates.count)"
    $CMInstallMissingUpdates = (GWMI -ComputerName $server -Namespace "root\ccm\clientsdk" -Class "CCM_SoftwareUpdatesManager" -List).InstallUpdates($CMMissingUpdates)
    #Set the missing updates to variable for progress indicator.
    $updates = $CMMissingUpdates.Count
    $Increment = 100 / $updates
    $Percent = 0
    Do {
    Start-Sleep -Seconds 15
    [array]$CMInstallPendingUpdates = @(GWMI -ComputerName $server -query "SELECT * FROM CCM_SoftwareUpdate WHERE EvaluationState = 6 or EvaluationState = 7" -namespace "ROOT\ccm\ClientSDK")
    #Not 100% sure $result.UpdateCountBefore is needed below.
    $result.UpdateCountBefore = "The number of pending updates for installation is: $($CMInstallPendingUpdates.count)"
    Write-Progress -Activity "Updates are installing..." -PercentComplete $Percent -Status "Working..."
    $Percent = $Percent + $Increment
    } While (($CMInstallPendingUpdates.count -ne 0) -and ((New-TimeSpan -Start $StartTime -End $(Get-Date)) -lt "00:45:00"))
    Write-Progress -Activity "Updates Installed" -Status "Done" -Completed
    } ELSE {
    $result.UpdateCountAfter = "There are no missing updates."}
    $result

    The increment should be 100  / (max number of items)
    That will not exceed 100 through (max number of items ) iterations in a loop
    Mathematically that can be written as 
    100 / (Max Number of items) * (max number of items ) iterations in a loop
    = 100 * ( (Max Number of Item) / (Number Iterations in a loop) )
    = 100 * 1 = 100
    The (max number of items) and (Number of Iterations in a loop ) need to be based on the same number.
    In the script, it is not based on the same number.
    The maximum number of items is $CMMissingUpdates.Count
    The number of iterations in the loop  is based on the condition 
    ($CMInstallPendingUpdates.count -ne 0)
    Which causes the iterations of the loop to exceed $CMMissingUpdates.Count
    Assuming the $CMInstallPendingUpdates.count is going down (is decremented) through the loop, then
    $Increment = 100 /
    $CMInstallPendingUpdates.count

  • Write-Progress display - How to get rid of it when complete?

    This seems straight forward, but I haven't seen/found the answer...
    My progress bars hang around too long.  I would like them to go away when complete, but they don't always.
    Typically the Write-Progress is within a loop, and it works.  Then imediately after the loop I add "Write-Progress -Complete", but that doesn't seem to do it.
    What am I missing?

    Not sure, but I don't think so...
    There is only one instance of the write-progress cmdlet.  It executes many times within the loop.
    Another question comes to mind... what is the -Completed argument for?  Should write-progress be called with that argument to close the display?  Or, when is that argument appropriate?
    I see Write-Progress twice:
    While( -NOT $Script:RecordSetG.EoF )
    { #...Some code
    $intCounterL ++
    If( $intRecordCountL -gt 0 )
    { $dblPercentageL = 100*( $intCounterL / $intRecordCountL )
    $intPercentageL = [int]$dblPercentageL
    $intSecondsLeftL = ( $intRecordCountL - $intCounterL ) / 24
    <em><strong>Write-Progress</strong></em> `
    -Activity "Building mailbox objects..." `
    -PercentComplete $intPercentageL `
    -SecondsRemaining $intSecondsLeftL `
    -CurrentOperation "$intPercentageL% complete" `
    -Status "Please wait."
    }#End If
    }#WEnd
    <em><strong>Write-Progress -Completed</strong></em>
    I was suggesting eliminating the second one.

  • I am sharing my macbook pro over a network with windows 7, however through windows 7 I can access my whole computer instead of just the shared files!

    I am sharing my macbook pro over a network with windows 7, however through windows 7 I can access my whole computer instead of just the shared files!

    Hi Sig,
    The issue is that i only want the shared folders to be accessed through windows 7.
    Whats the point otherwise to have shared folders?
    thanks..

  • Number of windows servers reboot time through PowerShell scripting

    This code is using for one server ----Get-WmiObject win32_operatingsystem | select csname, @{LABEL='LastBootUpTime';EXPRESSION={$_.ConverttoDateTime($_.lastbootuptime)}}
    How to get more than one server reboot time through PowerShell scripting? 
    cheers
    uday

    #Method 1#When you have few servers which you can quicly type
    'localhost' , 'localhost' | %{Get-WmiObject win32_operatingsystem |
    select csname, @{LABEL='LastBootUpTime';EXPRESSION={$_.ConverttoDateTime($_.lastbootuptime)}}}
    #Mehod 2#When you have huge list you can make csv with header and use $_.headername
    Import-CSV C:\Temp\Serverlist.csv | %{Get-WmiObject win32_operatingsystem -ComputerName $_.ServerName |
    select csname, @{LABEL='LastBootUpTime';EXPRESSION={$_.ConverttoDateTime($_.lastbootuptime)}}}
    #Method 3
    #Same as method 2 but using text file
    $pc = Get-Content C:\Temp\Serverlist.txt
    foreach($server in $pc){
    Get-WmiObject win32_operatingsystem -ComputerName $server |
    select csname, @{LABEL='LastBootUpTime';EXPRESSION={$_.ConverttoDateTime($_.lastbootuptime)}}
    Regards Chen V [MCTS SharePoint 2010]

  • Disconnect wire through VI scripting

    How to disconnect wire between two terminals through VI scripting?
    Solved!
    Go to Solution.

    Jeff·Þ·Bohrer wrote:
    There is a "Metodology" here that triggers my "Wrongometer"  
    Spoiler (Highlight to read)
    The "Wrongometer"(tm) is still under develoment, and not for public use
    The "Wrongometer"(tm) is still under develoment, and not for public use
    why would you need to programatically delete a datapath?  And I'm curious-- What application would you like to build that needs that?
    You beat me to it!  I was curious also, because I never ran into a situation where that would be needed.
    There are two reasons I'd like to know a little bit more about the "why".
    The first reason is a bit selfish.  I'd like to learn about new situations and file them away for later - this has helped me so many times I have lost count.
    The other reason is that maybe if we learned the reaoning behond the request, we can help you to fulfill it in an easier, more efficient manner.
    Kind of like if someone asks you the best way to tie a rope to a bumper, instead of telling him the best knots to use, if you knew he wanted to pull a trailer, thenyou could recommend a trailer hitch instead!
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Specify the GUI declaratively in ActionScript like in JavaFX Script instead of MXML

    After reading a bit about JavaFX Script (which is actually remarkebly close to ActionScript 3) as a developer I thought the way one can specify the GUI declaratively in JavaFX Script via JSON-like notation for the components is pretty cool. It would be nice to have something like that in Flex/ActionScript too. The advantages I see over MXML are:
    1) a more compact notation than XML which is nice from a developers view point who actually writes this kind of code. Of course the idea would be that designers still design the GUI with graphical tools that generate this code but if you have to dive in and edit the code it's nice not to have to deal with verbose XML and I think even designers can easily understand JSON-like code; don't just assume that designers love XML because HTML was based on SGML! I'm not so sure if today many designers really still know raw HTML that well (like in 1997, the early days...). Server side developers probably know it better because they have to adapt it to jsp or asp or whatever framework.
    2) The fact that it's all ActionScript gives a seamless integration between just composing the components to form the GUI and adding scripts to add additionial behavior instead of mixing XML with actionscript code => no more need for those nasty CDATA blocks! It would also be easy for development tools like Flexbuilder to give a seamsless experience with code completion and zooming in on the code because it's all Actionscript! There's also no need for a separate expression language to tie the MXML to the underlying Actionscript. It would it also make easier to create custom components (not just simple composition components which is really easy in MXML) because you don't have to implement separate XML tags.
    here's a short JavaFX Script example:
    Frame {
    content: GroupPanel {
    var myRow = Row { alignment: BASELINE }
    var label_col = Column { alignment: TRAILING }
    var field_col = Column { alignment: LEADING }
    rows: [myRow]
    columns: [label_col, field_col]
    content:
    [SimpleLabel {
    row: myRow
    column: label_col
    text: "Type your text here:"
    TextField {
    row: myRow
    column: field_col
    columns: 50
    visible: true
    Note that this shouldn't be confused with programmatically specifying the GUI in Actionscript (which is possible today as an alternative to MXML). What I propose is at a (slightly) higher level: you don't give a detailed sequence of methods/functions to call to construct the GUI (i.e. HOW to do it) but just specify WHAT you want.
    Hopefully some Adobe Flex will see this and think about it. Although I think MXML is not too bad and I can live with it if I have to ;)

    I like that idea Sean. A standard and well-supported way to separate MXML and code would be good. I'd love to have builder support a MVC style triad for MXML files, with the
    model.as being simply an all-public-all-bindable class full of VOs and view-specific information, any view-manipulation and view<->app communications in the
    controller.as, and nothing but bindings and layour in the MXML. There's (almost) nothing stopping you doing this by hand at the moment, but it's a pain, and developers wouldn't stick to it for very long, when they need to create and maintain 3 separate files for that simple "error dialog" without a hand from Builder.
    Then again, I'd rather Adobe spent the time that would take on opening and better-documenting builder's APIs, so we can write our own plugins easily, but that's my greedy side- A standard builder-supported MVC pattern for custom MXML components would be aweseome for people that aren't me :)
    -Josh
    As for JavaFX, I don't care for it.
    On Tue, Sep 30, 2008 at 7:56 AM, Sean Christmann
    <
    [email protected]> wrote:
    A new message was posted by Sean Christmann in
    Developers --
      specify the GUI declaratively in ActionScript like in JavaFX Script instead of MXML
    Jason you bring up a good point on a concept that I think Adobe should
    poach from a different framework, Silverlight. In Silverlight the
    code-behind pattern is automatic and very nice to work with. Every
    interface can be composed of both a layout file and a script file, and
    they get composited into the SAME class at compile time. So you can
    have both a FileDialog.mxml and FileDialog.as file that know about each
    other automatically, without the need to subclass one from the other.
    Sean
    Jason Stafford wrote:
    A new message was posted by Jason Stafford in
    Developers --
      specify the GUI declaratively in ActionScript like in JavaFX Script instead of MXML
    Personally, I like the separation between the MXML and ActionScript.
    We're working on a large project, and so we have all the ActionScript
    separate from the MXML files.  For example we'll have something like
    filedialoglayout.mxml, and then
    filedialog.as that is a subclass of
    filedialoglayout.  All event handlers and the like are setup in the
    filedialog.as file - the mxml file doesn't know about any function names.
    Advantages:
    MXML files become layout only - and are more easily shared and worked on
    with non-technical people
    ActionScript is all in *.as files: no CDATA blocks and no FlexBuilder
    quirks where editing ActionScript inside a CDATA block doesn't work
    quite like in a real AS file.
    For simple experiments, and for learning, it's obviously nice to have
    everything in one mxml file, but in a big project like ours, the
    separation helps keep things clearer and more maintainable.
    Why use the mxml at all?  The MXML files are nice to edit with the
    visual editor in Flex Builder, and it's much easier to apply styles and
    embed assets in MXML than it is in pure ActionScript.
    I think two ways to talk about the same thing (XML and ActionScript) is
    already almost one too many - adding a third (JSON) would really be too
    much.
    Just my thoughts.
    -Jason Stafford
    Sean Christmann wrote:
    A new message was posted by Sean Christmann in
    Developers --
    specify the GUI declaratively in ActionScript like in JavaFX Script
    instead of MXML
    This reminds me of a certain workflow pattern that has emerged for us
    which might help provide some insight on this topic. I'm working on a
    project with a couple other developers which connects to a webservice
    for supplying clientside data. This data is available in both json
    notation and xml notation. The thing is, while the developers have
    overwhelmingly agreed that we should be consuming the json version
    since it can be parsed faster and provide more meaningful context for
    objects (ie strings vs ints vs arrays etc...), all these same
    developers rely exclusively on the xml notation when asking questions
    about the data or passing structures around to discuss.
    I see the same thing when looking at JavaFX and MXML. JavaFX might
    allow for more accurate structures and might be able to be compiled
    faster, but MXML is better for being self documenting even if it
    requires more verbosity.
    Sean
    Matt Chotin wrote:
    A new message was posted by Matt Chotin in
    Developers --
      specify the GUI declaratively in ActionScript like in JavaFX Script
    instead of MXML
    I'd be curious what other people think.  I see MXML as a distinct
    advantage over doing the pseudo-script stuff.  I really don't like
    the JavaFX system actually.
    Matt
    On 9/28/08 10:33 AM, "neo7471"
    <[email protected]> wrote:
    A new discussion was started by neo7471 in
    Developers --
      specify the GUI declaratively in ActionScript like in JavaFX Script
    instead of MXML
    After reading a bit about JavaFX Script (which is actually remarkebly
    close to ActionScript 3) as a developer I thought the way one can
    specify the GUI declaratively in JavaFX Script via JSON-like notation
    for the components is pretty cool. It would be nice to have something
    like that in Flex/ActionScript too. The advantages I see over MXML are:
    1) a more compact notation than XML which is nice from a developers
    view point who actually writes this kind of code. Of course the idea
    would be that designers still design the GUI with graphical tools
    that generate this code but if you have to dive in and edit the code
    it's nice not to have to deal with verbose XML and I think even
    designers can easily understand JSON-like code; don't just assume
    that designers love XML because HTML was based on SGML! I'm not so
    sure if today many designers really still know raw HTML that well
    (like in the 1997, the early days...). Server side developers
    probably know it better because they! have to adapt it to jsp or asp
    or whatever framework.
    2) The fact that it's all ActionScript gives a seamless integration
    between just composing the components to form the GUI and adding
    scripts to add additionial behavior instead of mixing XML with
    actionscript code => no more need for those naster CDATA blocks! It
    would also be easy for development tools like Flexbuilder to give a
    seamsless experience with code completion and zooming in on the code
    because it's all Actionscript! There's also no need for a separate
    expression language to tie the MXML to the underlying Actionscript.
    It would it also make easier to create custom components (not just
    simple composition components which is really easy in MXML) because
    you don't have to implement separate XML tags.
    here's a short JavaFX Script example:
    Frame {
        content: GroupPanel {
        var myRow = Row { alignment: BASELINE }
        var label_col = Column { alignment: TRAILING }
        var field_col = Column { alignment: LEADING  }
        rows: [myRow]
        columns: [label_col, field_col]
        content:
        [SimpleLabel {
        row: myRow
        column: label_col
        text: "Type your text here:"
        TextField {
        row: myRow
        column: field_col
        columns: 50
        visible: true
    Note that this shouldn't be confused with programmatically specifying
    the GUI in Actionscript (which is possible today as an alternative to
    MXML). What I propose is at a (slightly) higher level: you don't give
    a detailed sequence of methods/functions to call to construct the GUI
    (i.e. HOW to do it) but just specify WHAT you want.
    Hopefully some Adobe Flex will see this and think about it. Although
    I think MXML is not too bad and I can live with it if I have to ;)
    View/reply at specify the GUI declaratively in ActionScript like in
    JavaFX Script instead of MXML
    <
    http://www.adobeforums.com/webx?13@@.59b69b42>
    Replies by email are OK.
    Use the unsubscribe
    <
    http://www.adobeforums.com/webx?280@@.59b69b42!folder=.3c060fa3>
    form to cancel your email subscription.
    View/reply at
    <
    http://www.adobeforums.com/webx?13@@.59b69b42/0>
    Replies by email are OK.
    Use the unsubscribe form at
    <
    http://www.adobeforums.com/webx?280@@.59b69b42!folder=.3c060fa3> to
    cancel your email subscription.
    <div><div></div><div>
    Jason Stafford
    Principal Developer
    Inspiration Software, Inc.
    The leader in visual thinking & learning
    Now available - Kidspiration(r) 3, the visual way to explore and understand words, numbers and concepts.
    Learn more at
    www.inspiration.com/kidspiration.
    503-297-3004 Extension 119
    503-297-4676 (Fax)
    9400 SW Beaverton-Hillsdale Highway
    Suite 300
    Beaverton, OR 97005-3300
    View/reply at
    <
    http://www.adobeforums.com/webx?13@@.59b69b42/2>
    Replies by email are OK.
    Use the unsubscribe form at
    <
    http://www.adobeforums.com/webx?280@@.59b69b42!folder=.3c060fa3></div>
    </div> to cancel your email subscription.
    Sean Christmann | Experience Architect | EffectiveUI | 720.937.2696
    View/reply at
    specify the GUI declaratively in ActionScript like in JavaFX Script instead of MXML
    Replies by email are OK.
    Use the
    unsubscribe form to cancel your email subscription.
    "Therefore, send not to know For whom the bell tolls. It tolls for thee."
    http://flex.joshmcdonald.info/
    :: Josh 'G-Funk' McDonald
    :: 0437 221 380 ::
    [email protected]

  • Forms in PowerShell: putting write-progress onto a pre-made form

    Hello all,
    What I'm wanting to do is use the "Write-Progress" cmdlet and put it onto a form that I've made, instead of having a separate dialogue box for it. Is this possible? Here is the (very simple) form:
    [void][system.reflection.assembly]::LoadWithPartialName("System.Drawing")
    [void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
    $objForm = New-Object System.Windows.Forms.Form
    $objForm.Text = "Test"
    $objForm.Size = New-Object System.Drawing.Size(700,300)
    $objForm.StartPosition = "CenterScreen"
    $Form = $objForm.ShowDialog()

    What exactly are you trying to do?  Write-Progress creates it's own form in the ISE, or just displays text based progress in the console, it doesn't have output that you can manipulate that I'm aware of.
    If you want to create your own form for displaying progress, you most likely need to use this method:
    http://learn-powershell.net/2012/10/14/powershell-and-wpf-writing-data-to-a-ui-from-a-different-runspace/
    Because launching a form from Powershell otherwise runs in a single thread and as long as you're interacting with the form, the script won't be doing anything but waiting for input from the form.
    I hope this post has helped!

  • How can i write a automatic start script in crontab

    Hi All,
    Can anyone please help me in writing a automatic startup script in crontab.... Please tell me the steps to do so... I am trying it unable to do so....
    Thanks and regards
    Amit Raghuvanshi

    Hi Dear,
    Actually i am just trying to startup the database on a specific time of the day for now. I have tried to acheive it but i am failing to start the database through the crontab entry.
    OS: RHEL 3
    DB Version: 9.2.0.3
    Infact i am trying to write a script for RMAN backup but i am failing on the very initial stage of just trying to connect and startup the database through my script.
    Thanks and regards
    Amit Raghuvanshi

  • How to update XML file through UCCX script ?

    Hi,
    I have an UCCX script with MENU step. One of the step is for technical support team. When caller chose this step, information about date and time of the call and calling number should be recorded on a XML file located on the web server.
    This XML is uploaded into the web server , but I don't know how to update it through UCCX script.
    Here is how the XML file looks like:
    <?xml version="1.0" ?>
    <rss version="2.0">
    <channel>
    <title>CALL LOG</title>
    <link></link>
    <description>Support Call log</description>
    <ttl>1</ttl>
    <item>
    <title>2011-08-24 14:56:39 - 00044 123 123 123</title>
    <link></link>
    <description></description>
    </item
    </channel>
    </rss>
    Any idea?
    Thanks,
    O

    Hi
    The 'keyword transform' step uses the template XML file to generate the actual XML file you want to post... the template would be a plain text file uploaded to the repository, and would look like so:
    <?xml version="1.0" ?>
    CALL LOG
    Support Call log
    1
    %%calldatetime%% - %%clinumber%%
    Now - if you had that bit of XML, with correct time/number in it - have you verified know that you can definately just post that XML to a certain URL to get it on the server? Check with whoever manages that server exactly what you need to do to get it to appear - then worry about how you do that from UCCX. It may not be a matter of posting up that XML, you may need it in a different format or something..
    Aaron

  • Sticker printing through sap script

    I m priting specific stickers through sap script.
    An A4 size page contains 8 stickers, 4 in one line.
    No of stickers to be printed are generated dinamically.
    I have put 8 windows on the page. Now i want that if lets say the no of stickers to be printed are 5, then the program should not print the rest 3 stickers.
    So give some solution of hiding or unhiding the rest of the windows.

    call them in the loop..
    give the window name in layout as window1, window2,...window8.
    tkhen.. suppose u wnat 5 windows..
    do 5 times.
    v_num = sy-index.
    condence v_num.
    concatenate 'window' v_num to  v_window.
    call the window.
    enddo.
    Please Close this thread.. when u r problem is solved
    Reward if Helpful
    Regards
    Naresh Reddy K

  • Enable document management for entities through PowerShell script (Dynamic CRM 2013 on premises)

    Hello,
    Can anybody let me know if it is possible to enable document management for entities through PowerShell script for Dynamic CRM 2013 on premises.
    I want power shall script where user will give the entity (Accounts, Contacts etc.)   for the CRM.
    The script should enable the document management for the entity.
    Thank you for your support.

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

  • Execution script too much time than before

    Hi experts,
    We run tunning script on daily basis which analyze multiple table of oracle ebs 11i oracle 10g and we also have execute schema statistics,
    Issue is this it take too much time to complete some time more than 12 hrs. It looks like hang on gathereing statistics Inv and ont schema.
    Kindly give me solution
    e.g
    analyze table inv.mtl_transaction_types compute statistics;
    analyze table wip.wip_schedule_groups compute statistics;
    analyze table WSH.WSH_DELIVERY_DETAILS compute statistics;
    exec DBMS_STATS.GATHER_SCHEMA_STATS('APPS'); ---APPS, APPLSYS, INV,ONT,WSH, SYS, SYSTEM, GL,HR,AR,AP,CE,WIP,
    ---PO,MSC,PJI
    exec DBMS_STATS.GATHER_SCHEMA_STATS('APPLSYS');
    exec DBMS_STATS.GATHER_SCHEMA_STATS('INV');
    exec DBMS_STATS.GATHER_SCHEMA_STATS('ONT');
    exec DBMS_STATS.GATHER_SCHEMA_STATS('WSH');
    Now its taking more than 15 minut and not yet complete.
    Thanks

    but to gather statisics for some schema it takes too much time. First it take 3 hrs for whole script now it is taking more than 15 hrs and some scheam go to
    complete and some are still hang then we have to cancel this job.
    I also experiment to execute one by one schema at that time it is completed normally.Have you done any changes recently (i.e. upgrade, installed new patches, data load ..etc)?
    Have you tried to use different parameters? -- Definition of Parameters Used in Gather Schema Statistics Program [ID 556466.1]
    You could enable trace and generate the TKPROF file to find out why it takes that long to gather schema statistics.
    FAQ: Common Tracing Techniques within the Oracle Applications 11i/R12 [ID 296559.1]
    Enabling Concurrent Program Traces [ID 123222.1]
    How To Get Level 12 Trace And FND Debug File For Concurrent Programs [ID 726039.1]
    I would also suggest you log a SR as "Gather Schema Statistics" is a seeded concurrent program and Oracle Support should be able to help.
    Thanks,
    Hussein

  • Calling sql script through shell script

    Hi All
    I am trying to run one shell script it will execute the sql file which is in UNIX box. Problem here i am facing is
    when i submit the program through front end it taking time to execute and the status in running even for hours and hours. Manually i am terminating the concurrent program.
    But when same shell script when i tried to execute in putty it generating the output with in seconds
    Can you help what may be the error? I used the syntax like this
    Can you help what may be the error? need to change any syntax
    Thanks
    Prem Raj Dasari
    Edited by: Sravprem on Sep 20, 2012 12:43 AM

    Pl post details of OS, database and EBS versions. In your shell script, insert this line as the first line
    set -xthen run the concurrent program and paste the contents of the log of the concurrent program here
    HTH
    Srini

  • Putting cross line under top left corner in a cheque through SAP SCRIPT.

    Hi,
    How to put cross line over top left corner in cheque   (cross cheque) while doing it through  SAP SCRIPT.
    Thanks.

    Hi,
    i can give you two solutions. try the thing which looks fine for you.
    1.  say this is line editor of the script.
    you have to design like this manually(its a bit time consuming for alignments and all - both should align side by side using '/')
    so try the second way.
    2.  make this 'corss' as an image and simply pass as a text on to the window on which you needs this.
    it will be simple and an easy way.
    Thanks & regards,
    Sasi Kanth.

Maybe you are looking for