Skip to content

Instantly share code, notes, and snippets.

View crshnbrn66's full-sized avatar

Thom Schumacher crshnbrn66

View GitHub Profile
#------------------------------------------------------------------------
# Source File Information (DO NOT MODIFY)
# Source ID: 9ad32074-7adb-4822-a049-93600f966aa9
# Source File: ..\Documents\SAPIEN\Projects\Gui-SSRS-Deploy\Gui-SSRS-Deploy.psproj
#------------------------------------------------------------------------
#region Project Recovery Data (DO NOT MODIFY)
<#RecoveryData:
CAIAAB+LCAAAAAAABACNkV1rgzAUhu8L/Q/ifepHxU6IuVhdyy72QS27Had6HBkxkUTH/PeLU4dl
MHb5JO95XnJCT1ioD9R9Bi2w9cpx6LNW71i032DxBbXhSrJgE1BvhunuwAXeZyyBchv6u4jsoLyQ
6CYMCfhRQpJt7PtVEscACfWm8DQ6tZz7BplPvSXOciVKW+d4yzYzwYTOCSvUKAt8hBpT13VuOy7K
@crshnbrn66
crshnbrn66 / AzureAlertEmail.psm1
Last active June 13, 2018 13:19
added more functions
function Update-PAzureAlertEmail
{
<#
.SYNOPSIS
This function either adds or removes an email from Alerts in azure
.DESCRIPTION
This function will remove the enclosed email from all the alerts in an azure subscription.
If ADD is specified it will add the email to the all the alerts in an azure subscription.
When this function is called it will return an object of the items that were added or removed.
.EXAMPLE
#requires -version 5.0
using namespace System.IO
using namespace System.IO.Compression
param(
[Parameter(Mandatory=$true)][string]$sourceZip,
[Parameter(Mandatory=$true)][string]$destPath
)
add-type -assemblyname 'System.IO.Compression'
add-type -assemblyname 'System.IO.Compression.FileSystem'
param
(
[String]
[Parameter(Mandatory)]
$SourceFolder,
[String]
$Destination ,
[string]
$AdminUserName,
[string]
<#
.Synopsis
Sets folders specified retention flag to custom flag in Exchange online
.DESCRIPTION
This script is based from the following sources.
https://blogs.msdn.microsoft.com/akashb/2011/08/10/stamping-retention-policy-tag-using-ews-managed-api-1-1-from-powershellexchange-2010/
http://blogs.perficient.com/microsoft/2016/03/office-365-script-to-recreate-managed-folders-functionality/
This script search for and sets all folders found for the retention flag specified. See this blog post for more information:
.PARAMETER TargetMailboxes
@crshnbrn66
crshnbrn66 / backupBuildRelease.ps1
Created February 9, 2017 19:19
Backup TFS 2013 release 3 build and release definitions
function Backup-TFSReleaseDefinitions
{
param([object]$tfsprojs,$tfsurl = 'mytfsinstance.com', $tfscollection = 'Defaultcollection', $apiversion = '3.0-preview',[string]$Path = 'c:\temp\tfsprojects')
$tfsInstance = "http://$($tfsurl):8080/tfs/$tfsCollection"
foreach($tfsproj in $tfsprojs.value)
{
$tfsProjName = $tfsproj.name
$tfsdev = "$tfsInstance/$tfsProjName"
$projectIds = Invoke-RestMethod -Method Get -UseDefaultCredentials -uri "$tfsdev/_apis/release/definitions?api-version=$apiversion" -ContentType application/json
@crshnbrn66
crshnbrn66 / CreateProfile.ps1
Last active March 24, 2017 22:09 — forked from adamdriscoll/CreateProfile.ps1
Create profile
function CreateProfile
{
param([String]$UserSid, [String]$UserName, [system.uint32]$ProfilePath)
Add-Type -TypeDefinition '
using System;
using System.Runtime.InteropServices;
public static class PInvoke {
[DllImport("userenv.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern int CreateProfile( [MarshalAs(UnmanagedType.LPWStr)] String pszUserSid, [MarshalAs(UnmanagedType.LPWStr)] String pszUserName, [Out, MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder pszProfilePath, uint cchProfilePath);
}
@crshnbrn66
crshnbrn66 / user-profile.psm1
Last active May 29, 2025 01:57 — forked from MSAdministrator/Create-NewProfile.ps1
PowerShell functions to create a new user profile
<#
.Synopsis
Rough PS functions to create new user profiles
.DESCRIPTION
Call the Create-NewProfile function directly to create a new profile
.EXAMPLE
Create-NewProfile -Username 'testUser1' -Password 'testUser1'
.NOTES
Created by: Josh Rickard (@MS_dministrator) and Thom Schumacher (@driberif)
#requires -version 5.0
function Get-DataDrivenSubscriptionProperties
{
param([object] $Subscription,
[object]$ssrsproxy)
$ssrsobject = [SSRSObject]::New()
$sid = $Subscription.SubscriptionID
$ddextensionSettings = $ddDataRetrievalPlan = $ddDescription = $ddactive = $ddstatus = $ddeventtype = $ddmatchdata = $ddparameters = $Null
$ddOwner = $ssrsproxy.GetDataDrivenSubscriptionProperties($sid,[ref]$ddextensionSettings,[ref]$ddDataRetrievalPlan`
,[ref]$ddDescription,[ref]$ddactive,[ref]$ddstatus,[ref]$ddeventtype,[ref]$ddmatchdata,[ref]$ddparameters)
$reportExportPath = 'C:\temp\reports'
$reportFiles = Get-ChildItem $reportExportPath -Filter *.xml
foreach($file in $reportFiles)
{
$reportobject = Import-Clixml -path ($file.fullname)
#$extensionsettings = [SSRSProxy.ExtensionSettings]::new()
$extensionSettings = New-Object -typename 'SSRSProxy.ExtensionSettings'
$extensionSettings.Extension = $reportobject.Subscriptions.properties.extensionSettings.Extension
$paramvalues = @()
foreach($parameterField in $reportobject.Subscriptions.properties.extensionSettings.ParameterValues)