Archive

Archive for May, 2019

[O365][PS] Exchange Online Powershell Module and connecting to Exchange Online

May 16, 2019 No comments

Example 1:

Example 2:

 Troubleshooting Errors:

  1. New-ExoPSSession : user_realm_discovery_failed: User realm discovery failed

    • Check proxy settings in IE
  1. New-ExoPSSession: The SSL certificate could not be checked for revocation.

    • Set winhttpbyusingsetproxycommand:
      • Show: netsh winhttp show proxy
      • Set Proxy: netsh winhttp set proxy <proxy url or ip>:<port>
      • Reset Proxy: netsh winhttp reset proxy

 

Categories: Exchange, Office365, Powershell Tags:

[PS] Creating a Key File and Password File

Creating a Key File and Password File

With PowerShell, we can generate a 256-bit AES encryption key:

Creating the AES.key

Creating the password file

Using the key and password file

 

 

 

 

Categories: Powershell Tags:

[PS] Write-host and tips

May 10, 2019 No comments

Write-host  (Alias: write)

Example for foreground color and background color:

Write-host “text” -ForegroundColor red -Background Color white

 

  • Using foreground and background will break a variable writing stored

Powershell has a built in color scheme

 

Write-warning (yellow on black)
Write-error (red on black)

 

 

Categories: Uncategorized Tags:

[PS] Working with Variables

Variables uses the $ (Dollar Sign). Takes text, integers, and store output from cmdlets.

Examples:

Storing strings
$Var=”Hello”

Storing integars
$Var=”5″
$Var=”1.0″

Storing output from cmdlets
$Var=Get-Services bits (Grabs a Service Controller Object)
– $Var.status would output status
– $Var.stop() would stop bits services
– $Var.refresh() refreshes the storage

Storing using user input

$Var=Read-host “Enter string to be stored”

Categories: Powershell Tags:

[PS] List of Aliases Used in PowerShell

May 9, 2019 No comments



HTML TABLE

Read more…

HelpUri ResolvedCommandName DisplayName ReferencedCommand ResolvedCommand Definition Options Description OutputType Name CommandType Visibility ModuleName Module RemotingCapability Parameters ParameterSets
http://go.microsoft.com/fwlink/?LinkID=113300 ForEach-Object % -> ForEach-Object ForEach-Object ForEach-Object ForEach-Object ReadOnly, AllScope System.Collections.ObjectModel.ReadOnlyCollection1[System.Management.Automation.PSTypeName] % Alias Public None System.Collections.Generic.Dictionary2[System.String,System.Management.Automation.ParameterMetadata]
http://go.microsoft.com/fwlink/?LinkID=113423 Where-Object ? -> Where-Object Where-Object Where-Object Where-Object ReadOnly, AllScope System.Collections.ObjectModel.ReadOnlyCollection1[System.Management.Automation.PSTypeName] ? Alias Public None System.Collections.Generic.Dictionary2[System.String,System.Management.Automation.ParameterMetadata]

Categories: Powershell Tags:

[EXO] Manage mailbox auditing

May 2, 2019 No comments

Display the list of mailbox actions that are currently being for a mailbox for each logon type:

Enable rest of the auditing actions

Full list:

Restoring to default:

 

Categories: Exchange Tags: