Skip to content

Instantly share code, notes, and snippets.

<#
.DESCRIPTION
Sends Task Sequence failure status to Microsoft Teams
.NOTES
Version: 2.0
Author: Amar Rathore
Creation Date: 2019-11-18
#>
<#
PowerShell (New-Object -COMObject Microsoft.SMS.TSEnvironment).Value('OSDStartInfo')=(Get-Date -Format 'dd-MMM-yyyy HH:mm:ss')
$Applist =
'3DViewer',
'FeedbackHub',
'GetHelp',
'GetStarted',
'Maps',
'Messaging',
'MixedReality.Portal',
'OfficeHub',
'OneConnect',
<#
.DESCRIPTION
Parses through the SMSTS log and returns the steps which succeeded, steps which failed, comptuer name, timestamp, and log name.
.PARAMETER Computer
To view a remote machine's logs use this parameter to define the machine name.
.PARAMETER Path
If for some reason the SMSTS log is not located in C:\Windows\CCM\Logs, use this parameter to define the folder path (Accepts UNC Paths)
.NOTES
Version: 1.0
<#
.DESCRIPTION
Uses the Configuration Manager module to add device(s) to collection(s)
.PARAMETER MultiAdd
Use this when adding multiple devices. Device names must be saved in a text file.
.PARAMETER CollectionName
Use this when specifying the Collection Name. If parameter is not specific, you will be prompted with a list of collections from your environment to pick.
.PARAMETER Computer
Use this when sepcifying a single device to add. If paramater is not specific, you will be prompted to enter Computer Name.
.PARAMETER FilePath
&$env:SMS_ADMIN_UI_PATH.Replace('i386','AdminUI.ConsoleBuilder.exe')
Imports System.Threading
Imports Microsoft.Win32
Imports System.IO
Imports System.DirectoryServices
Public Class frmMain
Private infoThread As Thread
Public list As New List(Of String)
Private Sub initialize()