Windows Notes

1. Windows Command-Line Reference

1.1. Search for Text in a File Directory

  • Official Microsoft doc.

  • To search for a specific string within files in a directory:

    1. launch a CMD prompt window

    2. Run the following

      findstr /R /S "search string" "c:\temp\*"

2. Configure Firewall

  1. Full document here

  2. Launch an elevated CMD prompt window.

  3. Run the netsh command.

  4. In this example we are configuring a new rule named MSSQL for port 1285.

    netsh advfirewall firewall add rule name = MSSQL dir = in protocol = tcp action = allow localport = 1285 remoteip = localsubnet profile = DOMAIN

3. Changing Path for Service

The following is the command to change the path:

sc config {service name} binPath= {binary path}

As an example, suppose we wanted to change the SQL Server path which is currently at MSSQL13 to MSSQL15.

MSSQL-13

We would execute the following with the updated path:

sc config MSSQL$SQLEXPRESS binPath="R:\Program Files\Microsoft SQL Server\MSSQL15.SQLEXPRESS\MSSQL\Binn\sqlservr.exe" (1)

[SC] ChangeServiceConfig SUCCESS (2)
1 Excute this command.
2 Command result.

Now we see that the service has been updated:

MSSQL-15

4. Domain Join

4.1. To OpenLDAP

  1. Open a PS session

  2. Execute:

    Add-Computer -DomainName "xackleystudio.local" -Credential "xackleystudio.local\admin"
    Never got this to actually work