Tuesday 14 February 2017

Powershell endpoints

For old school .svc and .asmx

foreach($dir in ("dir1",”dir2”)) {
    $files = Get-ChildItem -Path  D:\AppWebSites\$dir -Recurse -Include ('*.asmx','*.svc')
    $files
}

Friday 3 February 2017

Quick event logging guide with MS EL–really for me

CONCEPTS

· Source = Only used by the Machine Event Viewer

· EventId  number that goes in the EventId column of database Log

· TraceEventType (System.Diagnostics.TraceEventType) = a system enum for the log level (info, verbose, error, critical)

PROJECT

We need to add a reference to these:

clip_image002

Config

This page explains it - https://msdn.microsoft.com/en-us/library/ff664760(v=pandp.50).aspx

Where is the tool?

The tool is in tfs - /EnterpriseLibrary5/Bin/EntLibConfig.exe

 

REGISTERING SOURCES FOR EVENTS LOG

If you ever need to register a source (for the Event Log), you run this from PowerShell

New-EventLog -LogName Application -SRC MyNewSource –computername <server>,<other>,<servers,go,here>

Is my source registered?

There’s a way to know what sources has been registered in a machine (see attached).

But it is easier to simply run the previous command to make sure