Powershell Log File

I've searched for script or functions to create a log file from a script I run each night.  The main script just sets variables and then calls other scripts (18 of them).  The last script sends me an email with various information and at times
I've failed to get the email and without having some kind of log file, I'm not sure how to figure out what when wrong.  Is there a simple way to create a log file?  It could be overwritten each night as the only time it would be viewed is if something
when wrong.
Thanks,
Kevin

See this script for logging.
Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________
Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx

Similar Messages

  • Parse log file using powershell

    Hi,
    Am pretty new to Powershell and would require anyone of your assistance in setting up a script which parse thru a log file and provide me output for my requirements below.
    I would like to parse the Main log file for Barra Aegis application(shown below) using powershell.
    Main log = C:\BARRALIN\barralin.log
    Model specific log = C:\BARRALIN\log\WG*.log
    Requirements :
    1. scroll to the bottom of the log file and look for name called "GL Daily" and see the latest date which in the example log below is "20150203"
    note : Name "GL Daily" and date keep changing in log file
    2. Once entry is found i would like to have a check to see all 3 entries PREPROCESS, TRANSFER, POSTPROCESS are sucess.
    3. If all 3 are success i would like to the script to identify the respective Model specific log number and print it out.
    E.g if you see the sample log below for "GL Daily", it is preceded by number "1718" hence script should append the model log path with "WG00" along with 1718, finally it should look something like this  C:\BARRALIN\log\WG001718.log.
    4. If all 3 items or anyone of them are in "failed" state then print the same log file info with WG001718.log
    Any help on this would be much appreciated.
    Thank You.
    Main log file :
    START BARRALINK            Check Auto Update                                                1716  
    43006  20150203 
        Trgt/Arch c:\barralin                                               
        PREPROCESS           success   0 preprocessor: no error                   
        TRANSFER             success   1 Host success: files received             
        POSTPROCESS          success   0 Postprocessor: no error                  
        CONFIRMATION         success   2 No Confirm needed                        
    STOP  43105  20150203 
    START Aegis                GL Monthly                                                    
      1716   43117  20150203 
        Trgt/Arch K:\barraeqr\aegis\qnt\gleqty                              
        PREPROCESS           success   0 preprocessor: no error                   
        TRANSFER             success   1 Host success: files received             
        POSTPROCESS          success   0 Postprocessor: no error                  
        CONFIRMATION         success   2 No Confirm needed                        
    STOP  44435  20150203
    START Aegis                UB Daily                                                    
      1717   43107  20150203 
        Trgt/Arch K:\barraeqr\aegis\qnt\gleqty                              
        PREPROCESS           success   0 preprocessor: no error                   
        TRANSFER             success   1 Host success: files received             
        POSTPROCESS          success   0 Postprocessor: no error                  
        CONFIRMATION         success   2 No Confirm needed                        
    STOP  44435  20150203 
    START Aegis                GL Daily                                                    
        1718   44437  20150203 
        Trgt/Arch K:\barraeqr\aegis\qnt\gleqty                              
        PREPROCESS           success   0 preprocessor: no error                   
        TRANSFER             success   1 Host success: files received             
        POSTPROCESS          success   0 Postprocessor: no error                  
        CONFIRMATION         success   2 No Confirm needed                        
    STOP  50309  20150203 
     

    Hi All,
    I was writing a function in power shell to send email and i was looking to attach lines as and when required to the body of the email. but am not able to get this done..Here's my code
    Function Email ()
    $MailMessage = New-Object System.Net.Mail.MailMessage
    $SMTPClient = New-Object System.Net.Mail.SmtpClient -ArgumentList "mailhost.xxx.com"
    $Recipient = "[email protected]"
    If ($MessageBody -ne $null)
    $MessageBody = "The details of Barra $strsessionProduct model is listed below
    `rHostName : $localhost
    `r Model Run Date : $Date
    `r Model Data Date : $DateList1
    `r`n Click for full job log"+ "\\"+$localhost+"\E$\Local\Scripts\Logs "
    $MailMessage.Body = $MessageBody
    If ($Subject -ne $null) {
    $MailMessage.Subject = $Subject
    $Sender = "[email protected]"
    $MailMessage.Sender = $Sender
    $MailMessage.From = $Sender
    $MailMessage.to.Add($Recipient)
    If ($AttachmentFile -ne $null) { $MailMessage.Attachments.add($AttachmentFile)}
    $SMTPClient.Send($MailMessage)
    $Subject = "Hello"
    $AttachmentFile = ".\barralin.log"
    $MessageBody = "Add this line to Body of email along with existing"
    Email -Recipient "" -Subject $Subject -MessageBody $MessageBody -AttachmentFile $AttachmentFile
    as you can see before calling Email function i did add some lines to $MessageBody and was expecting that it would print the lines for $MessageBody in Email Function along with the new line. But thats not the case.
    I have tried to make $MessageBody as an Array and then add contents to array
    $MessageBody += "Add this line to Body of email along with existing"
    $MessageBody = $MessageBody | out-string
    Even this didnt work for me. Please suggest me any other means to get this done.
    THank You

  • Parsing Log file with PowerShell

    Hey Guys, I have the following line in a txt file (log file) 
    2012-08-14 18:00:00 [ERROR] . Exception SQL error 1 2012-08-14 18:10:00 [ERROR] . Exception SQL error 22012-08-15 18:00:00 [INFO] . Started 
    - Check the most recent entry(s) the last 24 hours
    - if there's an error [ERROR] write-out a statement that says (Critical) with the date-time of the error
    - If there's no erros write-out (Ok)
    So far I learned to write this much and would like to learn more from you:
    $file = "C:\Users\example\Documents\Log.txt" cat $file | Select-String "ERROR" -SimpleMatch

    Hello,
    I am new to PowerShell, and looking for same requirement, here is my function.
    Function CheckLogs()
        param ([string] $logfile)
        if(!$logfile) {write-host "Usage: ""<Log file path>"""; exit}
        cat $logfile | Select-String "ERROR" -SimpleMatch | select -expand line |
             foreach {
                        $_ -match '(.+)\s\[(ERROR)\]\s(.+)'| Out-Null 
                        new-object psobject -Property @{Timestamp = [datetime]$matches[1];Error = $matches[2]} |
                        where {$_.timestamp -gt (get-date).AddDays(-1)}
                        $error_time = [datetime]($matches[1])
                        if ($error_time -gt (Get-Date).AddDays(-1) )
                            write-output "CRITICAL: There is an error in the log file $logfile around 
                                          $($error_time.ToShortTimeString())"; exit(2)
      write-output "OK: There was no errors in the past 24 hours." 
    CheckLogs "C:\Log.txt" #Function Call
    Content of my log file is as follows
    [ERROR] 2013-12-23 19:46:32
    [ERROR] 2013-12-24 19:46:35
    [ERROR] 2013-12-24 19:48:56
    [ERROR] 2013-12-24 20:13:07
    After executing above script, getting the below error, can you please correct me.
     $error_time = [datetime]($matches[1])
    +                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : NullArray
    Cannot index into a null array.
    At C:\PS\LogTest.ps1:10 char:21
    +                     new-object psobject -Property @{Timestamp = 
    [datetime]$match ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : NullArray
    Cannot index into a null array.
    At C:\Test\LogTest.ps1:12 char:21
    +                     $error_time = [datetime]($matches[1])
    +                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : NullArray

  • Sharepoint log files growing huge

    Once again a SharePoint question :)
    I ran the following script against our SharePoint 2013 farm:
    #Specify the location of the CSV file here.
    $r = Import-Csv C:\folder\users.csv
    foreach($i in $r){
    #The following line displays the current user.
    Write-Host "The URL is:"$i.Url
    #Disables the "Minimal Download Strategy" feature under "Site Features".
    #Disable-SPFeature -Identity "MDSFeature" -Url $i.Url -force -confirm:$false
    #Enables the "SharePoint Server Publishing" feature under "Site Features".
    Enable-SPFeature -Identity "PublishingSite" -Url $i.Url -force -confirm:$false
    #Enables the "SharePoint Server Publishing Infrastructure" feature under "Site Collection Features".
    Enable-SPFeature -Identity "PublishingWeb" -Url $i.Url -force -confirm:$false
    The csv file that is being imported contains about 2000+ rows with users' MySite links where we want to en-/disable several features.
    The script does what it is supposed to do, but while running the script and reaching user No. ~15 the log files under "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\LOGS" starts to grow huuuuuuge (~5GB).
    They are mostly filled with this:
    09/17/2014 11:04:27.72 PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable Potentially excessive number of SPRequest objects (18) currently unreleased on thread 6. Ensure that this object or its parent (such as an SPWeb or SPSite) is being properly disposed. This object is holding on to a separate native heap.This object will not be automatically disposed. Allocation Id for this object: {D5F7BC80-8C88-4E17-9985-782F9724F2B9} Stack trace of current allocation: at Microsoft.SharePoint.SPGlobal.CreateSPRequestAndSetIdentity(SPSite site, String name, Boolean bNotGlobalAdminCode, String strUrl, Boolean bNotAddToContext, Byte[] UserToken, SPAppPrincipalToken appPrincipalToken, String userName, Boolean bIgnoreTokenTimeout, Boolean bAsAnonymous) at Microsoft.SharePoint.SPWeb.InitializeSPRequest() at Microsoft.SharePoint.SPWeb.EnsureSPRequest() at Microsof... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
    09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...t.SharePoint.SPWeb.SetAllowUnsafeUpdates(Boolean allowUnsafeUpdates) at Microsoft.SharePoint.SPPageParserNativeProvider.<>c__DisplayClass1.<UpdateBinaryPropertiesForWebParts>b__0() at Microsoft.SharePoint.SPSecurity.RunAsUser(SPUserToken userToken, Boolean bResetContext, WaitCallback code, Object param) at Microsoft.SharePoint.SPPageParserNativeProvider.UpdateBinaryPropertiesForWebParts(Byte[]& userToken, Guid& tranLockerId, Guid siteId, Int32 zone, String webUrl, String documentUrl, Object& registerDirectivesData, Object& connectionInformation, Object& webPartInformation, IntPtr pWebPartUpdater) at Microsoft.SharePoint.Library.SPRequestInternalClass.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUng... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
    09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...host, ISPEnableModuleCallback pModuleContext) at Microsoft.SharePoint.Library.SPRequestInternalClass.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext) at Microsoft.SharePoint.Library.SPRequest.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext) at Microsoft.SharePoint.SPModule.ActivateFromFeature(SPFeatureDefinition featdef, XmlNode xnModule, SPWeb web) at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionModules(SPFeaturePropertyCollection props, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boole... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
    09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...an fForce) at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionElements(SPFeaturePropertyCollection props, SPWebApplication webapp, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boolean fForce) at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags activateFlags, Boolean fForce) at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly) at Microsoft.SharePoint.SPFeatureCollection.CheckSameScopeDependency(SPFeatureDefinition featdefDependant, SPFeatureDependency featdep, SPFeatureDefinition featdefDep... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
    09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...endency, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fMarkOnly) at Microsoft.SharePoint.SPFeatureCollection.CheckFeatureDependency(SPFeatureDefinition featdefDependant, SPFeatureDependency featdep, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fMarkOnly, FailureReason& errType) at Microsoft.SharePoint.SPFeatureCollection.CheckFeatureDependencies(SPFeatureDefinition featdef, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fThrowError, Boolean fMarkOnly, List`1& missingFeatures) at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly) at Microsoft.SharePoint.S... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
    09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...PFeature.ActivateDeactivateFeatureAtSite(Boolean fActivate, Boolean fEnsure, Guid featid, SPFeatureDefinition featdef, String urlScope, String sProperties, Boolean fForce) at Microsoft.SharePoint.SPFeature.ActivateDeactivateFeatureAtScope(Boolean fActivate, Guid featid, SPFeatureDefinition featdef, String urlScope, Boolean fForce) at Microsoft.SharePoint.PowerShell.SPCmdletEnableFeature.UpdateDataObject() at Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessRecord() at System.Management.Automation.CommandProcessor.ProcessRecord() at System.Management.Automation.CommandProcessorBase.DoExecute() at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate) at System.Management.Automati... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
    09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...on.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext) at lambda_method(Closure , Object[] , StrongBox`1[] , InterpretedFrame ) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) at System.... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
    09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess) at System.Management.Automation.CommandProcessorBase.DoComplete() at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(CommandProcessorBase commandRequestingUpstreamCommandsToStop) at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate) at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext) at System.Management.Automation.Interpreter.ActionCallInstruction`6.R... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
    09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...un(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) at System.Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess) at System.Management.Automation.CommandProcessorBase.DoComplete() at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(CommandProcessorBase commandRequestingUpstreamCommandsToStop) at System.Management.Automation.Intern... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
    09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...al.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate) at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper() at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc() at System.Management.Automation.Runspaces.PipelineThread.WorkerProc() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
    09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...() 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
    I tried finding something on the internet on this but either my Google Mojo is gone or there is no one else posting about this.
    Since we do not want to change the logging behavior of SharePoint (unless it is really necessary), I'd like to know if there is something wrong with my code? Is there some parameter I can use to suspend logging for this script? There must be something I'm
    doing horribly wrong :(
    Thanks in advance!
    (If anything I posted is unclear please let me know since English isn't my first language)
    EDIT: There is nothing productive happening on that farm. There is a web application for the MySites and one for a publishing portal (without any significant content).

    It's because MS did a poor job on the SharePoint object model. You shouldn't need to call a 'dispose' method on any object in .Net, the garbage collector should automatically identify a no-longer required object and remove it. Unfortunately, and there might
    be a reason for it, that isn't true for SPWeb or SPSite objects.
    Evidently the Enable-SPFeature comandlet contains a SPSite or SPWeb object and fails to dispose of it.
    You could try using Start-SPAssignment: http://technet.microsoft.com/en-us/library/ff607664%28v=office.15%29.aspx which some have found to be useful to deal with this. Another option would be to create a process that generates a new thread for each row in
    the csv which will result in the objects being destroyed as that process ends.

  • Display string from a log file on a Dashboard?

    Hello everyone,
    I need a little guidance on how to solve this problem in SCOM 2012 R2.
    I need SCOM to do this:
    Read a log file on a specific application server (say its hostname is server21)
    Look for the text: Total number of users: 15
    Display the text “Users on Server21 =
     15” on a SCOM dashboard (or something to that effect)
    Sounds simple enough? Well, I am stumped :-(
    I have read and followed tutorials on internet, telling me how to create a rule and alerts. However I don’t want alerts. I want this data to be simply shown on a dashboard.
    How can I do that?
    PS: I hear that I may have to create my own management pack with only server21 in it. Is that right?
    -Rajeev rajdude.com

    Thanks for the tip. The powershell grid widget is pretty powerful. However it will take me quite some time and effort to write a PS script which can extract the exact info I need from that application's log file. I was hoping SCOM's own log parsing
    capabilities would do it.
    By the way, yes, we can create a MP and have only one server in it. We can use the (free) 
    MPAuthor to make a MP with only one server in it. Here is a video showing how to do it...
    http://www.silect.com/static/mpauthor/MP_Author_Creating_a_New_Single_Server_Application_MP.mp4
    I tried doing what I want using MPAuthor, but it again boiled down to me writing a PS script which can extract the exact info I need
    from that application's log file.
    -Rajeev rajdude.com

  • Problem in Rolling to new a log file only when it exceeds max size (Log4net library)

    Hello,
    I am using log4net library to create log files.
    My requirement is roll to a new log file with name appended with timestamp only when file size exceeds max size (file name ex: log_2014_12_11_12:34:45 etc).
    My config is as follow
     <appender name="LogFileAppender"
                          type="log4net.Appender.RollingFileAppender" >
            <param name="File" value="logging\log.txt" />
            <param name="AppendToFile" value="true" />
            <rollingStyle value="Size" />
            <maxSizeRollBackups value="2" />
            <maximumFileSize value="2MB" />
            <staticLogFileName value="true" />
            <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
            <layout type="log4net.Layout.PatternLayout">
              <param name="ConversionPattern"
                   value="%-5p%d{yyyy-MM-dd hh:mm:ss} – %m%n" />
              <conversionPattern
                   value="%newline%newline%date %newline%logger 
                           [%property{NDC}] %newline>> %message%newline" />
            </layout>
          </appender>
    Issue is date time is not appending to file name. 
    But if i set "Rolling style" as "Date or composite", file name gets appended with timestamp, but new file gets created before reaching max file size.(Because file gets created  whenever date time changes, which i dont want) .
    Please help me in solving this issue?
    Thanks

    Hello,
    I'd ask the logfornet people: http://logging.apache.org/log4net/
    Or search on codeproject - there may be some tutorials that would help you.
    http://www.codeproject.com/Articles/140911/log-net-Tutorial
    http://www.codeproject.com/Articles/14819/How-to-use-log-net
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Capturing log files from multiple .ps1 scripts called from within a .bat file

    I am trying to invoke multiple instances of a powershell script and capture individual log files from each of them. I can start the multiple instances by calling 'start powershell' several times, but am unable to capture logging. If I use 'call powershell'
    I can capture the log files, but the batch file won't continue until that current 'call powershell' has completed.
    ie.  within Test.bat
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > a.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > b.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > c.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > d.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > e.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > f.log 2>&1
    the log files get created but are empty.  If I invoke 'call' instead of start I get the log data, but I need them to run in parallel, not sequentially.
    call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > a.log 2>&1
    timeout /t 60
    call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > b.log 2>&1
    timeout /t 60
    call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > c.log 2>&1
    timeout /t 60
    call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > d.log 2>&1
    timeout /t 60call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > e.log 2>&1
    Any suggestions of how to get this to work?

    Batch files are sequential by design (batch up a bunch of statements and execute them). Call doesn't run in a different process, so when you use it the batch file waits for it to exit. From CALL:
    Calls one batch program from another without stopping the parent batch program
    I was hoping for the documentation to say the batch file waits for CALL to return, but this is as close as it gets.
    Start(.exe), "Starts a separate window to run a specified program or command". The reason it runs in parallel is once it starts the target application start.exe ends and the batch file continues. It has no idea about the powershell.exe process
    that you kicked off. Because of this reason, you can't pipe the output.
    Update: I was wrong, you can totally redirect the output of what you run with start.exe.
    How about instead of running a batch file you run a PowerShell script? You can run script blocks or call individual scripts in parallel with the
    Start-Job cmdlet.
    You can monitor the jobs and when they complete, pipe them to
    Receive-Job to see their output. 
    For example:
    $sb = {
    Write-Output "Hello"
    Sleep -seconds 10
    Write-Output "Goodbye"
    Start-Job -Scriptblock $sb
    Start-Job -Scriptblock $sb
    Here's a script that runs the scriptblock $sb. The script block outputs the text "Hello", waits for 10 seconds, and then outputs the text "Goodbye"
    Then it starts two jobs (in this case I'm running the same script block)
    When you run this you receive this for output:
    PS> $sb = {
    >> Write-Output "Hello"
    >> Sleep -Seconds 10
    >> Write-Output "Goodbye"
    >> }
    >>
    PS> Start-Job -Scriptblock $sb
    Id Name State HasMoreData Location Command
    1 Job1 Running True localhost ...
    PS> Start-Job -Scriptblock $sb
    Id Name State HasMoreData Location Command
    3 Job3 Running True localhost ...
    PS>
    When you run Start-Job it will execute your script or scriptblock in a new process and continue to the next line in the script.
    You can see the jobs with
    Get-Job:
    PS> Get-Job
    Id Name State HasMoreData Location Command
    1 Job1 Running True localhost ...
    3 Job3 Running True localhost ...
    OK, that's great. But we need to know when the job's done. The Job's Status property will tell us this (we're looking for a status of "Completed"), we can build a loop and check:
    $Completed = $false
    while (!$Completed) {
    # get all the jobs that haven't yet completed
    $jobs = Get-Job | where {$_.State.ToString() -ne "Completed"} # if Get-Job doesn't return any jobs (i.e. they are all completed)
    if ($jobs -eq $null) {
    $Completed=$true
    } # otherwise update the screen
    else {
    Write-Output "Waiting for $($jobs.Count) jobs"
    sleep -s 1
    This will output something like this:
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    When it's done, we can see the jobs have completed:
    PS> Get-Job
    Id Name State HasMoreData Location Command
    1 Job1 Completed True localhost ...
    3 Job3 Completed True localhost ...
    PS>
    Now at this point we could pipe the jobs to Receive-Job:
    PS> Get-Job | Receive-Job
    Hello
    Goodbye
    Hello
    Goodbye
    PS>
    But as you can see it's not obvious which script is which. In your real scripts you could include some identifiers to distinguish them.
    Another way would be to grab the output of each job one at a time:
    foreach ($job in $jobs) {
    $job | Receive-Job
    If you store the output in a variable or save to a log file with Out-File. The trick is matching up the jobs to the output. Something like this may work:
    $a_sb = {
    Write-Output "Hello A"
    Sleep -Seconds 10
    Write-Output "Goodbye A"
    $b_sb = {
    Write-Output "Hello B"
    Sleep -Seconds 5
    Write-Output "Goodbye B"
    $job = Start-Job -Scriptblock $a_sb
    $a_log = $job.Name
    $job = Start-Job -Scriptblock $b_sb
    $b_log = $job.Name
    $Completed = $false
    while (!$Completed) {
    $jobs = Get-Job | where {$_.State.ToString() -ne "Completed"}
    if ($jobs -eq $null) {
    $Completed=$true
    else {
    Write-Output "Waiting for $($jobs.Count) jobs"
    sleep -s 1
    Get-Job | where {$_.Name -eq $a_log} | Receive-Job | Out-File .\a.log
    Get-Job | where {$_.Name -eq $b_log} | Receive-Job | Out-File .\b.log
    If you check out the folder you'll see the log files, and they contain the script contents:
    PS> dir *.log
    Directory: C:\Users\jwarren
    Mode LastWriteTime Length Name
    -a--- 1/15/2014 7:53 PM 42 a.log
    -a--- 1/15/2014 7:53 PM 42 b.log
    PS> Get-Content .\a.log
    Hello A
    Goodbye A
    PS> Get-Content .\b.log
    Hello B
    Goodbye B
    PS>
    The trouble though is you won't get a log file until the job has completed. If you use your log files to monitor progress this may not be suitable.
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • Log file in project online

    Hallo,
    I Need crate a log file which will contain all transactions made by project online users.
    how can i do that.

    Hello,
    It depends what level of detail you are after? You could exact the Project Server queue log each day if you using the APIs, you could create a console app that runs on a windows schedule task and uses the PSI to exact the queue details. An simple example
    of this for on-premise using PowerShell and the PSI can be seen below:
    https://pwmather.wordpress.com/2012/03/05/projectserver-2010-2007-high-level-audit-export-via-powershell-msproject-ps2010-epm/
    You would just need to probably move this to a console app and get the authentication working for Project Online and the PSI - all doable.
    Alternatively if you wanted more details than what goes via the queue services, you could create you own remote event receivers for Project Online to capture the details.
    http://msdn.microsoft.com/en-us/library/office/ee767690(v=office.15).aspx#pj15_WhatsNew_Events
    http://msdn.microsoft.com/en-us/library/office/ee767687(v=office.15).aspx#pj15_Architecture_EventHandlers
    Paul 
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS |
    MVP | Downloads

  • Most efficient way to consume log files

    Hello everyone,
    I've been absent from the forums for awhile but I'm back at it now... 
    I have a question about the most efficient way to consume log files.  I read in Powershell in action, by Bruce Payette that using a switch statement with a regex worked pretty well, that being said I haven't tried it yet. Select-string is working pretty
    well for me but I have about 10 different entry types that I need to search logs for every 5 minutes and I'm scanning about 15 GB of logs at every interval.  Anyway, if anyone has information about how to do something like that as quickly as possible
    I'd appreciate it.
    1.  piping log files that meet my criteria to select-string
       - This seems to work well but I don't like searching the same files over and over again
    2. running logs through get-content and then building a filter statement
      - This is ok but it seems to use up a fair bit of memory
    3. Some other approach that I haven't thought of yet.
    Anyway, I know this is a relatively nebulous question, sorry about that.  I'm hoping that someone on here knows a really good way to find strings in logs files quickly.
    Hope that helps! Jason

    You can sometimes squeeze out more speed at the expense of memory usage, but filters are pretty fast. I don't see a benefit to holding the whole file in memory, in this case.
    As I mentioned earlier, though, C# code will usually blow PowerShell away in terms of execution time.  Here's a rewrite of what I just did (just for the INI Section pattern, to keep the post size down):
    $string = @'
    #Comment Line
    [Ini-Style Section Line]
    Key = Value Line
    192.168.0.1 localhost
    Some line that doesn't match anything.
    Set-Content -Path .\test.txt -Value $string
    Add-Type -TypeDefinition @'
    using System;
    using System.Text.RegularExpressions;
    using System.Collections;
    using System.IO;
    public interface ILineParser
    object ParseLine(string line);
    public class IniSection
    public string Section;
    public class IniSectionParser : ILineParser
    public object ParseLine(string line)
    object o = null;
    Match match = Regex.Match(line, @"^\s*\[([^\]]+)\]\s*$");
    if (match.Success)
    o = new IniSection() { Section = match.Groups[1].Value };
    return o;
    public class LogParser
    public static IEnumerable ParseFile(string fileName, ILineParser[] lineParsers)
    using (StreamReader sr = File.OpenText(fileName))
    string line;
    while ((line = sr.ReadLine()) != null)
    foreach (ILineParser parser in lineParsers)
    object result = parser.ParseLine(line);
    if (result != null)
    yield return result;
    $parsers = @(
    New-Object IniSectionParser
    $results = [LogParser]::ParseFile("$pwd\test.txt", $parsers)
    $results
    Instead of defining separate classes for each type of line and output object, you could probably do something more generic with delegates (similar to how I used ScriptBlock.Invoke() in the PowerShell example), but it might sacrifice some speed to do so.

  • Get Total DB size , Total DB free space , Total Data & Log File Sizes and Total Data & Log File free Sizes from a list of server

    how to get SQL server Total DB size , Total DB free space , Total Data  & Log File Sizes and Total Data  & Log File free Sizes from a list of server 

    Hi Shivanq,
    To get a list of databases, their sizes and the space available in each on the local SQL instance.
    dir SQLSERVER:\SQL\localhost\default\databases | Select Name, Size, SpaceAvailable | ft -auto
    This article is also helpful for you to get DB and Log File size information:
    Checking Database Space With PowerShell
    I hope this helps.

  • How to tail log files from particular string

    Hello,
    We would like to tail several log files "live" in powershell for particular string. We have tried to use "get-content" command but without luck because everytime as a result we received only results from one file. I assume that it was
    caused by "-wait" parameter. If there is any other way to tail multiple files ?
    Our sample script below
    dir d:\test\*.txt -include *.txt | Get-Content -Wait | select-string "windows" |ForEach-Object {Write-EventLog -LogName Application -Source "Application error" -EntryType information -EventId 999 -Message $_}
    Any help will be appreciated.
    Mac

    Because we want to capture particular string from that files. Application writes some string time to time and when the string appears we want to catch it and send an eventy to application log, after it our Nagios system will raise alarm.
    Mac
    Alright, this is my answer, but I think you won't like it.
    Run this PowerShell code in PowerShell ISE:
    $file1='C:\Temp\TFile1.txt'
    '' > $file1
    $file2='C:\Temp\TFile2.txt'
    '' > $file2
    $special='windowswodniw'
    $exit='exit'
    $sb1={
    gc $using:file1 -Wait | %{
    if($_-eq$using:exit){
    exit
    }else{
    sls $using:special -InputObject $_ -SimpleMatch
    } | %{
    Write-Host '(1) found special string: ' $_
    $sb2={
    gc $using:file2 -Wait | %{
    if($_-eq$using:exit){
    exit
    }else{
    sls $using:special -InputObject $_ -SimpleMatch
    } | %{
    Write-Host '(2) found special string: ' $_
    sajb $sb1
    sajb $sb2
    In this code, $file1 and 2 are the files being waited for.
    As I understood you, you care only for the special string, which is in the variable $special.
    All other variables, will be discarded.
    Also, whenever a string equals to $exit is written to the file, the start job corresponding to that file will be terminated, automatically! (simple, right?)
    In the example above, I use only 2 files (being watched) but you can extend it, easily, to any number (as long as you understand the code).
    If you are following my instructions, at this point you have PowerShell ISE  running, with 2 background jobs,
    waiting for data being inputed to $file1 and 2.
    Now, it's time to send data to $file1 and 2.
    Start PowerShell Console to send data to those files.
    From its command line, execute these commands:
    $file1 = 'C:\Temp\TFile1.txt'
    $file2='C:\Temp\TFile2.txt'
    $exit='exit'
    Notice that $file1 and 2 are exactly the same as those defined in P
    OWERSHELL ISE, and that I've defined the string that will terminate the background jobs.
    Command these commands in PowerShell Console:
    'more' >> $file1
    'less' >> $file1
    'more' >> $file2
    'less' >> $file2
    These commands will provoke no consequences, because these strings will be discarded (they do not contain the special string).
    Now, command these commands in PowerShell Console:
    'windowswodniw' >> $file1
    '1 windowswodniw 2' >> $file1
    'more windowswodniw less' >> $file1
    'windowswodniw' >> $file2
    '1 windowswodniw 2' >> $file2
    'more windowswodniw less' >> $file2
    All these will be caugth by the (my) code, because they contain the special
    string.
    Now, let's finish the background jobs with these commands:
    $exit >> $file1
    $exit >> $file2
    The test I'm explaining, now is DONE, TERMINATED, FINISHED, COMPLETED, ...
    Time to get back to PowerShell ISE.
    You'll notice that it printed out this (right at the beginning):
    Id Name PSJobTypeName State HasMoreData Location Command
    1 Job1 BackgroundJob Running True localhost ...
    2 Job2 BackgroundJob Running True localhost ...
    At PowerShell ISE's console, type this:
              gjb
    And you'll see the ouput like:
    Id Name PSJobTypeName State HasMoreData Location Command
    1 Job1 BackgroundJob Completed True localhost ...
    2 Job2 BackgroundJob Completed True localhost ...
              (  They are completed!  )
    Which means the background jobs are completed.
    See the background jobs' outputs, commanding this:
              gjb | rcjb
    The output, will be something like this:
    (1) found special string: windowswodniw
    (1) found special string: 1 windowswodniw 2
    (1) found special string: more windowswodniw less
    (2) found special string: windowswodniw
    (2) found special string: 1 windowswodniw 2
    (2) found special string: more windowswodniw less
    I hope you are able to understand all this (the rubbishell coders, surely, are not).
    In my examples, the strings caught are written to host's console, but you can change it to do anything you want.
    P.S.: I'm using PowerShell, but I'm pretty sure you can use older PowerShell ( version 3 ). Anything less, is not PowerShell anymore. We can call it RubbiShell.

  • Log files and RSconfig file is not creatd after Reinstall the SSRS part?

    HI guyz,
    I have problem with my Subscription to send the emails using SMTP ,to resollving that i have uninstall  and install the SSRS part
    after install the SSRS part i have not found any RSConfig file and Logfiles,Here i have made one change that is after unisntall the SSRS i have changed the Report server  folder name to ReportServer_old ,After that i have I have installed the SSRS part 
    now i will not getting any Logfiels and RSconfig file also,
    And now also  i am not able to send the emails  using Subscription
    I have facing this issue still long time back,
    The error which am getting here is ,
    transport server Failed to send emails 
    I have done all the config settings properly ,There is nothing wrong in Config settgs.Guys pls help me out for this 
    Note; Uisng powershell script i have sending the mails using the SMTP server ,But in ssrs it is not working
    Can you pls any one update this 
    Thanks!

    Hi Yichinnari,
    I have checked that your issue can be cause by you haven't uninstall the SSRS correctly, you mentioned that you just rename the ReportServer folder, this may cause the issue. You can backup this folder to some other path and then remove all the folder related
    to the SSRS.
    Please find details information below about how to do a Completely uninstall of SSRS.Recommendations
    for Uninstalling & Installing Reporting Services
    How to uninstall Reporting Services on SQL 2008 R2?
    You mentioned that the error "Failure sending mail: The transport failed to connect to the server" when schedule the subscription still exists although you have done all the settings in the configuration file.
    Please first make sure you have successfully reinstall the SSRS and  the proper SMTP server is successfully configured and specified.
    Then do some configuration in the Reporting Service configuration manager like below:
    Finally, configure the rsreortserver.config file correctly.
    More details information about the configuration:
    How to: Configure a Report Server for E-mail Delivery (Reporting Services Configuration)
    If you still got the same error message, please try to provide more details error message in the log files which path is like :
    C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\LogFiles
    If you still have any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • An error occurred while applying SQL script for the feature BackendStore. For details, see the log file

    Hello
    i got this error in step2
    Error: An error occurred while applying SQL script for the feature BackendStore. For details, see the log file 'C:\Users\administrator.RCC\AppData\Local\Temp\2\Create-BackendStore-lync.rcc.local_rtc-[2013_09_23][09_05_16].log'
    here is full summary
    > Bootstrap-CsComputer
    Logging status to: C:\Users\administrator.RCC\AppData\Local\Temp\2\BootstrapFull-[2013_09_23][12_17_37].html
    Checking prerequisites for bootstrapper...
    Checking prerequisite WMIEnabled...prerequisite satisfied.
    Checking prerequisite NoBootstrapperOnBranchOfficeAppliance...prerequisite satisfied.
    Checking prerequisite SupportedOS...prerequisite satisfied.
    Checking prerequisite NoOtherVersionInstalled...prerequisite satisfied.
    Host name: lync.rcc.local
    Disabling unused roles...
    Executing PowerShell command: Disable-CSComputer -Confirm:$false -Verbose -Report "C:\Users\administrator.RCC\AppData\Local\Temp\2\Disable-CSComputer-[2013_09_23][12_17_46].html"
    Checking prerequisites for roles...
    Checking prerequisite SupportedOS...prerequisite satisfied.
    Checking prerequisite SupportedOSNoDC...prerequisite satisfied.
    Checking prerequisite SupportedSqlRtcLocal...prerequisite satisfied.
    Checking prerequisite WMIEnabled...prerequisite satisfied.
    Checking prerequisite NoOtherVersionInstalled...prerequisite satisfied.
    Checking prerequisite PowerShell...prerequisite satisfied.
    Checking prerequisite WindowsIdentityFoundation...prerequisite satisfied.
    Checking prerequisite SupportedServerOS...prerequisite satisfied.
    Checking prerequisite NoUnsupportedWinFab...prerequisite satisfied.
    Checking prerequisite SupportedSqlLyncLocal...prerequisite satisfied.
    Checking prerequisite SupportedSqlRtc...prerequisite satisfied.
    Checking prerequisite IIS...prerequisite satisfied.
    Checking prerequisite IIS7Features...prerequisite satisfied.
    Checking prerequisite ASPNet...prerequisite satisfied.
    Checking prerequisite KB2646886Installed...prerequisite satisfied.
    Checking prerequisite BranchCacheBlock...prerequisite satisfied.
    Checking prerequisite WCF...prerequisite satisfied.
    Checking prerequisite WindowsMediaFoundation...prerequisite satisfied.
    Checking prerequisite SqlInstanceRtcLocal...prerequisite satisfied.
    Checking prerequisite VCredist...prerequisite satisfied.
    Checking prerequisite SqlNativeClient...prerequisite satisfied.
    Checking prerequisite SqlClrTypes...prerequisite satisfied.
    Checking prerequisite SqlSharedManagementObjects...prerequisite satisfied.
    Checking prerequisite UcmaRedist...prerequisite satisfied.
    Checking prerequisite WinFab...prerequisite satisfied.
    Checking prerequisite MicrosoftIdentityExtensions...prerequisite satisfied.
    Checking prerequisite SqlInstanceLyncLocal...prerequisite satisfied.
    Checking prerequisite SqlInstanceRtc...prerequisite satisfied.
    Checking prerequisite RewriteModule...prerequisite satisfied.
    Checking prerequisite SpeechPlatformRuntime...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_ca-ES_Herena...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_da-DK_Helle...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_de-DE_Hedda...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_en-AU_Hayley...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_en-CA_Heather...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_en-GB_Hazel...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_en-IN_Heera...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_en-US_Helen...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_es-ES_Helena...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_es-MX_Hilda...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_fi-FI_Heidi...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_fr-CA_Harmonie...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_fr-FR_Hortense...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_it-IT_Lucia...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_ja-JP_Haruka...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_ko-KR_Heami...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_nb-NO_Hulda...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_nl-NL_Hanna...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_pl-PL_Paulina...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_pt-BR_Heloisa...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_pt-PT_Helia...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_ru-RU_Elena...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_sv-SE_Hedvig...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_zh-CN_HuiHui...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_zh-HK_HunYee...prerequisite satisfied.
    Checking prerequisite MSSpeech_TTS_zh-TW_HanHan...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_ca-ES_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_da-DK_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_de-DE_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_en-AU_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_en-CA_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_en-GB_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_en-IN_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_en-US_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_es-ES_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_es-MX_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_fi-FI_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_fr-CA_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_fr-FR_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_it-IT_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_ja-JP_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_ko-KR_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_nb-NO_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_nl-NL_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_pl-PL_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_pt-BR_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_pt-PT_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_ru-RU_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_sv-SE_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_zh-CN_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_zh-HK_TELE...prerequisite satisfied.
    Checking prerequisite MSSpeech_SR_zh-TW_TELE...prerequisite satisfied.
    Checking prerequisite UcmaWorkflowRuntime...prerequisite satisfied.
    Installing any collocated databases...
    Executing PowerShell command: Install-CSDatabase -Confirm:$false -Verbose -LocalDatabases -Report "C:\Users\administrator.RCC\AppData\Local\Temp\2\Install-CSDatabase-[2013_09_23][12_17_52].html"
    An error occurred while applying SQL script for the feature BackendStore. For details, see the log file 'C:\Users\administrator.RCC\AppData\Local\Temp\2\Create-BackendStore-lync.rcc.local_rtc-[2013_09_23][12_17_54].log'
    what should i do?
    Please help me

    Hi,
    The issue may be related to disk read and write cache. Here is a similar case for your reference:
    http://blog.kloud.com.au/2013/07/15/publish-lync-2013-with-2012-r2-preview-web-application-proxy/
    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make
    sure that you completely understand the risk before retrieving any suggestions from the above link.
    Kent Huang
    TechNet Community Support

  • Robocopy unicode output jibberish log file

    When I use the unicode option for a log file or even redirect unicode output from robocopy then try to open the resuting file in notepad.exe or whatever, it just looks like jibberish. How can I make this work or when will Microsoft fix it? Since Microsoft put that option in there, one supposes that it works with something. What is the expected usage for this option?
    Yes, I have file names with non-ASCII characters and I want to be able to view them correctly. Without unicode support robocopy just converts such characters into a '?'. It does, however, actually copy the file over correctly, thankfully. I have tried running robocopy from PowerShell and from cmd /u. Neither makes any difference. Also, one odd thing is that if I use the /unicode switch, the output to screen does properly show the non-ASCII characters, except that it doesn't show all of them, such as the oe ligature used in French 'œ'. That was just converted into an 'o' (not even an oe as is usually the case). Again, it does properly make a copy of the file. This just makes it not quite possible to search log results.
    Let's see if this post has those non-ASCII characters transmuted when this gets posted even though everything looks fine as I type it. âéèïöùœ☺♥♪

    When I use the unicode option for a log file or even redirect unicode output from robocopy then try to open the resuting file in notepad.exe or whatever, it just looks like jibberish. How can I make this work or when will Microsoft fix it? Since Microsoft put that option in there, one supposes that it works with something. What is the expected usage for this option?
    Yes, I have file names with non-ASCII characters and I want to be able to view them correctly. Without unicode support robocopy just converts such characters into a '?'. It does, however, actually copy the file over correctly, thankfully. I have tried running robocopy from PowerShell and from cmd /u. Neither makes any difference. Also, one odd thing is that if I use the /unicode switch, the output to screen does properly show the non-ASCII characters, except that it doesn't show all of them, such as the oe ligature used in French 'œ'. That was just converted into an 'o' (not even an oe as is usually the case). Again, it does properly make a copy of the file. This just makes it not quite possible to search log results.
    Let's see if this post has those non-ASCII characters transmuted when this gets posted even though everything looks fine as I type it. âéèïöùœ☺♥♪
    Uses /UNILOG:logfile   instead of /LOG:logfile

  • Listing log file in dd_mm_yy.txt format

    Hi everyone,
    I want to list log files whose names are changing daily in command line. Like that; 
    C:\log\dd_mm_yy.txt 
    "dd_mm_yy.txt" is changing daily. What kind of a definition I must use in Windows command prompt to list the log file ? Could you please help me about how can I solve that problem? 
    Best Regards 
    Murat 

    In linux command line similarly I can use below command, but in Windows I couldnt do
    ls -d /usr/local/logs/*error*.$(date +%Y-%m-%d) 
    set /?
    look at string manipulation
    also:
    echo %date%
    We will eventually break you Unix guys of your old bad habits.  In Windows we actually have all of those things.  In Unix you only have some of them.
    Don't feel bad.  PowerShell is almost ready to run on all versions of Linux.
    ¯\_(ツ)_/¯

Maybe you are looking for

  • How to call servlet in action of the Form in jsr 286 portlet

    HI, We are using Portlet producer application to create JSR 286 Portle. In the View.jsp of a portlet we need to call a servlet by mention it in the action of the form. WHen I run the only view.jsp page , on form submission the servlet gets called. Bu

  • ITouch Mail Question

    How do I create a folder on my iTouch while in email, so I can save the email to a different folder(s)? Or is this possible?

  • Connected ip's

    i want to ask,(sorry for bad english) are possible to see, what ip connecting for my skype accoun ? is realy important for me.

  • What J2EE engine for SAP NetWeaver 7.0 (2004s) Trial Version - Full Java Ed

    Hi experts, I am installing SAP NetWeaver 7.0 (2004s) Trial Version - Full Java Edition. For that 1.what J2EE engine sholud be installed? 2.where is it available? 3.give Installation procedure for this. They have given it as trial version will it exp

  • Path control regarding FTP-publishing

    Hi, I want to publish a website created with iWeb (version 3.0.4) and have some trouble eliminating the paths generated by naming the website in iWeb. Let's say my website is example.com and I have created 2 pages for this website called page1.html a