IT-Wissen/win-sysadmin/README.md
Roger Rutishauser 5e148a5b4c rsat
2024-11-27 18:02:01 +01:00

4.5 KiB
Raw Blame History

Table of Contents

Windows Sysadmin

Autostart

Windows-R Tastenkombination, anschliessend shell:startup

RSAT Remote Server Administration Tools

Installation: Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability -Online (Als Admin)

Status Check: Get-WindowsCapability -Name RSAT* -Online | Select-Object -Property DisplayName, State

TLS Version aktiv/inaktiv?

# Function to check TLS version
function Test-TlsVersion {
    param (
        [string]$ComputerName = "localhost"
    )

    try {
        # Test TLS 1.0
        $tls10 = [System.Net.ServicePointManager]::SecurityProtocol -band [System.Net.SecurityProtocolType]::Tls10

        # Test TLS 1.1
        $tls11 = [System.Net.ServicePointManager]::SecurityProtocol -band [System.Net.SecurityProtocolType]::Tls11

        # Test TLS 1.2
        $tls12 = [System.Net.ServicePointManager]::SecurityProtocol -band [System.Net.SecurityProtocolType]::Tls12

        Write-Host "TLS 1.0 Enabled: $($tls10 -ne 0)" -ForegroundColor Green
        Write-Host "TLS 1.1 Enabled: $($tls11 -ne 0)" -ForegroundColor Green
        Write-Host "TLS 1.2 Enabled: $($tls12 -ne 0)" -ForegroundColor Green
    }
    catch {
        Write-Host "Error: $_" -ForegroundColor Red
    }
}

# Check TLS versions on the local machine
Test-TlsVersion

.NET

.NET Version herausfinden

Variante 1

Variante 2

Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -Recurse | Get-ItemProperty -Name Version,Release -ErrorAction SilentlyContinue | Where-Object { $_.PSChildName -match '^(?!S)\p{L}'} | Select-Object PSChildName, Version, Release

Windows Services/Dienste

cdpusersvc deaktivieren

  • In Registry nach key cdpusersvc suchen. Überall bei "start" auf 4 setzen.
  • admin-cmd öffnen, dann pwsh.
  • sc config cdpusersvc type=own
  • nssm remove cdpusersvc

Shell Extensions

Tool: ShellExView

The ShellExView utility displays the details of shell extensions installed on your computer, and allows you to easily disable and enable each shell extension.

ShellExView can be used for solving context-menu problems in Explorer environment.

http://www.nirsoft.net

Files

Find encrypted Files

cmd> cipher /s:D:\beispiel\pfad

CMD

run CMD as different user

runas /user:"infra.vs.ch\fedcom" cmd

if you want to use system user:

Access fileshare in CMD

If youve ever tried to access a network file share in a command prompt by simply using the cd command, youll know that it just complains that “CMD does not support UNC paths as current directories”. Well, there is a way to do it (two in fact):

net use

net use z: \\machine\share

It can be combined with the /user switch to provide additional user details:

net use z: \\machine\share /user:domain\username

delete:

net use p: /delete

pushd

pushd \\machine\share

The bonus of using the pushd command over the net use command is that it will automatically change the current directory to the mapped drive (which will be the first unused drive letter available in reverse alphabetical order). Also, when finished with the network share, you can use the popd command to remove the mapped drive.

run multiple batch files in one file

cmd.exe /C, danach die bat-Datei in Anführungszeichen, und Parameter je nachdem ob sie gebraucht werden. Weil ein Misch ist, ein @ davor setzen.

Bsp. Inhalt einer Master-.bat Datei, mit mehreren bat Aufrufen (und einer env-variable)

cmd.exe /C @"fedora-purge.bat" abc.def.ch:8443 fedoraAdmin %FEDORAPW% CH-000999-4:328110 https "delete because more recent version CH-000917-4:331101"
cmd.exe /C @"fedora-purge.bat" abc.def.ch:8443 fedoraAdmin %FEDORAPW% CH-000999-4:328111 https "delete because more recent version CH-000917-4:331101"