Skip to content

Instantly share code, notes, and snippets.

View DWSR's full-sized avatar

Brandon McNama DWSR

  • Ford Motor Company
  • Toronto, Ontario, Canada
View GitHub Profile
function Import-GoogleToEXOGroup {
<#
.SYNOPSIS
Import CSV of Google Groups into Office 365 as Distribution Groups
.DESCRIPTION
Import CSV of Google Groups into Office 365 as Distribution Groups
.PARAMETER Group
# Get the ID and security principal of the current user account
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID)
# Get the security principal for the Administrator role
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator
# Check to see if we are currently running "as Administrator"
if ($myWindowsPrincipal.IsInRole($adminRole))
{
# Get the ID and security principal of the current user account
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID)
# Get the security principal for the Administrator role
function Get-LAFolderSize {
Param(
[Parameter(
Mandatory = $true,
ValueFromPipelineByPropertyName = $true,
ValueFromPipeline = $true
)]
[String]$upn
)
Begin {
$SSO=get-content '.\Take out list (jay).txt'
$csv=import-csv .\MobileIron_Report_May_9_2017.csv
$CSV | ?{$SSO -contains $CSV."User ID"}
#Sample excel db
User ID Display Name
200000058 Monfiglio, Carlos (SSGA, Non-GE)
200000385 Golden, Hugh (SSGA, Non-GE)
#Sample SSO txt
function Check-EmailAddress {
[CmdletBinding()]
[OutputType([Boolean])]
Param(
[Parameter(Mandatory = $true,Position = 0)
[String]$EmailAddress
)
Begin {
#nothing
}
$jsonObject = @{
TERMID = 3232
PINSERV = '192.168.1.52:5145'
MERCHANTID = 01
ID = 1421336011
Serv = '192.168.1.180:5150'
Lane = 2017
} | ConvertTo-Json
$TestDir = 'path/filename.xml';
$jsonObject = @{
TERMID = 3232
PINSERV = '192.168.1.52:5145'
MERCHANTID = 01
ID = 1421336011
Serv = '192.168.1.180:5150'
Lane = 2017
} | ConvertTo-Json
@DWSR
DWSR / Invoke-Webrequest.ps1
Last active November 13, 2015 16:25 — forked from riahc3/Invoke-Webrequest.ps1
Invoke-Webrequest
# establish initial connection to website
$initialRequest = Invoke-WebRequest -Uri 'http://192.168.100.97/csl/login' -SessionVariable WebSession1
#$initialrequest is now an object containing the html of the web request. get the form elements from the page
$form = $initialRequest.Forms[0] #outputting $form.fields to the screen will show you all the elements. Assuming 'username' and 'password'...
# update $form with username and password info and submit this back to the login webpage as POST
$form.fields.userpwd = "PASS"
$form.fields.username = "USER"
@DWSR
DWSR / VIobject
Last active November 6, 2015 13:59 — forked from biacz/.ps1
i am interested in $_.summary.config.NumCPU and $_.summary.config.MemorySizeMB
----------
Capability : VMware.Vim.VirtualMachineCapability
Config : VMware.Vim.VirtualMachineConfigInfo
Layout : VMware.Vim.VirtualMachineFileLayout
LayoutEx : VMware.Vim.VirtualMachineFileLayoutEx
Storage : VMware.Vim.VirtualMachineStorageInfo
EnvironmentBrowser : EnvironmentBrowser-envbrowser-1905