Skip to content

Instantly share code, notes, and snippets.

@appliedi
appliedi / DirectBillingToCSP.ps1
Created August 2, 2022 19:57 — forked from win2000b/DirectBillingToCSP.ps1
Analyse Azure Resources Migration from Direct Billing to CSP
# First of all we are assuming we have delegated rights through CSP
# If we dont have delegated rights we need a login with reader rights in the customers subscription
# We then need 2 things. The Tenant ID of where the source subscription is located
# Then we need the subscription ID for the source subscription.
# If a customer has multiple subscriptions we will need the IDs for each and the script should be run for each.
# If you need to install Azure Module
Install-Module AzureRM
# Define these 2 variables.
@appliedi
appliedi / GetLibraryID.ps1
Created August 2, 2022 19:56 — forked from win2000b/GetLibraryID.ps1
Get Library ID from SharePoint Document Library for Sync
# Optional, To get your tenant ID via PowerShell
Connect-msolservice
Get-MSOLCompanyInformation | select objectID
# Install SharePoint PowerShell If needed
Install-Module SharePointPnPPowerShellOnline
# Example https://$tenant.sharepoint.com/sites/$siteName
$tenant = 'Enter your Tenant Name in Here' # xxxx.onmicrosoft.com
$tenantId = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' #Tenant ID, can be retrieved from Azure AD or PowerShell under optional.
@appliedi
appliedi / Geo_IP_Audit_O365.ps1
Created June 15, 2021 11:49 — forked from glides/Geo_IP_Audit_O365.ps1
Find all out of country logins Office 365 Unified Audit Log
########## Connect to o365 ##########
## Change $username and $pass to match your environment
## See: https://blogs.technet.microsoft.com/robcost/2008/05/01/powershell-tip-storing-and-using-password-credentials/ for how to create a cred file.
$username = "Admin@tenant.onmicrosoft.com"
$pass = gc "F:\PSScripts\Office365-PowershellCreds.txt" | convertto-securestring
$creds = New-Object -typename System.Management.Automation.PSCredential `
-argumentlist $username, $pass
$MESession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Creds -Authentication Basic -AllowRedirection
Import-PSSession $MESession -AllowClobber
Connect-MsolService -Credential $creds
@appliedi
appliedi / cf-hubspot.php
Created March 9, 2017 15:44 — forked from rothschild86/cf-hubspot.php
Caldera Forms to HubSpot CRM integration
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//required plugins: code snippets, caldera forms, caldera forms run action
add_action('consult_req_submitted', 'consult_req_submitted_sync_hubspot');
function consult_req_submitted_sync_hubspot( $data ){
$hubspot_api_key = 'ffffffff-27a0-4591-9b68-27d4bb31ed76';
$hubspot_list_id = '1'; //optional
@appliedi
appliedi / gist:0e9ac2438287fe6b6b61c976e26c4280
Created April 12, 2016 14:00
The Script executed and output
## This was executed to create the mof and the checksum
$guid=Get-DscLocalConfigurationManager -CimSession asrtest-sql01 | Select-Object -ExpandProperty ConfigurationID
# Specify source folder of configuration
$source = "C:\DSC\HTTP\backup.mof"
# Destination is the Share on the SMB pull server
$dest = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration\$guid.mof"
Copy-Item -Path $source -Destination $dest
configuration SMTP {
Node HTTPComputers {
WindowsFeature SMTP{
Name = 'SMTP-Server'
Ensure = 'Present'
}
}
}
@appliedi
appliedi / gist:1f49c3924d7913cd83dcbb67add98b41
Created April 12, 2016 13:51
HTTP Pull Server Configuration
[DSCLocalConfigurationManager()]
Configuration LCM_HTTPPULL
{
param
(
[Parameter(Mandatory=$true)]
[string[]]$ComputerName,
[Parameter(Mandatory=$true)]
[string]$guid
[DSCLocalConfigurationManager()]
Configuration LCM_HTTPPULL
{
param
(
[Parameter(Mandatory=$true)]
[string[]]$ComputerName,
[Parameter(Mandatory=$true)]
[string]$guid