From c736413a3dd8ffda95e561d2e0fd25173d889f6e Mon Sep 17 00:00:00 2001 From: Robert Crane Date: Thu, 27 Dec 2018 21:59:35 +1100 Subject: [PATCH] Consistency --- O365-connect-aad.ps1 | 8 +++++--- o365-addin-deploy.ps1 | 2 +- o365-atp-timer.ps1 | 2 +- o365-connect-bulk.ps1 | 2 +- o365-connect-ctrldply.ps1 | 4 +++- o365-connect-exo.ps1 | 4 +++- o365-connect-mfa-aad.ps1 | 6 ++++-- o365-connect-mfa-aadrm.ps1 | 4 +++- o365-connect-mfa-s4b.ps1 | 6 ++++-- o365-connect-mfa-sac.ps1 | 4 +++- o365-connect-mfa-spo.ps1 | 6 ++++-- o365-connect-mfa-tms.ps1 | 6 ++++-- o365-connect-mfa.ps1 | 6 ++++-- o365-connect-s4b.ps1 | 10 ++++++---- o365-connect-sac.ps1 | 8 +++++--- o365-connect-spo.ps1 | 14 ++++++++------ o365-connect-tms.ps1 | 6 ++++-- o365-connect.ps1 | 6 ++++-- o365-email-pwned.ps1 | 4 +++- o365-exo-addins.ps1 | 6 ++++-- o365-exo-fwd-chk.ps1 | 7 ++++--- o365-login-audit.ps1 | 5 +++-- o365-malware-policy.ps1 | 7 ++++--- o365-modern-auth.ps1 | 8 ++++---- o365-mx-check.ps1 | 9 +++++---- o365-setup.ps1 | 15 ++++++++------- o365-spam-policy.ps1 | 7 ++++--- o365-spo-admins.ps1 | 8 ++++---- o365-spo-extusr.ps1 | 8 ++++---- o365-spo-getsharing.ps1 | 6 +++--- o365-update.ps1 | 16 ++++++++-------- o365-user-off.ps1 | 25 +++++++++++++------------ save-cred-file.ps1 | 4 ++-- 33 files changed, 140 insertions(+), 99 deletions(-) diff --git a/O365-connect-aad.ps1 b/O365-connect-aad.ps1 index d85f3e8..93d6f1b 100644 --- a/O365-connect-aad.ps1 +++ b/O365-connect-aad.ps1 @@ -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 @@ -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) { @@ -40,4 +41,5 @@ else { ## Connect to AzuerAD service Connect-azuread -credential $cred -write-host -foregroundcolor green "Now connected to Azure AD Service" \ No newline at end of file +write-host -foregroundcolor $processmessagecolor "Now connected to Azure AD Service`n" +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-addin-deploy.ps1 b/o365-addin-deploy.ps1 index b6939f8..e6d6273 100644 --- a/o365-addin-deploy.ps1 +++ b/o365-addin-deploy.ps1 @@ -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" \ No newline at end of file +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-atp-timer.ps1 b/o365-atp-timer.ps1 index fd0c1b0..01e35d7 100644 --- a/o365-atp-timer.ps1 +++ b/o365-atp-timer.ps1 @@ -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" \ No newline at end of file +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-connect-bulk.ps1 b/o365-connect-bulk.ps1 index d792d7c..8040174 100644 --- a/o365-connect-bulk.ps1 +++ b/o365-connect-bulk.ps1 @@ -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" \ No newline at end of file +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-connect-ctrldply.ps1 b/o365-connect-ctrldply.ps1 index a125274..f9dda3e 100644 --- a/o365-connect-ctrldply.ps1 +++ b/o365-connect-ctrldply.ps1 @@ -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 @@ -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" \ No newline at end of file +write-host -foregroundcolor $processmessagecolor "Now connected to Office 365 Centralized Deployment`n" +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-connect-exo.ps1 b/o365-connect-exo.ps1 index 6d153a7..aee5e4d 100644 --- a/o365-connect-exo.ps1 +++ b/o365-connect-exo.ps1 @@ -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 @@ -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" \ No newline at end of file +write-host -foregroundcolor $processmessagecolor "Now connected to Exchange Online services`n" +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-connect-mfa-aad.ps1 b/o365-connect-mfa-aad.ps1 index edaa16b..eb0de06 100644 --- a/o365-connect-mfa-aad.ps1 +++ b/o365-connect-mfa-aad.ps1 @@ -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 @@ -26,7 +27,7 @@ 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 @@ -34,4 +35,5 @@ write-host -foregroundcolor $systemmessagecolor "AzureAD module loaded" ## 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" \ No newline at end of file +write-host -foregroundcolor $processmessagecolor "Now connected to Azure AD Service with MFA`n" +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-connect-mfa-aadrm.ps1 b/o365-connect-mfa-aadrm.ps1 index e5159ac..d12001c 100644 --- a/o365-connect-mfa-aadrm.ps1 +++ b/o365-connect-mfa-aadrm.ps1 @@ -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 @@ -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" \ No newline at end of file +write-host -foregroundcolor $processmessagecolor "Now connected to the Azure AD Rights Management Service`n" +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-connect-mfa-s4b.ps1 b/o365-connect-mfa-s4b.ps1 index 5f1adc0..2eb4894 100644 --- a/o365-connect-mfa-s4b.ps1 +++ b/o365-connect-mfa-s4b.ps1 @@ -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 @@ -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 @@ -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" \ No newline at end of file +write-host -foregroundcolor $processmessagecolor "Now connected to Skype for Business Online services`n" +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-connect-mfa-sac.ps1 b/o365-connect-mfa-sac.ps1 index 6d68b5c..b7f3f95 100644 --- a/o365-connect-mfa-sac.ps1 +++ b/o365-connect-mfa-sac.ps1 @@ -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 @@ -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" \ No newline at end of file +write-host -foregroundcolor $processmessagecolor "Connected to Secruity and Compliance Center MFA`n" +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-connect-mfa-spo.ps1 b/o365-connect-mfa-spo.ps1 index 55c7e1b..4807ae1 100644 --- a/o365-connect-mfa-spo.ps1 +++ b/o365-connect-mfa-spo.ps1 @@ -12,6 +12,7 @@ ## Variables $systemmessagecolor = "cyan" +$processmessagecolor = "green" ## Change to be your own tenant $tenanturl= "https://-admin.sharepoint.com" ## SharePoint Admin URL for tenant @@ -25,7 +26,7 @@ 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 @@ -33,4 +34,5 @@ write-host -foregroundcolor $systemmessagecolor "SharePoint Online module loaded ## 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" \ No newline at end of file +write-host -foregroundcolor $processmessagecolor "Now connected to SharePoint Online services MFA`n" +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-connect-mfa-tms.ps1 b/o365-connect-mfa-tms.ps1 index 28efaa6..cf42333 100644 --- a/o365-connect-mfa-tms.ps1 +++ b/o365-connect-mfa-tms.ps1 @@ -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 @@ -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" \ No newline at end of file +write-host -foregroundcolor $processmessagecolor "Now connected to Microsoft Teams Service`n" +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-connect-mfa.ps1 b/o365-connect-mfa.ps1 index 21b95d7..de883fd 100644 --- a/o365-connect-mfa.ps1 +++ b/o365-connect-mfa.ps1 @@ -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 @@ -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" \ No newline at end of file +write-host -foregroundcolor $processmessagecolor "Connected to Exchange Online MFA`n" +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-connect-s4b.ps1 b/o365-connect-s4b.ps1 index 9052363..95d728c 100644 --- a/o365-connect-s4b.ps1 +++ b/o365-connect-s4b.ps1 @@ -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 @@ -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) { @@ -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" \ No newline at end of file +write-host -foregroundcolor $processmessagecolor "Now connected to Skype for Business Online services`n" +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-connect-sac.ps1 b/o365-connect-sac.ps1 index a6587e5..62d088a 100644 --- a/o365-connect-sac.ps1 +++ b/o365-connect-sac.ps1 @@ -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 @@ -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) { @@ -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" @@ -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" \ No newline at end of file +write-host -foregroundcolor $processmessagecolor "Now connected to Office 365 Security and Compliance Center`n" +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-connect-spo.ps1 b/o365-connect-spo.ps1 index be876c8..1656dda 100644 --- a/o365-connect-spo.ps1 +++ b/o365-connect-spo.ps1 @@ -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 to be your own tenant @@ -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) { @@ -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" \ No newline at end of file +write-host -foregroundcolor $processmessagecolor "Now connected to SharePoint Online services`n" +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-connect-tms.ps1 b/o365-connect-tms.ps1 index 577c152..83405cc 100644 --- a/o365-connect-tms.ps1 +++ b/o365-connect-tms.ps1 @@ -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 @@ -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) { @@ -40,4 +41,5 @@ else { ## Connect to Microsoft Teams service Connect-MicrosoftTeams -credential $cred -write-host -foregroundcolor $systemmessagecolor "Now connected to Microsoft Teams Service" \ No newline at end of file +write-host -foregroundcolor $processmessagecolor "Now connected to Microsoft Teams Service`n" +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-connect.ps1 b/o365-connect.ps1 index e069d10..da953ca 100644 --- a/o365-connect.ps1 +++ b/o365-connect.ps1 @@ -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 @@ -28,7 +29,7 @@ write-host -foregroundcolor $systemmessagecolor "Script started" ## Current version = 1.1.183.17, 4 August 2018 import-module msonline -write-host -foregroundcolor $systemmessagecolor "MSOnline module loaded" +write-host -foregroundcolor $processmessagecolor "MSOnline module loaded" ## Get tenant login credentials if ($savedcreds) { @@ -42,4 +43,5 @@ else { ## Connect to Office 365 admin service connect-msolservice -credential $cred -write-host -foregroundcolor $systemmessagecolor "Now connected to Office 365 Admin service" \ No newline at end of file +write-host -foregroundcolor $processmessagecolor "Now connected to Office 365 Admin service`n" +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-email-pwned.ps1 b/o365-email-pwned.ps1 index 7a3bce4..7f03dff 100644 --- a/o365-email-pwned.ps1 +++ b/o365-email-pwned.ps1 @@ -100,4 +100,6 @@ If ($Breaches -gt 0) { $Report | Export-CSV $resultsfile -NoTypeInformation Write-Host "Total breaches found: " $Breaches " You can find a report in "$resultsfile } Else - { Write-Host "Hurray - no breaches found for your Office 365 mailboxes" } \ No newline at end of file + { Write-Host "Hurray - no breaches found for your Office 365 mailboxes" } + + write-host -foregroundcolor $systemmessagecolor "Script finished`n" \ No newline at end of file diff --git a/o365-exo-addins.ps1 b/o365-exo-addins.ps1 index 4748d76..b22509c 100644 --- a/o365-exo-addins.ps1 +++ b/o365-exo-addins.ps1 @@ -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 @@ -22,11 +23,12 @@ write-host -foregroundcolor $systemmessagecolor "`nScript started" ## Get all mailboxes $mailboxes = Get-Mailbox -ResultSize Unlimited -write-host -foregroundcolor $systemmessagecolor "`nCheck Mailbox Add ins" +write-host -foregroundcolor $processmessagecolor "`nCheck Mailbox Add ins" foreach ($mailbox in $mailboxes) { write-host "Mailbox =",$mailbox.primarysmtpaddress get-app -mailbox $mailbox.primarysmtpaddress | Select-Object displayname,enabled,appversion | Format-Table } -write-host -foregroundcolor $systemmessagecolor "`nScript complete" \ No newline at end of file +write-host -foregroundcolor $processmessagecolor "`nScript complete`n" +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" \ No newline at end of file diff --git a/o365-exo-fwd-chk.ps1 b/o365-exo-fwd-chk.ps1 index 41f2f71..70241f9 100644 --- a/o365-exo-fwd-chk.ps1 +++ b/o365-exo-fwd-chk.ps1 @@ -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 @@ -27,7 +28,7 @@ $mailboxes = Get-Mailbox -ResultSize Unlimited ## Yellow - forwarding disabled but forwarding address present ## Red - forwarding enabled -write-host -foregroundcolor $systemmessagecolor "`nCheck Exchange Forwards" +write-host -foregroundcolor $processmessagecolor "`nCheck Exchange Forwards" foreach ($mailbox in $mailboxes) { if ($mailbox.DeliverToMailboxAndForward) { ## if email forwarding is active @@ -53,7 +54,7 @@ foreach ($mailbox in $mailboxes) { } } -write-host -foregroundcolor $systemmessagecolor "`nCheck Outlook Rule Forwards" +write-host -foregroundcolor $processmessagecolor "`nCheck Outlook Rule Forwards" foreach ($mailbox in $mailboxes) { @@ -82,4 +83,4 @@ foreach ($mailbox in $mailboxes) } } -write-host -foregroundcolor $systemmessagecolor "`nScript complete" +write-host -foregroundcolor $systemmessagecolor "`nScript complete`n" \ No newline at end of file diff --git a/o365-login-audit.ps1 b/o365-login-audit.ps1 index d89922c..22c8866 100644 --- a/o365-login-audit.ps1 +++ b/o365-login-audit.ps1 @@ -12,6 +12,7 @@ ## Variables $systemmessagecolor = "cyan" +$processmessagecolor = "green" $startdate = "9/5/2018" ## Starting date for audit log search MM/DD/YYYY $enddate = "9/11/2018" ## Ending date for audit log search MM/DD/YYYY $sesid="0" ## change this if you want to re-reun the script multiple times in a single session @@ -45,7 +46,7 @@ write-host -foregroundcolor $systemmessagecolor "Script started" # Loop will run until $AuditOutput returns null which equals that no more event objects exists from the specified date while ($AuditOutput) { # Search the defined date(s), SessionId + SessionCommand in combination with the loop will return and append 100 object per iteration until all objects are returned (minimum limit is 50k objects) - write-host -foregroundcolor $systemmessagecolor "Searching Audit logs. Please wait" + write-host -foregroundcolor $processmessagecolor "Searching Audit logs. Please wait" $AuditOutput = Search-UnifiedAuditLog -StartDate $StartDate -EndDate $EndDate -recordtype $recordtype -operations $operation -SessionId $sesid -SessionCommand ReturnLargeSet # Select and expand the nested object (AuditData) as it holds relevant reporting data. Convert output format from default JSON to enable export to csv $ConvertedOutput = $AuditOutput | Select-Object -ExpandProperty AuditData | ConvertFrom-Json @@ -79,4 +80,4 @@ foreach ($result in $results){ } write-host -write-host -foregroundcolor $systemmessagecolor "Script Completed" \ No newline at end of file +write-host -foregroundcolor $systemmessagecolor "Script Completed`n" diff --git a/o365-malware-policy.ps1 b/o365-malware-policy.ps1 index 0a9901d..3adf81a 100644 --- a/o365-malware-policy.ps1 +++ b/o365-malware-policy.ps1 @@ -11,6 +11,7 @@ ## Variables $systemmessagecolor = "cyan" +$processmessagecolor = "green" ## Separate multiple domains with comma (,) e.g."domain1.com", "domain2.com", "domain3.com" $domains = "M365B555418.onmicrosoft.com" $policyname = "Configured Policy" @@ -23,7 +24,7 @@ Clear-Host write-host -foregroundcolor $systemmessagecolor "Script started" -write-host -foregroundcolor $systemmessagecolor "Set new malware policy" +write-host -foregroundcolor $processmessagecolor "Set new malware policy" $policyparams = @{ "Name" = $policyname; @@ -34,7 +35,7 @@ $policyparams = @{ } new-malwarefilterpolicy @policyparams -write-host -foregroundcolor $systemmessagecolor "Set new malware filter rule" +write-host -foregroundcolor $processmessagecolor "Set new malware filter rule" $ruleparams = @{ 'name' = $rulename; @@ -47,4 +48,4 @@ $ruleparams = @{ New-malwarefilterrule @ruleparams -write-host -foregroundcolor $systemmessagecolor "Script complete" +write-host -foregroundcolor $systemmessagecolor "Script complete`n" diff --git a/o365-modern-auth.ps1 b/o365-modern-auth.ps1 index 91bdb0d..a5fdffd 100644 --- a/o365-modern-auth.ps1 +++ b/o365-modern-auth.ps1 @@ -12,7 +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 @@ -24,7 +24,7 @@ $org=get-organizationconfig write-host -ForegroundColor white "Exchange setting is currently",$org.OAuth2ClientProfileEnabled ## Run this command to enable modern authentication for Exchange Online Set-OrganizationConfig -OAuth2ClientProfileEnabled $true -write-host -foregroundcolor $systemmessagecolor "Exchange command completed" +write-host -foregroundcolor $processmessagecolor "Exchange command completed" $org=get-organizationconfig write-host -ForegroundColor white "Exchange setting updated to",$org.OAuth2ClientProfileEnabled write-host @@ -32,8 +32,8 @@ $org=get-csoauthconfiguration write-host -ForegroundColor white "Skype setting is currently",$org.clientadalauthoverride ## Run this command to enable modern authentication for Skype for Business Online Set-CsOAuthConfiguration -ClientAdalAuthOverride Allowed -write-host -foregroundcolor $systemmessagecolor "Skype command completed" +write-host -foregroundcolor $processmessagecolor "Skype command completed" $org=get-csoauthconfiguration write-host -ForegroundColor white "Skype setting updated to",$org.clientadalauthoverride write-host -write-host -foregroundcolor $systemmessagecolor "Script completed" \ No newline at end of file +write-host -foregroundcolor $systemmessagecolor "Script completed`n" \ No newline at end of file diff --git a/o365-mx-check.ps1 b/o365-mx-check.ps1 index 4c46c6d..4d8816c 100644 --- a/o365-mx-check.ps1 +++ b/o365-mx-check.ps1 @@ -13,6 +13,7 @@ $auditlogagelimitdefault = 90 $retaindeleteditemsfordefault = 14 $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 @@ -21,9 +22,9 @@ Clear-Host write-host -foregroundcolor $systemmessagecolor "Script started" -write-host -ForegroundColor $systemmessagecolor "Getting Mailboxes" +write-host -ForegroundColor $processmessagecolor "Getting Mailboxes" $mailboxes=get-mailbox -ResultSize unlimited -write-host -ForegroundColor $systemmessagecolor "Start checking mailboxes" +write-host -ForegroundColor $processmessagecolor "Start checking mailboxes" write-host foreach ($mailbox in $mailboxes){ write-host -foregroundcolor yellow -BackgroundColor Black "Mailbox =",$mailbox.displayname @@ -100,6 +101,6 @@ foreach ($mailbox in $mailboxes){ } write-host } -write-host -ForegroundColor $systemmessagecolor "Finish checking mailboxes" +write-host -ForegroundColor $processmessagecolor "Finish checking mailboxes" write-host -write-host -ForegroundColor $systemmessagecolor "Finish script" +write-host -foregroundcolor $systemmessagecolor "Script completed`n" diff --git a/o365-setup.ps1 b/o365-setup.ps1 index 1349e4f..f33f675 100644 --- a/o365-setup.ps1 +++ b/o365-setup.ps1 @@ -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 @@ -19,19 +20,19 @@ Clear-Host write-host -foregroundcolor $systemmessagecolor "Start Script" -write-host -foregroundcolor $systemmessagecolor "Install Azure AD module" +write-host -foregroundcolor $processmessagecolor "Install Azure AD module" Install-Module -Name AzureAD -force -write-host -foregroundcolor $systemmessagecolor "Install Azure AD Right Management module" +write-host -foregroundcolor $processmessagecolor "Install Azure AD Right Management module" Install-Module -Name AADRM -force -write-host -foregroundcolor $systemmessagecolor "Install Teams Module" +write-host -foregroundcolor $processmessagecolor "Install Teams Module" Install-Module -Name MicrosoftTeams -Force -write-host -foregroundcolor $systemmessagecolor "Install SharePoint Online module" +write-host -foregroundcolor $processmessagecolor "Install SharePoint Online module" Install-Module -Name Microsoft.Online.SharePoint.PowerShell -force -write-host -foregroundcolor $systemmessagecolor "Install Microsoft Online module" +write-host -foregroundcolor $processmessagecolor "Install Microsoft Online module" Install-Module -Name MSOnline -force -write-host -foregroundcolor $systemmessagecolor "Install Azure module" +write-host -foregroundcolor $processmessagecolor "Install Azure module" Install-Module -name AzureRM -Force ## New Az module ## Install-Module -name Az -force -write-host -foregroundcolor $systemmessagecolor "Finish Script" \ No newline at end of file +write-host -foregroundcolor $systemmessagecolor "Script completed`n" \ No newline at end of file diff --git a/o365-spam-policy.ps1 b/o365-spam-policy.ps1 index c327510..ff1d910 100644 --- a/o365-spam-policy.ps1 +++ b/o365-spam-policy.ps1 @@ -12,6 +12,7 @@ ## Variables $systemmessagecolor = "cyan" +$processmessagecolor = "green" ## Separate multiple domains with comma (,) e.g."domain1.com", "domain2.com", "domain3.com" $domains = "M365B555418.onmicrosoft.com" $policyname = "Configured Policy" @@ -24,7 +25,7 @@ Clear-Host write-host -foregroundcolor $systemmessagecolor "Script started" -write-host -foregroundcolor $systemmessagecolor "Set new spam policy" +write-host -foregroundcolor $processmessagecolor "Set new spam policy" $policyparams = @{ "name" = $policyname; @@ -55,7 +56,7 @@ $policyparams = @{ new-hostedcontentfilterpolicy @policyparams -write-host -foregroundcolor Cyan "Set new filter rule" +write-host -foregroundcolor $processmessagecolor"Set new filter rule" $ruleparams = @{ 'name' = $rulename; @@ -66,4 +67,4 @@ $ruleparams = @{ New-hostedcontentfilterrule @ruleparams -write-host -foregroundcolor $systemmessagecolor "Script complete" +write-host -foregroundcolor $systemmessagecolor "Script completed`n" diff --git a/o365-spo-admins.ps1 b/o365-spo-admins.ps1 index 2114aaa..0143c9b 100644 --- a/o365-spo-admins.ps1 +++ b/o365-spo-admins.ps1 @@ -11,7 +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 @@ -21,12 +21,12 @@ write-host -foregroundcolor $systemmessagecolor "Script started" ## Ensure that SharePoint Online modeule has been installed and loaded -Write-host -ForegroundColor $systemmessagecolor "Getting all Sharepoint sites in tenant" +Write-host -ForegroundColor $processmessagecolor "Getting all Sharepoint sites in tenant" $SiteCollections = Get-SPOSite -Limit All foreach ($site in $SiteCollections) ## Loop through all Site Collections in tenant { - Write-host -ForegroundColor Green "Checking site:",$site.url + Write-host -ForegroundColor $processmessagecolor "Checking site:",$site.url $siteusers = get-spouser -site $site.Url ## get all users for that SharePoint site foreach ($siteuser in $siteusers){ ## loop through all the users in the site @@ -36,4 +36,4 @@ foreach ($site in $SiteCollections) ## Loop through all Site Collections in tena } write-host } -write-host -foregroundcolor $systemmessagecolor "Script complete" +write-host -foregroundcolor $systemmessagecolor "Script completed`n" diff --git a/o365-spo-extusr.ps1 b/o365-spo-extusr.ps1 index 4525495..8db8852 100644 --- a/o365-spo-extusr.ps1 +++ b/o365-spo-extusr.ps1 @@ -11,7 +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 @@ -21,12 +21,12 @@ write-host -foregroundcolor $systemmessagecolor "Script started" ## ensure that SharePoint Online modeule has been installed and loaded -Write-host -ForegroundColor $systemmessagecolor "Getting all Sharepoint sites in tenant" +Write-host -ForegroundColor $processmessagecolor "Getting all Sharepoint sites in tenant" $SiteCollections = Get-SPOSite -Limit All foreach ($site in $SiteCollections) ## Loop through all Site Collections in tenant { - Write-host -ForegroundColor Green "Checking site:",$site.url + Write-host -ForegroundColor $processmessagecolor "Checking site:",$site.url try { for ($i=0;;$i+=50) { ## There is a return limit of 50 users so need to capture data if more than 50 external users @@ -37,4 +37,4 @@ catch { ## this is where any error handling will appear if required } } -write-host -foregroundcolor $systemmessagecolor "Script complete" +write-host -foregroundcolor $systemmessagecolor "Script completed`n" diff --git a/o365-spo-getsharing.ps1 b/o365-spo-getsharing.ps1 index c86f8b1..ae897ce 100644 --- a/o365-spo-getsharing.ps1 +++ b/o365-spo-getsharing.ps1 @@ -11,7 +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 @@ -30,8 +30,8 @@ Write-Host ## ensure that SharePoint Online module has been installed and loaded -Write-host -ForegroundColor $systemmessagecolor "Getting all Sharepoint sites in tenant" +Write-host -ForegroundColor $processmessagecolor "Getting all Sharepoint sites in tenant" get-sposite | Select-object url,sharingcapability -write-host -foregroundcolor $systemmessagecolor "Script complete" +write-host -foregroundcolor $systemmessagecolor "Script completed`n" diff --git a/o365-update.ps1 b/o365-update.ps1 index 903487d..f92133a 100644 --- a/o365-update.ps1 +++ b/o365-update.ps1 @@ -11,7 +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 @@ -19,19 +19,19 @@ Clear-Host write-host -foregroundcolor $systemmessagecolor "Start Script" -write-host -foregroundcolor $systemmessagecolor "Update Azure AD module" +write-host -foregroundcolor $processmessagecolor "Update Azure AD module" Update-Module -Name AzureAD -force -write-host -foregroundcolor $systemmessagecolor "Update Azure AD Right Management module" +write-host -foregroundcolor $processmessagecolor "Update Azure AD Right Management module" Update-Module -Name AADRM -force -write-host -foregroundcolor $systemmessagecolor "Update Teams Module" +write-host -foregroundcolor $processmessagecolor "Update Teams Module" Update-Module -Name MicrosoftTeams -Force -write-host -foregroundcolor $systemmessagecolor "Update SharePoint Online module" +write-host -foregroundcolor $processmessagecolor "Update SharePoint Online module" Update-Module -Name Microsoft.Online.SharePoint.PowerShell -force -write-host -foregroundcolor $systemmessagecolor "Update Microsoft Online module" +write-host -foregroundcolor $processmessagecolor "Update Microsoft Online module" Update-Module -Name MSOnline -force -write-host -foregroundcolor $systemmessagecolor "Update Azure module" +write-host -foregroundcolor $processmessagecolor "Update Azure module" Update-Module -name AzureRM -Force ## New Az module ## Update-Module -name Az -force -write-host -foregroundcolor $systemmessagecolor "Finish Script" \ No newline at end of file +write-host -foregroundcolor $systemmessagecolor "Script completed`n" \ No newline at end of file diff --git a/o365-user-off.ps1 b/o365-user-off.ps1 index c6916c5..22d5d37 100644 --- a/o365-user-off.ps1 +++ b/o365-user-off.ps1 @@ -13,6 +13,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 @@ -31,11 +32,11 @@ catch return } -write-host -foregroundcolor green "Found",$user.displayname +write-host -foregroundcolor $processmessagecolor "Found",$user.displayname ## Disable account to block user logins Set-AzureADUser -objectid $user.ObjectId -AccountEnabled $false -write-host -foregroundcolor green "Disabled login" +write-host -foregroundcolor $processmessagecolor "Disabled login" ## Invalidates all the refresh tokens used to obtain new access tokens for Office 365 applications by setting their expiry to the current date and time. ## When a user authenticates to connect to an Office 365 application, they create a session with that application. @@ -43,43 +44,43 @@ write-host -foregroundcolor green "Disabled login" ## An Office 365 access token is valid for an hour (the periodĀ can be changedĀ if needed). ## When that period elapses, an automatic reauthentication process commences to obtain a new access token to allow the session to continue Revoke-AzureADUserAllRefreshToken -ObjectId $user.ObjectId -write-host -foregroundcolor green "Revoked Token" +write-host -foregroundcolor $processmessagecolor "Revoked Token" ## The ActiveSyncEnabled parameter enables or disables Exchange ActiveSync for the mailbox. Set-CASMailbox $useremail -ActiveSyncEnabled $false -write-host -foregroundcolor green "ActiveSync disabled" +write-host -foregroundcolor $processmessagecolor "ActiveSync disabled" ## The OWAEnabled parameter enables or disables access to the mailbox by using Outlook on the web Set-casmailbox $useremail -owaenabled $false -write-host -foregroundcolor green "OWA disabled" +write-host -foregroundcolor $processmessagecolor "OWA disabled" ## TheActiveSyncAllowedDeviceIDs parameter specifies one or more Exchange ActiveSync device IDs that are allowed to synchronize with the mailbox. ## Setting this to $NULL clears the list of device IDs Set-casmailbox $useremail -activesyncalloweddeviceids $null -write-host -foregroundcolor green "Removed allowed ActiveSync devices" +write-host -foregroundcolor $processmessagecolor "Removed allowed ActiveSync devices" ## The MAPIEnabled parameter enables or disables access to the mailbox by using MAPI clients (for example, Outlook). Set-casmailbox $useremail -mapienabled $false -write-host -foregroundcolor green "Disabled MAPI" +write-host -foregroundcolor $processmessagecolor "Disabled MAPI" ## The OWAforDevicesEnabled parameter enables or disables access to the mailbox by using Outlook on the web for devices. Set-casmailbox $useremail -OWAforDevicesEnabled $false -write-host -foregroundcolor green "Disabled MAPI fo devices" +write-host -foregroundcolor $processmessagecolor "Disabled MAPI fo devices" ## The PopEnabled parameter enables or disables access to the mailbox by using POP3 clients. Set-casmailbox $useremail -popenabled $false -write-host -foregroundcolor green "Disabled POP" +write-host -foregroundcolor $processmessagecolor "Disabled POP" ## The ImapEnabled parameter enables or disables access to the mailbox by using IMAP4 clients. Set-casmailbox $useremail -imapenabled $false -write-host -foregroundcolor green "Disabled IMAP" +write-host -foregroundcolor $processmessagecolor "Disabled IMAP" ## The UniversalOutlookEnabled parameter enables or disables access to the mailbox by using Mail and Calendar Set-casmailbox $useremail -universaloutlookenabled $false -write-host -foregroundcolor green "Disabled Outlook" +write-host -foregroundcolor $processmessagecolor "Disabled Outlook" ## User will be signed out of browser, desktop and mobile applications accessing Office 365 resources across all devices. ## It can take up to an hour to sign out from all devices. Revoke-SPOUserSession -user $useremail -Confirm:$false -write-host -foregroundcolor $systemmessagecolor "Ending script" \ No newline at end of file +write-host -foregroundcolor $systemmessagecolor "Script completed`n" \ No newline at end of file diff --git a/save-cred-file.ps1 b/save-cred-file.ps1 index c4b12ab..b7bc8c0 100644 --- a/save-cred-file.ps1 +++ b/save-cred-file.ps1 @@ -10,7 +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 @@ -24,4 +24,4 @@ $credpath = "c:\downloads\tenant.xml" ## local file with credentials ## Save manually inputed creds to local file Get-Credential | Export-CliXml -Path $credpath -write-host -foregroundcolor $systemmessagecolor "Script Completed" +write-host -foregroundcolor $systemmessagecolor "Script completed`n"