Search This Blog

Wednesday, September 29, 2021

Windows Terminal - Add to context menu.

Windows Terminal is a windows APP so is a little different than normal programs. I am not an expect but just include this info for some background.

Windows terminal runs a wt.exe

it can be found here..

%LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe


So to do what we want we have to override some settings in the config of the wt.exe. These can be found here.. This may change depending on what version of the windows terminal you  have installed.. I have the preview...

%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\LocalState

but could be 

%LOCALAPPDATA%\Packages\Microsoft. WindowsTerminal_8wekyb3d8bbwe\LocalState\

So we need to add this line 

"startingDirectory"null

to the settings.json file...

"profiles":
    {
        "defaults":
        {
            // Put settings here that you want to apply to all profiles.
            "startingDirectory"null
        },


Then we can update the registry to add an entry to the right click context menu.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\wt]
@="Open Windows Terminal here"
"ShowBasedOnVelocityId"=dword:00639bc8
"Extended"=""

[HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command]
@="%LOCALAPPDATA%\\Microsoft\\WindowsApps\\wt.exe"

And now we should be good.. Right click on a folder and there should be an option







Share/Bookmark

Saturday, March 27, 2021

MX Linux - Netgear A6210 driver install.

Putting this here so I don't have to go searching again....
 

Tried to get a couple of usb adapters installed on MX linux (buster).

Initially i started with older TP-link USB adapaters 

TL-WN821N and TL-WN822N

However whilst the driver would install and the device was listed in lsusb output, I could never get it working...


In the end I swapped to a netgear adapter A6210.

Using the following articles as reference I was able to get this working.

https://community.netgear.com/t5/WiFi-Adapters/Netgear-A6210-compiling-Linux-driver/td-p/1711232

https://community.netgear.com/t5/WiFi-Adapters/A6210-ADAPTER-ON-LINUX-UBUNTU/td-p/1062677


But these are the commands I used to install this.

git clone -b port-to-4.15 https://github.com/kaduke/Netgear-A6210.git

cd Netgear-A6210

make

sudo make install

 

I got some warnings during the compile, but everything worked when I plugged the usb adapter in.



Share/Bookmark

Monday, February 22, 2021

Setup email alias for user to send from (Exchange\Excahnge Online - Hybrid)

 Had a request to setup a new domain for some new users. The intention was to allow these users to send from this domain to external users.

We operated a hybrid setup with Office365, and adding additional domains to this setup is pretty straight forward and there are tutorials on how to do this.. Pretty much add the domains to both side (exchange on premise, Exchange online and then run the Hybrid Config Wizard (HCW)).

An issue arises though when a user tries to send from the new domain email address. Whilst it will let them send it, when the email routes through exchange it will pick up the primary email address.. I thought I could force the reply to address to be the new email, but that didnot work, and the email arrives at the recipient and lists the primary email address..

So how to get round this...

It appears the only way around this is to setup the account to allow it to "send as" another email.. So there are two options shared mailbox, delegation group.

I chose the delegation group as I didn't want to create another mailbox. So I removed the alias from the user. Setup a delegation group and assigned the new email to that delegation group. Then gave "send as" permissions to the existing user to the new delegation group.

These permissions need to be setup both sides..

New-DistributionGroup -Name "(Display name for DG will appear in outlook)" -type Distribution -Members "(existing AD user)" -managedby "(existing AD user)" -PrimarySmtpAddress "user@new.domain" -OrganizationalUnit "domain/ou1/ou2/ou...."

Exchange (on-premise)

Add-ADPermission -Identity "(Display name for DG will appear in outlook)" -User "(existing AD user)" -AccessRights ExtendedRight -ExtendedRights "Send As"

Run AAD Connect (DirSync)

Exchange Online

connect-exchangeonline

Add-RecipientPermission -Identity "(Display name for DG will appear in outlook)" -Trustee "(existing AD user)" -AccessRights SendAs




Share/Bookmark

Monday, January 11, 2021

Event Triggered Scheduled Task - On Process Start

I wanted to run a powershell script when a specific process started.

I knew you could create event triggered scheduled tasks, and have used this before based on a specific event id.. However this time the eventid is going to be the same for a lot of different process start events so needed to find a way to filter this. Turns out you can edit the filter manually in Task Scheduler and this allows you to fully edit the XPath queries of the event XML.

To enable this, you must first turn on Audit Process Tracking for Success, in Local Security Policy


Now in the scheduled tasks

Edit the event filter, the query is below. You can get the field and values from looking at the XML in the event viewer under eventdata
this is the line in the query below that will need to be updated for the specific process.

<QueryList>
  <Query Id="0" Path="System">
    <Select Path="Security">
        *[System[Provider[@Name='Microsoft-Windows-Security-Auditing'] and Task = 13312 and (band(Keywords,9007199254740992)) and (EventID=4688)]]
        and
        *[EventData[Data[@Name='NewProcessName'] and (Data='C:\temp\process.exe')]]
    </Select>
  </Query>
</QueryList>



Share/Bookmark