Connect to Exchange Online with Powershell

This can be done in 3 easy steps (taken from the article at https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?view=exchange-ps)

$UserCredential = Get-Credential

When prompted, enter your tenant logon (username@<tenant>.onmicrosoft.com) information including password

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

This creates a session object holding the connection to Exchange Online.

Import-PSSession $Session -DisableNameChecking

This imports the session (places it live) inside your current Powershell session. You could, of course, also do a

Enter-PSSession $Session

if you want to connect and run the commands remotely / directly on Exchange Online but then you lose all sorts of things like auto-complete.

 

 

 

 

Configure Windows Defender Antivirus exclusions on Windows Server 2016 | Microsoft Docs

Great article on Windows Server 2016 includes automatic exclusions, based on server role. You can also add custom exclusions but be aware there are some caveats such as folder exclusions are recursive whether you like it or not. Also, these exclusions are there by default (you can disable them with PowerShell) but they AREN’T exposed in the GUI…. so you wouldnt know that hey are there !

While I have links on my links page to the exclusions, this is a nice article as it shows you what Microsoft now apply by default ni case you want the same exclusions for your vendor of choice.

Configure Windows Defender Antivirus exclusions on Windows Server 2016 | Microsoft Docs

Default NetScaler changes

When deploying a NetScaler, Citrix recommend that you make these changes by default (https://support.citrix.com/article/CTX121149 ).

The Windows Scaling one was particularly useful on a customer site recently where connections over CAG would drop due to window size on the TCP stream not being negotiated with the ASA filrewall correctly. Enable windows scaling and the issue went right away.

Creating remote powershell session

Simply enter the command

Enter-PSSession –ComputerName <computer name>

This will let you control a single computer remotely, if you want to control more than one computer simultaneously then enter a command similar to the below

Invoke-Command -ScriptBlock { Get-EventLog System -Newest 5 } -Computername compname1,compname2,compname3

Where the command between the braces is the command you would like to run against the remote servers

Don’t forget, you can still enter commands against a remote computer with WinRM enabled (it’s enabled by default in Windows 2012) by entering the command:

winrs -r:<servername> <command to run>

<command to run> could even be powershell.exe to create a remote powershell session !