Skip to content

Instantly share code, notes, and snippets.

View CodyMathis123's full-sized avatar
🦖
Working from home

Cody Mathis CodyMathis123

🦖
Working from home
View GitHub Profile
$appName = 'Office 365 - Visio Volume and Project Volume'
$New365DynamicAppSplat = @{
AppRoot = '\\contoso.com\DFS\CM\Applications\Office365\O365-DynamicInstall'
ProjectLicense = 'Volume'
ApplicationName = $AppName
SMSProvider = 'SCCM'
VisioLicense = 'Volume'
Company = 'Contoso'
Bitness = 'x64'
UpdateChannel = 'Semi-Annual'
#region determine which Requirements we need to add for this deployment type based on ProductIDs
$Requirements = [System.Collections.ArrayList]::new()
switch -Regex ($DT.ProductIDs) {
'^VisioPro(X|2019)Volume$' {
$null = $Requirements.Add($VisPro_Rule)
}
'^VisioStd(X|2019)Volume$' {
$null = $Requirements.Add($VisStandard_Rule)
}
'^VisioProRetail$' {
#region generate PSCustomObject that we will loop through to create DeploymentTypes
$DeploymentTypes = foreach ($XML in $FilteredXML_Configs) {
#region Load XML and manipulate based on input parameters, and gather information
$Config = $XML.Name
$ConfigXML = [xml]::new()
$ConfigXML.PreserveWhitespace = $true
$ConfigXML.Load($XML.FullName)
$ConfigXML.Configuration.AppSettings.Setup.Value = $Company
$ConfigXML.Configuration.Add.OfficeClientEdition = $XML_Bitness
$ConfigXML.Configuration.Add.Version = $FullBuildNumber
#region create global conditions if they don't exist and find OS GC
#region GC Office Product function
function Get-CMOfficeGlobalCondition {
[CmdletBinding()]
param (
[parameter(Mandatory = $true)]
[validateset('Project Professional', 'Project Standard', 'Project', 'Visio Professional', 'Visio Standard', 'Visio')]
[string]$Application
)
$GC_Name = [string]::Format('Condition Detection - Microsoft {0}', $Application)
$RBAC_CollectionQuery = @"
declare @SID varbinary(39), @Token nvarchar(max), @UserID nvarchar(max)
SET @SID = SUSER_SID()
Set @Token = 'S-1-5-21-'
+CAST(CAST(CAST(REVERSE(CONVERT(binary(4),'0x'+sys.fn_varbintohexsubstring(0,@SID,13,4),1)) as varbinary(4)) as bigint) as varchar(10))
+'-'+CAST(CAST(CAST(REVERSE(CONVERT(binary(4),'0x'+sys.fn_varbintohexsubstring(0,@SID,17,4),1)) as varbinary(4)) as bigint) as varchar(10))
+'-'+CAST(CAST(CAST(REVERSE(CONVERT(binary(4),'0x'+sys.fn_varbintohexsubstring(0,@SID,21,4),1)) as varbinary(4)) as bigint) as varchar(10))
+'-'+CAST(CAST(CAST(REVERSE(CONVERT(binary(4),'0x'+sys.fn_varbintohexsubstring(0,@SID,25,4),1)) as varbinary(4)) as bigint) as varchar(10))
set @UserID = dbo.fn_rbac_GetAdminIDsfromUserSIDs(@Token)
Select