Skip to content

Instantly share code, notes, and snippets.

View Zerg00s's full-sized avatar
🏠
Working from home

Denis Molodtsov Zerg00s

🏠
Working from home
View GitHub Profile
@Zerg00s
Zerg00s / Example 2.jpg
Last active November 13, 2021 22:09
Stylebot for Stack Exchange trolls
Example 2.jpg
@Zerg00s
Zerg00s / CreateUserProfileProperties_IE_Macros.ps1
Created October 30, 2021 13:53
Deploy SharePoint User Profiles Using PowerShell and Internet Explorer
# ===========================================================#
# Internet explorer Macros
# For creating a bunch of user properties in bulk
# using Internet Explorer COM
# ----
# User_Profile_Properties.csv defines properties to be
# created.
# ===========================================================#
#------------------------------------------------------------#
@Zerg00s
Zerg00s / Export-SPList.ps1
Last active August 29, 2021 20:31
PnP.PowerShell - Export List to CSV
Install-Module -Name PnP.PowerShell -Force -Scope CurrentUser
Connect-PnPOnline https://drps.sharepoint.com -UseWebLogin
$ListTitle = 'News Room'
$list = Get-PnPList $ListTitle -Includes Fields
$items = Get-PnPListItem -List $list -PageSize 100
$fields = $list.Fields | Where-Object {
(
$_.InternalName -eq "ID" -or
$_.InternalName -eq "Created" -or
@Zerg00s
Zerg00s / Populate-tasks-list.ps1
Created June 5, 2021 00:20
Populate SharePoint Online Tasks list
# ===============================================
# Populate Tasks list
# ===============================================
$list = Get-PnPList TasksList
$users = Get-PnPUser
$users = $users | Where-Object {$_.Email -ne ""}
$Statuses = @("Not Started","In Progress","Completed","Deferred","Waiting on someone else")
$now = Get-date
$Priorities = @( "(1) High","(2) Normal","(3) Low")
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/ClassicTeam -UseWebLogin
@Zerg00s
Zerg00s / Drag-Drop-CSV-to-Batch.bat
Last active December 16, 2021 23:35
Run PowerShell from Batch by dragging and dropping files
@ECHO OFF
SETLOCAL
cls
@TITLE COVID-19 Test Import
IF "%1"=="" GOTO GETINPUT
REM %~dp0 will expand to "the drive letter and path and folder in which this batch file is located"
REM Example of %~dp0 - "C:\Storage\Current Folder\"
IF EXIST "%~dp0\%1" Set InputFile="%~dp0\%1"
@Zerg00s
Zerg00s / Authenticate.ps1
Created April 8, 2021 22:24
Authenticate against SPO with login and password
$cookieValue = .\Authspo.ps1 https://cleverpointdev.sharepoint.com/Sites/PerformanceManagementDev -username 'admin@CleverPointDev.onmicrosoft.com' -password 'SECRET_PASSWORD'
$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession
$cookie = New-Object System.Net.Cookie
$cookie.Name = "SPOIDCRL"
$cookie.Value = $cookieValue
$cookie.Domain = "cleverpointdev.sharepoint.com"
$session.Cookies.Add($cookie);
@Zerg00s
Zerg00s / gist:e066f8b4a51c4913d4587277798791a8
Created January 5, 2021 19:29
OOB Workflow 2010 upgrade efforts
Publishing approval 2
Collect feedback - 2010 2.5
Collect feedback 2.5
Collect signatures - 2010 3
Collect signatures 3
Approval - 2010 2
Translation management 4
Three state 2.5
Approval 2
Disposition approval 2.5
@Zerg00s
Zerg00s / gist:b7c0f8a6d0c2eadcdad514c1a980947d
Created January 5, 2021 19:01
Workflow 2010 Actions Upgrade efforts
EmailActivity 15 min
CollectDataTask 36 min
TodoItemTask 0.25 - 15 min
GroupAssignedTask 30 min
SetFieldActivity 10 min
UpdateItemActivity 15 min
CreateItemActivity 12 min
CopyItemActivity 15 min
CheckOutItemActivity 10 min
CheckInItemActivity 10 min
@Zerg00s
Zerg00s / Crawl-Sites.ps1
Last active June 21, 2020 16:22
Crawl Private SharePoint.COM sites
$sites = @("IT","HR","FINANCE","ACCOUNTING","PR", 'PM',"B2B","B2C", "MARKETING","OPERATIONS", "LEGAL", "MICROSOFT", "TRAINING", "BD", "SALES", "EXPORT",
"Administration", "Admin", "Production", "Logistics", "Security", "Support", 'Staff', "Branding", 'Production', 'Purchasing',
"RnD", "Network", "Planning", "Dispatch", "Demo", 'Learning', "Education", "Communication", 'Communications', "distribution",
"Management")
$tenantUrl = "https://microsoft.sharepoint.com"
$ManagedPath = "/sites/"
# $ManagedPath = "/teams/"
@Zerg00s
Zerg00s / git logline
Created June 20, 2020 17:55
git logline pretty print
git config --global alias.logline "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
$ git logline