Avatar

Links

michael-sabrnak-swi (corporate)
MyKEms (personal)
@rss
  • Simple way how to count checksum of any file with PowerShell.

    CertUtil -hashfile C:\MyFile.iso MD5
    

    Available Hash algorithms: MD2 MD4 MD5 SHA1 SHA256 SHA384 SHA512

    Created Tue, 23 Aug 2016 06:42:07 +0000
  • Short article how to determine SID of known AD User and vice versa.

    Determine SID of known AD User:

    $objUser = New-Object System.Security.Principal.NTAccount("MyDomain", "MyADUser")
    $strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier])
    $strSID.Value
    

    Determine which SID belongs to:

    Created Mon, 15 Aug 2016 08:44:53 +0000
  • How to enable PSRemoting and control remote computer.

    Enable-PSRemoting -Force # Enable WinRM service, adds exception to firewall
    Set-Item wsman:localhostclienttrustedhosts * # IP address, hostname, subnet, * all computers - needs to be trusted on both sides if you don't use domain Auth
    Restart-Service WinRM
    Test-WsMan REMOTECOMPUTER
    Invoke-Command -ComputerName REMOTECOMPUTER -ScriptBlock { hostname } -credential REMOTEUSER
    Enter-PSSession -ComputerName REMOTECOMPUTER -Credential REMOTEUSER
    Clear-Item WSMan:localhostClientTrustedHosts # Clear all trusted Hosts
    
    Created Mon, 23 Nov 2015 14:16:38 +0000