Skip to content

Instantly share code, notes, and snippets.

View neerajks77's full-sized avatar

Neeraj Kumar neerajks77

View GitHub Profile
@neerajks77
neerajks77 / ConfigureEdgeDevice.ps1
Last active May 1, 2021 04:40
This script deploys, installs, and configures the IoT Edge Runtime on the Windows device to configure the device as an edge device to which other leaf devices can connect
#Uninstall the IoT Edge module from the Windows device
. {Invoke-WebRequest -useb https://aka.ms/iotedge-win} | Invoke-Expression; Uninstall-IoTEdge -Force
#Deploy the IoT Edge Runtime module to the Windows device
. {Invoke-WebRequest -useb https://aka.ms/iotedge-win} | Invoke-Expression; Deploy-IoTEdge -ContainerOs Windows
# Define Variables for the configuration of the edge device using DPS with X509 Certificates
# Note that only .cert and .pem extensions are supported
# The names of the certificates mentioned here are the one's created using the microsoft provided scipt on github.
# The link to the github repossitory is https://github.com/Azure/iotedge/tree/master/tools/CACertificates
$X509IdentityChainCertPath = "<path to the device identity chain cert>\certs\iot-edge-device-identity-<name>-full-chain.cert.pem"
@neerajks77
neerajks77 / ipsecurityarmtemplate.json
Created January 15, 2021 04:12 — forked from cmatskas/ipsecurityarmtemplate.json
IP Security ARM Template
{
"apiVersion": "2015-08-01",
"name": "[variables('webSiteName')]",
"type": "Microsoft.Web/sites",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]":"Resource",
"displayName": "Website"
},
"dependsOn": [
Configuration WebServer
{
param(
[Parameter(Mandatory=$true)]
[string] $NodeNames = "localhost",
[string] $AcctKey = "4PJREBT6kPMh9ejQwIhoU+vmOWdd7WYCVIhDEbttPPZVln8HerqOCQR+PTXlSMd0AZd4tVdRPIy/TEfos4aU9Q=="
)
Import-DscResource -ModuleName PsDesiredStateConfiguration
@neerajks77
neerajks77 / CreateVirtualMachineActionRunbook.ps1
Last active July 17, 2022 11:20
This PowerShell script creates virtual machine(s) based on the inputs from the excel file uploaded to the storage account and is invoked by a watcher runbook
param([string[]] $vmdetail)
#Fetch the automation service principal credentials
$global:spCred = Get-AutomationPSCredential -Name 'Creds'
#Fetch tenantID from Automation variables
$global:tenantid = Get-AutomationVariable -Name 'TenantID'
#Fetch tenantID from Automation variables
$global:vnet = Get-AutomationVariable -Name 'vNet'
@neerajks77
neerajks77 / ProcessEmailCreationRequest.ps1
Last active October 8, 2022 05:20
This PowerShell Runbook script is used to provision Email accounts in Exchange Online and it also creates the user in azure Active Directory. It will also check if the request for new email is for the correct domain and the email already exists or not and accordingly populates the variables, which can be used to log errors. This script depends o…
###############################################
#Author:Neeraj Kumar
#Description:This script intakes the parameters for email creation and processes the request. It also created a user in Azure AD
#Date: 03/10/2022
###############################################
param(
[Parameter(Mandatory=$true)]
[string] $EmailIDtobeProvisioned,
@neerajks77
neerajks77 / CreateTeams.ps1
Last active April 7, 2023 03:07
Create Microsoft Teams with default channel, add owner, and users
param(
[Parameter(Mandatory=$false)]
[string] $TeamName = 'Test Team',
[Parameter(Mandatory=$false)]
[string] $TeamDescription = 'New MS Team',
[Parameter(Mandatory=$false)]
[string] $Visibility = 'Private',
@neerajks77
neerajks77 / CreateSharedMailbox.ps1
Last active April 15, 2023 04:55
This script intakes the parameters from incoming ServiceNow Requests for Shared email creation and processes the request. Finally, it updates the serice request in ServiceNow
###############################################
#Author:Neeraj Kumar
#Description:This script intakes the parameters from incoming ServiceNow Requests for Shared email creation and processes the request. Finally, it updates the serice request in ServiceNow
#Date: 03/10/2022
###############################################
param(
[Parameter(Mandatory=$true)]
[string] $Source,
@neerajks77
neerajks77 / SetMailboxQuota.ps1
Last active September 8, 2023 08:20
This script intakes the parameters from incoming ServiceNow Requests for setting the email size limit
###############################################
#Author:Neeraj Kumar
#Description:This script intakes the parameters from incoming ServiceNow Requests for setting the email size limit
#Date: 01/19/2023
####. ###########################################
param(
[Parameter(Mandatory=$true)]
[string] $ServiceRequestNumber,
@neerajks77
neerajks77 / updated-function-calling.ipynb
Created September 22, 2023 14:10
Updated Function Calling.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
###############################################
#Author:Neeraj Kumar
#Description:This script intakes the parameters from incoming ServiceNow Requests for setting the email size limit
#Date: 09/21/2023
####. ###########################################
param(
[parameter (mandatory = $false)]
[object] $WebhookData
)