Skip to main content

Posts

Showing posts from July, 2020

Use Windows Event Log to log events from PowerShell

Windows Event Log is a convenient event store to log information. Once data is in Windows Event log it can be correlated with other information on the system.  There two basic steps to do this: Create log location and source Write log information into that location and source To create log location and source, do: PS C:\> New-EventLog -LogName 8thstring -Source 8thSource Where: 8thstring is the log location 8thSource is the source You have to run this on an elevated PowerShell session. And if you have Windows Event Viewer open, you have to close it and re-open to see the new log. This should show up under Applications and Service Logs .  To write to that log location and source, do: PS C:\> Write-EventLog -LogName 8thstring -Source 8thSource -Message "Hello world" -EventId 0 -EntryType information Where: -LogName 8thstring //8thstring was created using New-EventLog above -Source 8thsource //8thSource was also created as part of New-EventLog call above - Mess...

How to install USB/IP for Windows on Server 2008 R2

USB/IP Project aims to develop a general USB device sharing system over IP network. To share USB devices between computers with their full functionality, USB/IP encapsulates "USB I/O messages" into TCP/IP payloads and transmits them between computers. A fork of USB/IP client on Windows is located here . Getting this forked version to work with Windows Sever 2008 R2 is not straightforward. I have documented below how I was able to get it to work 2008 R2. Download 0.1.0 (https://github.com/cezanne/usbip-win/releases/tag/v0.1.0), download all into a directory excluding source* Remember to unblock the files Save to c:\usbip Download x64 build for Win7 (https://github.com/cezanne/usbip-win/files/4743857/usbip_vhci_v0.1.0_win7_x64.zip) Unblock the zip file Extract Copy the files and overwrite files in c:\usbip Allow running non-validated driver bcdedit.exe /set TESTSIGNING ON Restart computer Import certificates manually Run mmc.exe File | Add/Remove Snap-in… In Available snap-ins...