Windows 10: Can some one help with this Wierd PowerShell event log entry, Please

Discus and support Can some one help with this Wierd PowerShell event log entry, Please in Windows 10 Installation and Upgrade to solve the problem; Looking through my power shell log i noticed a new entry: HostApplication=powershell.exe -ExecutionPolicy Restricted -Command $Res = 0;... Discussion in 'Windows 10 Installation and Upgrade' started by SMK_SEC, Feb 26, 2021.

  1. SMK_SEC Win User

    Can some one help with this Wierd PowerShell event log entry, Please


    Looking through my power shell log i noticed a new entry:


    HostApplication=powershell.exe -ExecutionPolicy Restricted -Command $Res = 0; ifGet-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole.State -eq 'Enabled' { $Path = $env:windir + '\system32\inetsrv\config\applicationHost.Config'; if Test-Path -Path $Path { try { [XML]$Xml = Get-Content $Path } catch { $Res = 1 } }; } Write-Host 'Final result:',$Res



    Without user intervention we are observing the above activity in daily basis, kindly some one help me please, why it is happening daily.



    Best Regards,

    Kumar

    :)
     
    SMK_SEC, Feb 26, 2021
    #1
  2. rsalfonso Win User

    Moving an event log source is not having an effect

    I'm having an issue that to be clear I'll describe in steps:

    1. I created an event source called Foo in the event log called Application using the following powershell command:
      New-EventLog -source Foo -LogName "Application"
    2. I could successfully log to the event log using that source.
    3. Afterwards, I decided to remove the source and re-create it in a different event log:

    The problem I'm having is that then when I run Write-EventLog -LogName "My App Log" -Source "Foo" -EventID 0 -EntryType Information -Message "Some message." the entry is logged to Application instead of to My App Log

    Has anyone else experienced this behaviour? Am I missing anything?
     
    rsalfonso, Feb 26, 2021
    #2
  3. lvgandhi Win User
    powershell help does not seem to work

    Thanks for response.
    I have done chkdsk C: /f also.
    still not working. I tried your suggestion also. That also does not work.
    But as I said get-help dir works. Please see below

    Can some one help with this Wierd PowerShell event log entry, Please [​IMG]
     
    lvgandhi, Feb 26, 2021
    #3
  4. ddelo Win User

    Can some one help with this Wierd PowerShell event log entry, Please

    Export All Administrative Events to Excel

    To analyze events, from the Windows Event Viewer, there is a simple way to export all Administrative Events to Excel, with PowerShell.

    Exporting all Administrative Events to Excel is a simple two Step process, as described here:

    Step 1 - Create the Administrative Events View .xml file
    1. Open Eventviewer (%windir%\system32\eventvwr.msc)
    2. Navigate to: Event Viewer (Local) > Custom Views > Administrative Events
    3. In the “Actions” pane select “Filter Current Custom View”.
    4. Select the the XML tab.
    5. Press Ctrl+A to select all the XML code of the Custom View.
    6. Open a notepad, paste the selected code and save the file to your Desktop as AdmEvtView.xml


    Step 2 - Create the csv file with the events
    1. Download the ExportEvtCSV.zip file, which contains the script ExportEvtCSV.ps1 and unzip it, on your Desktop.
      It's not a fancy script, just basic PowerShell commands to create a csv file on the Desktop.
    2. In Windows Search, type “ISE” (without the quotes) to open “Windows PowerShell ISE” and Run as administrator
    3. To allow running the script, change the ExecutionPolicy, for this session. To do that, in the Console pane type:
      Code:
    4. In the Windows PowerShell ISE, open and run the script: ExportEvtCSV.ps1
      The script will create a csv file with a name YYYYMMDD.HHMM.csv on the Desktop
    5. When done, open the newly created .csv file, format the columns as needed and optionally save it as .xlsx, if you wish.
    That’s it! You now have all the Administrative Events in Excel for filtering and further analysis. Can some one help with this Wierd PowerShell event log entry, Please :)

    Now to the more technical hard stuff... *Confused

    There is a reason for running the script from within PowerShell ISE!

    It would be great if everything was also working perfectly, when running the script from an elevated PowerShell too.

    We can run it from an elevated PowerShell, which means that you just follow the Step 1, as above but for the Step 2 instead of the ISE you run the script from an elevated PowerShell.

    The problem is that it will work only for anybody who has en-US format for the dates. Everyone else, who has another format (i.e. en-GB, fr-FR, el-GR etc.), the dates are not translated properly by Excel (although the script uses the –UseCulture switch) and remain as text in the en-US format.

    I'm not sure if this a bug of the "export-csv" cmdlet, but although it runs the way it supposed to from within the ISE, from PowerShell there is a problem with the dates format.
    As I haven’t found a way to overcome this obstacle, any suggestion from the PowerShell gurus of the forum (like my good friend Shawn @Brink, for instance), is welcome.
     
    ddelo, Feb 26, 2021
    #4
Thema:

Can some one help with this Wierd PowerShell event log entry, Please

Loading...
  1. Can some one help with this Wierd PowerShell event log entry, Please - Similar Threads - help Wierd PowerShell

  2. Event log error please help

    in Windows 10 Gaming
    Event log error please help: Please any advice would be helpful believe a may have faulty mobo as having problems when dim1 is occupied https://answers.microsoft.com/en-us/windows/forum/all/event-log-error-please-help/3e287cdf-56b5-4693-8919-dd8799815045
  3. Event log error please help

    in Windows 10 Software and Apps
    Event log error please help: Please any advice would be helpful believe a may have faulty mobo as having problems when dim1 is occupied https://answers.microsoft.com/en-us/windows/forum/all/event-log-error-please-help/3e287cdf-56b5-4693-8919-dd8799815045
  4. Powershell event log

    in AntiVirus, Firewalls and System Security
    Powershell event log: I have many of these in my event logs : POWERSHELL...task category execute a remote command :Creating Scriptblock text 1 of 1:# Copyright © 2008, Microsoft Corporation. All rights reserved.#Common utility functionsImport-LocalizedData -BindingVariable localizationString...
  5. Can some one help ?

    in Windows 10 Ask Insider
    Can some one help ?: [ATTACH] submitted by /u/epaulin59 [link] [comments] https://www.reddit.com/r/Windows10/comments/hq9l1w/can_some_one_help/
  6. can some one help me please

    in AntiVirus, Firewalls and System Security
    can some one help me please: still unable to reply to emails can some one help me please https://answers.microsoft.com/en-us/windows/forum/all/can-some-one-help-me-please/f60bdbd9-28c1-419b-b40f-ad5a402a1656
  7. can you help with this event log?

    in Windows 10 BSOD Crashes and Debugging
    can you help with this event log?: Hello All, My Pc some time bluescreen and then reboot. I can not get the reason. i reinstall OS many times, it annoys me a lot. any idea is appreaciated! below is the event log : https://1drv.ms/u/s!Ahxl0DeDKyChiJA8M4PBGmf_INqPXQ?e=ebYyPi Thanks a lot...
  8. strange entry in Aministrative Events log

    in AntiVirus, Firewalls and System Security
    strange entry in Aministrative Events log: Was having trouble with W10 switching between desktop and tablet mode. Was so bad for a few days I could hardly use my computer. I looked through the windows logs to see if there were any unusual events. Found an item with a very unusual font that is difficult to read. I...
  9. some one can help with powershell ? I am new in that

    in Windows 10 Support
    some one can help with powershell ? I am new in that: i will post the part of the script have probleme with 132964
  10. Wierd Problem- please help!

    in Windows 10 Installation and Upgrade
    Wierd Problem- please help!: I put windows 10 on my test machine that was running 8.1 pro everything went smoothly I have not had a real time last night to play around with it so i shut the pc down When turning it on this morning I got the Windows Screen and now everything is black. I have a mouse...

Users found this page by searching for:

  1. powershell write-host final result 1