Skip to content

Commit

Permalink
Consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
directorcia committed Dec 27, 2018
1 parent 1360b88 commit c736413
Show file tree
Hide file tree
Showing 33 changed files with 140 additions and 99 deletions.
8 changes: 5 additions & 3 deletions O365-connect-aad.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

## Variables
$systemmessagecolor = "cyan"
$processmessagecolor = "green"
$savedcreds=$false ## false = manually enter creds, True = from file
$credpath = "c:\downloads\tenant.xml" ## local file with credentials if required

Expand All @@ -19,14 +20,14 @@ $credpath = "c:\downloads\tenant.xml" ## local file with credentials if requir

Clear-Host

write-host -foregroundcolor green "Script started"
write-host -foregroundcolor $systemmessagecolor "Script started"

## ensure that install-module azuread has been run
## ensure that update-module azuread has been run to get latest module
## https://www.powershellgallery.com/packages/AzureAD/
## Current version = 2.0.1.16, 21 June 2018
import-module azuread
write-host -foregroundcolor green "AzureAD module loaded"
write-host -foregroundcolor $processmessagecolor "AzureAD module loaded"

## Get tenant login credentials
if ($savedcreds) {
Expand All @@ -40,4 +41,5 @@ else {

## Connect to AzuerAD service
Connect-azuread -credential $cred
write-host -foregroundcolor green "Now connected to Azure AD Service"
write-host -foregroundcolor $processmessagecolor "Now connected to Azure AD Service`n"
write-host -foregroundcolor $systemmessagecolor "Script Completed`n"
2 changes: 1 addition & 1 deletion o365-addin-deploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ Set-OrganizationAddInAssignments -ProductId 6046742c-3aee-485e-a4ac-92ab7199db2e
Set-OrganizationAddInAssignments -ProductId 62916641-fc48-44ae-a2a3-163811f1c945 -AssignToEveryone $true ## Message Header Analyzer
Set-OrganizationAddInAssignments -ProductId 9758a0e2-7861-440f-b467-1823144e5b65 -AssignToEveryone $true ## FindTime

write-host -foregroundcolor $systemmessagecolor "Script Completed"
write-host -foregroundcolor $systemmessagecolor "Script Completed`n"
2 changes: 1 addition & 1 deletion o365-atp-timer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ foreach($MessageTrace in $Custom_Object)
Write-host
Write-host "Total additional time for ATP scanning =",$final_data.totalseconds,"seconds"
Write-host
write-host -foregroundcolor $systemmessagecolor "Script ended"
write-host -foregroundcolor $systemmessagecolor "Script Completed`n"
2 changes: 1 addition & 1 deletion o365-connect-bulk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ else {
write-host -foregroundcolor $processmessagecolor "Finish - MFA login`n"
}
get-module | Select-Object version,Name
write-host -foregroundcolor $systemmessagecolor "Finish Script`n"
write-host -foregroundcolor $systemmessagecolor "Script Completed`n"
4 changes: 3 additions & 1 deletion o365-connect-ctrldply.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

## Variables
$systemmessagecolor = "cyan"
$processmessagecolor = "green"
$savedcreds=$false ## false = manually enter creds, True = from file
$credpath = "c:\downloads\tenant.xml" ## local file with credentials if required

Expand All @@ -36,4 +37,5 @@ else {

## Connect to Office 365 admin service
Connect-OrganizationAddInService -credential $cred
write-host -foregroundcolor $systemmessagecolor "Now connected to Office 365 Centralized Deployment"
write-host -foregroundcolor $processmessagecolor "Now connected to Office 365 Centralized Deployment`n"
write-host -foregroundcolor $systemmessagecolor "Script Completed`n"
4 changes: 3 additions & 1 deletion o365-connect-exo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

## Variables
$systemmessagecolor = "cyan"
$processmessagecolor = "green"
$savedcreds=$false ## false = manually enter creds, True = from file
$credpath = "c:\downloads\tenant.xml" ## local file with credentials if required

Expand Down Expand Up @@ -47,4 +48,5 @@ write-host -foregroundcolor $systemmessagecolor "Now connected to Office 365 Adm
## Start Exchange Online session
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/?proxyMethod=RPS -Credential $Cred -Authentication Basic -AllowRedirection
import-PSSession $Session
write-host -foregroundcolor $systemmessagecolor "Now connected to Exchange Online services"
write-host -foregroundcolor $processmessagecolor "Now connected to Exchange Online services`n"
write-host -foregroundcolor $systemmessagecolor "Script Completed`n"
6 changes: 4 additions & 2 deletions o365-connect-mfa-aad.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

## Variables
$systemmessagecolor = "cyan"
$processmessagecolor = "green"

## If you have running scripts that don't have a certificate, run this command once to disable that level of security
## set-executionpolicy -executionpolicy bypass -scope currentuser -force
Expand All @@ -26,12 +27,13 @@ write-host -foregroundcolor $systemmessagecolor "Script started"
## https://www.powershellgallery.com/packages/AzureAD/
## Current version = 2.0.1.16, 21 June 2018
import-module azuread
write-host -foregroundcolor $systemmessagecolor "AzureAD module loaded"
write-host -foregroundcolor $processmessagecolor "AzureAD module loaded"

## ensure that Exchange Online MFA modules has been run
## Download and install MFA cmdlets from - https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/mfa-connect-to-exchange-online-powershell?view=exchange-ps

## Connect to Azure AD service
## You will be manually prompted to enter credentials and MFA
Connect-AzureAD
write-host -foregroundcolor $systemmessagecolor "Now connected to Azure AD Service with MFA"
write-host -foregroundcolor $processmessagecolor "Now connected to Azure AD Service with MFA`n"
write-host -foregroundcolor $systemmessagecolor "Script Completed`n"
4 changes: 3 additions & 1 deletion o365-connect-mfa-aadrm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

## Variables
$systemmessagecolor = "cyan"
$processmessagecolor = "green"
## If you have running scripts that don't have a certificate, run this command once to disable that level of security
## set-executionpolicy -executionpolicy bypass -scope currentuser -force

Expand All @@ -24,4 +25,5 @@ write-host -foregroundcolor $systemmessagecolor "Script started"

## Connect to Azure AD Rights Management Service
connect-aadrmservice
write-host -foregroundcolor $systemmessagecolor "Now connected to the Azure AD Rights Management Service"
write-host -foregroundcolor $processmessagecolor "Now connected to the Azure AD Rights Management Service`n"
write-host -foregroundcolor $systemmessagecolor "Script Completed`n"
6 changes: 4 additions & 2 deletions o365-connect-mfa-s4b.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

## Variables
$systemmessagecolor = "cyan"
$processmessagecolor = "green"

## If you have running scripts that don't have a certificate, run this command once to disable that level of security
## set-executionpolicy -executionpolicy bypass -scope currentuser -force
Expand All @@ -23,7 +24,7 @@ write-host -foregroundcolor $systemmessagecolor "Script started"
## Download and install https://www.microsoft.com/en-au/download/details.aspx?id=39366 (Skype for Business Online Module)
## Current version = 7.0.1994.0, 26 February 2018
import-module skypeonlineconnector
write-host -foregroundcolor $systemmessagecolor "Skype for Business module loaded"
write-host -foregroundcolor $processmessagecolor "Skype for Business module loaded"

## ensure that Exchange Online MFA modules has been run
## Download and install MFA cmdlets from - https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/mfa-connect-to-exchange-online-powershell?view=exchange-ps
Expand All @@ -32,4 +33,5 @@ write-host -foregroundcolor $systemmessagecolor "Skype for Business module loade
## You will be manually prompted to enter your credentials and MFA
$sfboSession=new-csonlinesession
import-pssession $sfboSession
write-host -foregroundcolor $systemmessagecolor "Now connected to Skype for Business Online services"
write-host -foregroundcolor $processmessagecolor "Now connected to Skype for Business Online services`n"
write-host -foregroundcolor $systemmessagecolor "Script Completed`n"
4 changes: 3 additions & 1 deletion o365-connect-mfa-sac.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

## Variables
$systemmessagecolor = "cyan"
$processmessagecolor = "green"

## If you have running scripts that don't have a certificate, run this command once to disable that level of security
## set-executionpolicy -executionpolicy bypass -scope currentuser -force
Expand All @@ -28,4 +29,5 @@ write-host -foregroundcolor $systemmessagecolor "Exchange Online MFA module load

$Comp = New-EXOPSSession -ConnectionUri $CompConnectionUri -Credential $EXOcreds
$CompImportresults = Import-PSSession $Comp -AllowClobber
write-host -foregroundcolor $systemmessagecolor "Connected to Secruity and Compliance Center MFA"
write-host -foregroundcolor $processmessagecolor "Connected to Secruity and Compliance Center MFA`n"
write-host -foregroundcolor $systemmessagecolor "Script Completed`n"
6 changes: 4 additions & 2 deletions o365-connect-mfa-spo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

## Variables
$systemmessagecolor = "cyan"
$processmessagecolor = "green"
## Change <tenantname> to be your own tenant
$tenanturl= "https://<tenantname>-admin.sharepoint.com" ## SharePoint Admin URL for tenant

Expand All @@ -25,12 +26,13 @@ write-host -foregroundcolor $systemmessagecolor "Script started"
## Download and install https://www.microsoft.com/en-au/download/details.aspx?id=35588 (SharePoint Online Module)
## Current version = 16.0.7813.1200, 27 June 2018
import-module microsoft.online.sharepoint.powershell -disablenamechecking
write-host -foregroundcolor $systemmessagecolor "SharePoint Online module loaded"
write-host -foregroundcolor $processmessagecolor "SharePoint Online module loaded"

## ensure that Exchange Online MFA modules has been run
## Download and install MFA cmdlets from - https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/mfa-connect-to-exchange-online-powershell?view=exchange-ps

## Connect to SharePoint Online Service
## You will be manually prompted to login using MFA
connect-sposervice -url $tenanturl
write-host -foregroundcolor $systemmessagecolor "Now connected to SharePoint Online services MFA"
write-host -foregroundcolor $processmessagecolor "Now connected to SharePoint Online services MFA`n"
write-host -foregroundcolor $systemmessagecolor "Script Completed`n"
6 changes: 4 additions & 2 deletions o365-connect-mfa-tms.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

## Variables
$systemmessagecolor = "cyan"
$processmessagecolor = "green"

## If you have running scripts that don't have a certificate, run this command once to disable that level of security
## set-executionpolicy -executionpolicy bypass -scope currentuser -force
Expand All @@ -24,9 +25,10 @@ write-host -foregroundcolor $systemmessagecolor "Script started"
## https://www.powershellgallery.com/packages/MicrosoftTeams/
## Current version = 0.9.3, 25 April 2018
import-module MicrosoftTeams
write-host -foregroundcolor $systemmessagecolor "Microsoft Teams module loaded"
write-host -foregroundcolor $processmessagecolor "Microsoft Teams module loaded"

## Connect to Microsoft Teams service
## You will be manually prompted to enter credentials and MFA
Connect-MicrosoftTeams
write-host -foregroundcolor $systemmessagecolor "Now connected to Microsoft Teams Service"
write-host -foregroundcolor $processmessagecolor "Now connected to Microsoft Teams Service`n"
write-host -foregroundcolor $systemmessagecolor "Script Completed`n"
6 changes: 4 additions & 2 deletions o365-connect-mfa.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

## Variables
$systemmessagecolor = "cyan"
$processmessagecolor = "green"

## If you have running scripts that don't have a certificate, run this command once to disable that level of security
## set-executionpolicy -executionpolicy bypass -scope currentuser -force
Expand All @@ -25,8 +26,9 @@ write-host -foregroundcolor $systemmessagecolor "Script started"
Import-Module $((Get-ChildItem -Path $($env:LOCALAPPDATA+"\Apps\2.0\") `
-Filter Microsoft.Exchange.Management.ExoPowershellModule.dll -Recurse ).FullName|?{$_ -notmatch "_none_"} `
|select -First 1)
write-host -foregroundcolor $systemmessagecolor "Exchange Online MFA module loaded"
write-host -foregroundcolor $processmessagecolor "Exchange Online MFA module loaded"

$EXOSession = New-ExoPSSession
Import-PSSession $EXOSession
write-host -foregroundcolor $systemmessagecolor "Connected to Exchange Online MFA"
write-host -foregroundcolor $processmessagecolor "Connected to Exchange Online MFA`n"
write-host -foregroundcolor $systemmessagecolor "Script Completed`n"
10 changes: 6 additions & 4 deletions o365-connect-s4b.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

## Variables
$systemmessagecolor = "cyan"
$processmessagecolor = "green"
$savedcreds=$false ## false = manually enter creds, True = from file
$credpath = "c:\downloads\tenant.xml" ## local file with credentials if required

Expand All @@ -31,12 +32,12 @@ write-host -foregroundcolor $systemmessagecolor "Script started"
clear-host

import-module msonline
write-host -foregroundcolor $systemmessagecolor "MSOnline module loaded"
write-host -foregroundcolor $processmessagecolor "MSOnline module loaded"

## Download and install https://www.microsoft.com/en-au/download/details.aspx?id=39366 (Skype for Business Online Module)
## Current version = 7.0.1994.0, 26 February 2018
import-module skypeonlineconnector
write-host -foregroundcolor $systemmessagecolor "Skype for Business module loaded"
write-host -foregroundcolor $processmessagecolor "Skype for Business module loaded"

## Get tenant login credentials
if ($savedcreds) {
Expand All @@ -50,9 +51,10 @@ else {

## Connect to Office 365 admin service
connect-msolservice -credential $cred
write-host -foregroundcolor $systemmessagecolor "Now connected to Office 365 Admin service"
write-host -foregroundcolor $processmessagecolor "Now connected to Office 365 Admin service"

## Connect to Skype for Business Online Service
$sfboSession=new-csonlinesession -credential $cred
import-pssession $sfboSession
write-host -foregroundcolor $systemmessagecolor "Now connected to Skype for Business Online services"
write-host -foregroundcolor $processmessagecolor "Now connected to Skype for Business Online services`n"
write-host -foregroundcolor $systemmessagecolor "Script Completed`n"
8 changes: 5 additions & 3 deletions o365-connect-sac.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

## Variables
$systemmessagecolor = "cyan"
$processmessagecolor = "green"
$savedcreds=$false ## false = manually enter creds, True = from file
$credpath = "c:\downloads\tenant.xml" ## local file with credentials if required

Expand All @@ -28,7 +29,7 @@ write-host -foregroundcolor $systemmessagecolor "Script started"
## Current version = 1.1.183.8, 18 May 2018

import-module msonline
write-host -foregroundcolor $systemmessagecolor "MSOnline module loaded"
write-host -foregroundcolor $processmessagecolor "MSOnline module loaded"

## Get tenant login credentials
if ($savedcreds) {
Expand All @@ -42,7 +43,7 @@ else {

## Connect to Office 365 admin service
connect-msolservice -credential $cred
write-host -foregroundcolor $systemmessagecolor "Now connected to Office 365 Admin service"
write-host -foregroundcolor $processmessagecolor "Now connected to Office 365 Admin service"

## Connect to the Office 365 Security and Compliance Center
Write-Output "Getting the Security & Compliance Center cmdlets"
Expand All @@ -51,4 +52,5 @@ $Session = New-PSSession -ConfigurationName Microsoft.Exchange `
-Credential $cred -Authentication Basic -AllowRedirection

Import-PSSession $Session
write-host -foregroundcolor $systemmessagecolor "Now connected to Office 365 Security and Compliance Center"
write-host -foregroundcolor $processmessagecolor "Now connected to Office 365 Security and Compliance Center`n"
write-host -foregroundcolor $systemmessagecolor "Script Completed`n"
14 changes: 8 additions & 6 deletions o365-connect-spo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

## Variables
$systemmessagecolor = "cyan"
$processmessagecolor = "green"
$savedcreds=$false ## false = manually enter creds, True = from file
$credpath = "c:\downloads\tenant.xml" ## local file with credentials if required
## Change <tenantname> to be your own tenant
Expand All @@ -31,12 +32,12 @@ write-host -foregroundcolor $systemmessagecolor "Script started"
## Current version = 1.1.183.8, 18 May 2018

import-module msonline
write-host -foregroundcolor $systemmessagecolor "MSOnline module loaded"
write-host -foregroundcolor $processmessagecolor "MSOnline module loaded"

## Download and install https://www.microsoft.com/en-au/download/details.aspx?id=35588 (SharePoint Online Module)
## Current version = 16.0.7813.1200, 27 June 2018
## Download and install https://www.powershellgallery.com/packages/Microsoft.Online.SharePoint.PowerShell/
## Current version = 16.0.8316.0, 22 November 2018
import-module microsoft.online.sharepoint.powershell -disablenamechecking
write-host -foregroundcolor green "SharePoint Online module loaded"
write-host -foregroundcolor $processmessagecolor "SharePoint Online module loaded"

## Get tenant login credentials
if ($savedcreds) {
Expand All @@ -50,8 +51,9 @@ else {

## Connect to Office 365 admin service
connect-msolservice -credential $cred
write-host -foregroundcolor $systemmessagecolor "Now connected to Office 365 Admin service"
write-host -foregroundcolor $processmessagecolor "Now connected to Office 365 Admin service"

#Connect to SharePoint Online Service
connect-sposervice -url $tenanturl -credential $cred
write-host -foregroundcolor $systemmessagecolor "Now connected to SharePoint Online services"
write-host -foregroundcolor $processmessagecolor "Now connected to SharePoint Online services`n"
write-host -foregroundcolor $systemmessagecolor "Script Completed`n"
6 changes: 4 additions & 2 deletions o365-connect-tms.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

## Variables
$systemmessagecolor = "cyan"
$processmessagecolor = "green"
$savedcreds=$false ## false = manually enter creds, True = from file
$credpath = "c:\downloads\tenant.xml" ## local file with credentials if required

Expand All @@ -26,7 +27,7 @@ write-host -foregroundcolor $systemmessagecolor "Script started"
## https://www.powershellgallery.com/packages/MicrosoftTeams/
## Current version = 0.9.3, 25 April 2018
import-module MicrosoftTeams
write-host -foregroundcolor $systemmessagecolor "Microsoft Teams module loaded"
write-host -foregroundcolor $processmessagecolor "Microsoft Teams module loaded"

## Get tenant login credentials
if ($savedcreds) {
Expand All @@ -40,4 +41,5 @@ else {

## Connect to Microsoft Teams service
Connect-MicrosoftTeams -credential $cred
write-host -foregroundcolor $systemmessagecolor "Now connected to Microsoft Teams Service"
write-host -foregroundcolor $processmessagecolor "Now connected to Microsoft Teams Service`n"
write-host -foregroundcolor $systemmessagecolor "Script Completed`n"
Loading

0 comments on commit c736413

Please sign in to comment.