Backtrack:  
 
showing posts of March 2018
 
by lunarg on March 22nd 2018, at 16:34
On a fresh install of Windows Server 2012R2, not joined to a domain, the first network connection (obtained through DHCP) is always treated as a Public network. Normally, when joining a domain, the network connection then becomes a Domain network, but if the server will not be joined to a domain, you probably will want to set it to Private. Unfortunately, the Public Network link in Network Center is not clickable, and thus, cannot be changed. But you can make the change anyway through the Local Security Policy.

Through Powershell (preferred method):

Look up the name of the network interface (e.g. "Local Area Connection") in the network adapters list.

Open an elevated Powershell   ...
by lunarg on March 12th 2018, at 12:01

A very useful blog article about killing active sessions to a compromised Office 365 account:

https://blogs.technet.microsoft.com/cloudyhappypeople/2017/10/05/killing-sessions-to-a-compromised-office-365-account/

by lunarg on March 12th 2018, at 08:27

Starting from Windows 10 Creators Fall Update, you can use VT escape sequences to colorize the output to console. You can use this to colorize columns in Format-Table, too.

A sample snippet, colorizing the output based on the contents of the "Status" field:

$somelist | FT FirstName,LastName,@{l="Status";e={
    switch ($_.Status) {
        "OK" {$color = 92; break}
        "NOT OK" {$color = 91; break}
        default {$color = 93}
    }
    "$e[${color}m$($_.Status)${e}[0m"
}}

A complete list of color codes can be found here: https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

 
showing posts of March 2018
 
 
« September 2018»
SunMonTueWedThuFriSat
      1
2345678
9101112131415
16171819202122
23242526272829
30      
 
Links
 
Quote
« Have you tried turning it off and on again? »
The IT Crowd