Skip to content

Instantly share code, notes, and snippets.

View arjunumenon's full-sized avatar
☁️
Living inside cloud

Arjun Menon arjunumenon

☁️
Living inside cloud
View GitHub Profile
@arjunumenon
arjunumenon / VM-Region.xml
Last active April 6, 2023 17:23
Azure VM - Locale Settings
<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
<!--User List-->
<gs:UserList>
<gs:User UserID="Current" CopySettingsToDefaultUserAcct="true" CopySettingsToSystemAcct="true"/>
</gs:UserList>
<!-- First Day of Week -->
<gs:iFirstDayOfWeek>1</gs:iFirstDayOfWeek>
</gs:GlobalizationServices>
@arjunumenon
arjunumenon / Create-SelfSignedCertificate.ps1
Last active December 29, 2022 15:38
Script files for CI CD Setup for SPFx
<#
.SYNOPSIS
Creates a Self Signed Certificate for use in server to server authentication
.DESCRIPTION
.EXAMPLE
.\Create-SelfSignedCertificate.ps1 -CommonName "MyCert" -StartDate 2015-11-21 -EndDate 2017-11-21
This will create a new self signed certificate with the common name "CN=MyCert". During creation you will be asked to provide a password to protect the private key.
.EXAMPLE
.\Create-SelfSignedCertificate.ps1 -CommonName "MyCert" -StartDate 2015-11-21 -EndDate 2017-11-21 -Password "MyPassword"
This will create a new self signed certificate with the common name "CN=MyCert". The password as specified in the Password parameter will be used to protect the private key
@arjunumenon
arjunumenon / Current-Permission-Migration.csv
Last active October 5, 2021 14:24
Script using CLI for Microsoft 365 which reads CSV and add users to the respective groups in a SharePoint site
Username PermissionLevel
adelev@contoso.com Read
alexw@contoso.com Owner
alland@contoso.com Member
christiec@contoso.com Member
@arjunumenon
arjunumenon / monitor-status-readable.ps1
Created January 25, 2021 10:15
This is the script which reads Microsoft 365 tenant status using CLI for Microsoft 365
#Check the Login Status
$LoginStatus = m365 status
if($LoginStatus -Match "Logged out"){
#Exiting the execution
exit;
}
$webURL = "https://aum365.sharepoint.com/sites/M365CLI"
@arjunumenon
arjunumenon / monitor-status-simple.ps1
Last active January 25, 2021 10:25
Blog - O365 Tenant Status - Simple Script
$webURL = "https://aum365.sharepoint.com/sites/M365CLI"
$listName = "O365 Health Status"
$workLoads = m365 tenant status list --query "value[?Status != 'ServiceOperational']" --output json | ConvertFrom-Json
$currentOutageServices = (m365 spo listitem list --webUrl $webURL --title $listName --fields "Title, Workload, Id" --output json).Replace("ID", "_ID") | ConvertFrom-Json
$workLoads | ?{$_.Workload -notin $currentOutageServices.Workload} | %{ $addedWorkLoad = m365 spo listitem add --webUrl $webURL --listTitle $listName --contentType Item --Title $_.WorkloadDisplayName --Workload $_.Workload --FirstIdentifiedDate (Get-Date -Date $_.StatusTime -Format "MM/dd/yyyy HH:mm") --WorkflowJSONData (Out-String -InputObject $_ -Width 100)}
$currentOutageServices | ?{$_.Workload -notin $workLoads.Workload} | %{ $UpdatedWorkflod = m365 spo listitem set --webUrl $webURL --listTitle $listName --contentType Item --id $_.Id --StillinOutage "false" }