PowerShell – Adding Registry Keys for Group Policy

email me

I created this for configuring GP using PowerShell in Intune. Just pass the relative GP reg settings using Add-RegPolicy: Test locally, Upload to Intune > Device configuration > PowerShell scripts, Assign Group.

# MrNetTek
# eddiejackson.net/blog
# 1/2/2020
# free for public use 
# free to claim as your own

Function Add-RegPolicy($hive,$path,$type,$name,$data)
{
    $ErrorActionPreference= 'silentlycontinue'

    $regPath = "$hive`:\$path"
 
    if(-not (Test-Path -path $regPath))
        {
            # Create Path
            New-Item -Path "$regPath" | Out-null
            
        }
            
       # Remove Reg Key
       Remove-ItemProperty -Path $regPath -Name $name -Force | Out-Null
       
       # Add Reg Key
       New-ItemProperty -Path $regPath -Name $name -Value $data -PropertyType $type | Out-Null              
       
       # Required for Binary 
       #$hex = $data.Split(',') | % { "0x$_"}            
       #New-ItemProperty -Path $regPath -Name $name -Value ([byte[]]$hex) -PropertyType $type | Out-Null
 
}

#Reg Hive + Reg Path + Reg Type + Reg Name + Reg Data
Add-RegPolicy -hive "HKLM" -path "SOFTWARE\\_test" -type STRING -name "TEST" -data "DataHere"

* Intune demos coming soon…

 

Notes

Template Code

Add-RegPolicy -hive "HKLM" -path "SOFTWARE\\_test" -type STRING -name "TEST" -data "DataHere"

Add-RegPolicy -hive "HKLM" -path "SOFTWARE\\_test" -type DWORD -name "TEST" -data 0

Add-RegPolicy -hive "HKLM" -path "SOFTWARE\\_test" -type BINARY -name "TEST" -data "a6,d8,ff,00,76,b9,ed,00,42,9c,e3,00,00,78,d7,00,00,5a,9e,00,00,42,75,00,00,26,42,00,f7,63,0c,00"

 

Group Policy Resources

Group Policy Settings Reference Spreadsheet Windows 1809
Group Policy Settings Reference Spreadsheet Windows 1803

Configure ADMX settings with Microsoft Intune Administrative Templates
Understanding ADMX-backed policies
Enable ADMX-backed policies in MDM
Win32 and Desktop Bridge app policy configuration
Ingesting Office ADMX-Backed policies using Microsoft Intune


Example: Enable Remote Desktop Connectivity

Add-RegPolicy -hive "HKLM" -path "SYSTEM\\CurrentControlSet\\Control\\Terminal Server" -type DWORD -name "fDenyTSConnections" -data 0

Add-RegPolicy -hive "HKLM" -path "SYSTEM\\CurrentControlSet\\Control\\Terminal Server" -type DWORD -name "TSUserEnabled" -data 1

Add-RegPolicy -hive "HKLM" -path "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon" -type STRING -name "WinStationsDisabled" -data "0"

 

Notes

New-ItemProperty

Remove-ItemProperty

If condition

Test-Path

New-Item

 

tags: PowerShell registry, PowerShell Binary, PowerShell scripting, PowerShell Group Policy, MrNetTek

VSCode – 1.41.1.0

email me

Description

Something pretty cool to try out, if you haven’t already done so…is Visual Studio Code, or VSCode. VSCode is an IDE developed by Microsoft for Windows, Linux and macOS. It includes support for debugging, embedded Git control and GitHub, syntax highlighting, intelligent code completion, snippets, and code refactoring. It’s a one-stop shop for most of your coding needs. more…


Download Visual Studio Code

https://aka.ms/win32-x64-user-stable  mirror


Version

1.41.1.0


Install Location (603 Folders, 1,353 Files, 254 MB on disk)

%localappdata%\Programs\Microsoft VS Code

view: installed files  more info


Size

56.7 MB


Screenshots

 

Intellisense

 

Notes

VSCode for Mac

Updates in this version

Issues Fixed

VSCode on GitHub

Intro to VSCode for C# Developers (YouTube)

http://mirror.nienbo.com/vscode/

 

Ignite 2019

Visual Studio Code tips and tricks

 

User Guide

 

Top Extensions

https://marketplace.visualstudio.com/items?itemName=ms-python.python

https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools

https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint

https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp

https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome

https://marketplace.visualstudio.com/items?itemName=redhat.java

https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode

https://marketplace.visualstudio.com/items?itemName=vscode-icons-team.vscode-icons

more…

 

tags: VSCode information, VSCode files, MrNetTek

C# – Progress Bar as Thread Wrapper

email me

Wrap a function or silent install using this C# project.

The main form with a button


The progress bar


Download the full project: ProgressBar_Wrapper_1.0.0.1.zip


Form1.cs

* tested in Visual Studio 2019

// MrNetTek
// eddiejackson.net
// 12/23/2019
// free for public use 
// free to claim as your own

using System;
using System.Windows.Forms;
using System.Threading;

namespace ProgressBar
{
    public partial class Form1 : Form
    {
        private bool isProcessRunning = false;

        public Form1()
        {
            InitializeComponent();
        }

        private void Button1_Click(object sender, EventArgs e)
        {
            this.Hide(); // hide initial form

            if (isProcessRunning)
            {
                // MessageBox.Show("Process is running...");
                return;
            }

            ProgressDialog progressBar = new ProgressDialog();            

            // Task 1 background thread
            // add your setup or install EXE in this thread
            Thread bgThread = new Thread(
                new ThreadStart(() =>
                {          
                    isProcessRunning = true;

                    // Progress Bar Control
                    // begin
                    for (int n = 0; n < 20; n++)
                    {
                        // Add your custom code here
                        Thread.Sleep(1000);
                        progressBar.UpdateProgress(n);
                    }

                    for (int n = 21; n < 100; n++) { // Add your custom code here Thread.Sleep(100); progressBar.UpdateProgress(n); } // end Thread.Sleep(500); if (progressBar.InvokeRequired) progressBar.BeginInvoke(new Action(() => progressBar.Close()));

                    isProcessRunning = false;
                                        
                }
            ));

            // Start Process
            bgThread.Start();

            // Start Progress Bar
            progressBar.ShowDialog();

            // add other post thread code here

            this.Close(); // close form            
        }
     
    }
}


ProgressDialog.cs

// MrNetTek
// eddiejackson.net/blog
// 12/23/2019
// free for public use 
// free to claim as your own

using System;
using System.Windows.Forms;

namespace ProgressBar
{
    public partial class ProgressDialog : Form
    {
        public ProgressDialog()
        {
            InitializeComponent();
        }

        public void UpdateProgress(int progress)
        {
            if (progressBar.InvokeRequired)
                progressBar.BeginInvoke(new Action(() => progressBar.Value = progress));
            else
                progressBar.Value = progress;
            
        }

        public void SetIndeterminate(bool isIndeterminate)
        {
            if (progressBar.InvokeRequired)
            {
                progressBar.BeginInvoke(new Action(() =>
                    {
                        if (isIndeterminate)
                            progressBar.Style = ProgressBarStyle.Marquee;
                        else
                            progressBar.Style = ProgressBarStyle.Blocks;
                    }
                ));
            }
            else
            {
                if (isIndeterminate)
                    progressBar.Style = ProgressBarStyle.Marquee;
                else
                    progressBar.Style = ProgressBarStyle.Blocks;
            }
        }
    }
}

 

tags: C# Threads, C# Progress Bar, MrNetTek

C# – Read Text File, Remove Dupes, Write Text File

email me

Text file saved as withDupes.txt:

John 39
John 39
Jack 22
Jack 22
John 39
John 39
Eddie 45
Sara 42
Dalia 30
Sam 31
Amy 19
Amy 19
Eddie 45
Amy 19
Terry 22
Jennifer 27
John 39
John 39

 

Code

* tested in Visual Studio 2019

// MrNetTek
// eddiejackson.net/blog
// 12/22/2019
// free for public use 
// free to claim as your own

using System;
using System.Collections.Generic;
using System.IO;

class RemoveDupes
{
    static void Main(string[] args)
    {
        if (args is null)
        {
            throw new ArgumentNullException(nameof(args));
        }

        using TextReader txtReader = File.OpenText(@"C:\csharp\RemoveDupes\withDupes.txt");
        using TextWriter txtWriter = File.CreateText(@"C:\csharp\RemoveDupes\withoutDupes.txt");
        
        string currLine;

        HashSet<string> prevLines = new HashSet<string>();

        while ((currLine = txtReader.ReadLine()) != null)
        {
            if (prevLines.Add(currLine))
            {
                txtWriter.WriteLine(currLine);
            }
        }

        Console.WriteLine("\nDuplicates have been removed!\n");

        Console.WriteLine("\nPress any key to continue...");
        Console.ReadKey();

    }
}

 

tags: C# Duplicates, C# Dupes, MrNetTek

C# – Sorting Lists: Read Text File, Sort, Write Text File

email me

Text file saved as list.txt (Name and Age):

John 39
Jack 22
Eddie 45
Sara 42
Dalia 30
Sam 31
Terry 22
Amy 19
Jennifer 27

 

Code

* tested in Visual Studio 2019

// MrNetTek
// eddiejackson.net/blog
// 12/22/2019
// free for public use 
// free to claim as your own

using System;
using System.Collections.Generic; //used to setup dictionary
using System.Linq;                // used to perform sort
using System.IO;                  // used to read text file

namespace SortList
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args is null)
            {
                throw new ArgumentNullException(nameof(args));
            }

            string textFile = @"c:\csharp\Sorting\list.txt";

            String[] lines = File.ReadAllLines(textFile);
            Dictionary<String, Int32> Ages = new Dictionary<String, Int32>();

            foreach (String Age in lines)
            {
                String[] split = Age.Split(' '); // delimiter to use from text file

                if (Ages.ContainsKey(split[0]))
                {
                    foreach (KeyValuePair<String, Int32> kvp in Ages)
                    {
                        if (kvp.Key == split[0])
                        {
                            Ages[split[0]] += Convert.ToInt32(split[1]);
                            break;
                        }
                    }
                }
                else
                {
                    if (split.Length > 1)
                        Ages.Add(split[0], Convert.ToInt32(split[1]));
                }
            }

            // SORT DESCENDING AGE
            var sorted1 = (from entry in Ages orderby entry.Value descending select entry);
            // Output
            Console.WriteLine("SORT1: Descending by Age");
            Console.WriteLine("NAME,AGE");
            foreach (KeyValuePair<String, Int32> kvp in sorted1)
                Console.WriteLine("{0},{1}", kvp.Key, kvp.Value);

            Console.WriteLine("\nPress any key to write SORT1 to file...\n");
            Console.ReadKey();

            // Write to file
            File.WriteAllLines(@"C:\csharp\Sorting\descendAge.txt", sorted1.Select(x => x.Key + "," + x.Value).ToArray());


            // SORT ASCENDING AGE
            var sorted2 = (from entry in Ages orderby entry.Value ascending select entry);
            // Output
            Console.WriteLine("\n\nSORT2: Ascending by Age");
            Console.WriteLine("NAME,AGE");
             foreach (KeyValuePair<String, Int32> kvp in sorted2)
                Console.WriteLine("{0},{1}", kvp.Key, kvp.Value);

            Console.WriteLine("\nPress any key to write SORT2 to file...\n");
            Console.ReadKey();

            // Write to file
            File.WriteAllLines(@"C:\csharp\Sorting\ascendAge.txt", sorted2.Select(x => x.Key + "," + x.Value).ToArray());



            // SORT DESCENDING NAME
            var sorted3 = (from entry in Ages orderby entry.Key descending select entry);
            // Output
            Console.WriteLine("\n\nSORT3: Descending by Name");
            Console.WriteLine("NAME,AGE");
             foreach (KeyValuePair<String, Int32> kvp in sorted3)
                Console.WriteLine("{0},{1}", kvp.Key, kvp.Value);

            Console.WriteLine("\nPress any key to write SORT3 to file...\n");
            Console.ReadKey();

            // Write to file
            File.WriteAllLines(@"C:\csharp\Sorting\descendName.txt", sorted3.Select(x => x.Key + "," + x.Value).ToArray());


            // SORT ASCENDING NAME
            var sorted4 = (from entry in Ages orderby entry.Key ascending select entry);
            // Output
            Console.WriteLine("\n\nSORT4: Ascending by Name");
            Console.WriteLine("NAME,AGE");
            foreach (KeyValuePair<String, Int32> kvp in sorted4)
                Console.WriteLine("{0},{1}", kvp.Key, kvp.Value);

            Console.WriteLine("\nPress any key to write SORT4 to file...\n");
            Console.ReadKey();

            // Write to file
            File.WriteAllLines(@"C:\csharp\Sorting\ascendName.txt", sorted4.Select(x => x.Key + "," + x.Value).ToArray());



            // Exit
            Console.WriteLine("\nWritten to file!\n");
            Console.WriteLine("\nPress any key to continue...\n");
            Console.ReadKey();
            Environment.Exit(0);

        }
    }
}

 

tags: C# Loops, C# Read, C# Write, MrNetTek

C# – Read Text File into Array, Return Specific Elements

email me

// MrNetTek
// eddiejackson.net/blog
// 12/20/2019
// free for public use 
// free to claim as your own

using System;
using System.IO;

class TextToArray
{
    public static void Main()
    {
        string path = @"C:\csharp\text\servers.txt";

        // See if file exists, if not exists, create file
        if (!File.Exists(path))

        {
            Console.WriteLine("No server list found!");

            Console.WriteLine("\nPress any key to exit...");
            Console.ReadKey();
            Environment.Exit(1);
        }


        // Read each line
        string[] readList = File.ReadAllLines(path);
        foreach (string server in readList)

        {
            // Output to screen
            Console.WriteLine("{0}",server);
        }

        // Select a couple of array elements to output
        Console.WriteLine("\nElement 1 is: {0}", readList[0]);
        Console.WriteLine("Element 5 is: {0}", readList[4]);

        // Add your own code here        
        

        Console.WriteLine("\nPress any key to exit...");
        Console.ReadKey();
        Environment.Exit(0);
    }
}

C# – Load, Copy, Reverse Elements in Array

email me

// MrNetTek
// eddiejackson.net/blog
// 12/20/2019
// free for public use 
// free to claim as your own

using System;

public class CopyArray
{
    public static void Main()
    {
        int[] array1 = {10,5,20,15,30,15,1,2,3,4};
        int[] array2 = new int[10];
        int i;

        // load elements into array 1
        for (i = 0; i < array1.Length; i++)
        {
            Console.Write("{0} ", array1[i]);            
        }


        // load elements from array 1 into array 2
        Console.WriteLine("\n");
        for (i = 0; i < array1.Length; i++)
        {
            array2[i] = array1[i];
            Console.Write("{0} ", array2[i]);
        }


        // reverse items in array1
        Console.WriteLine("\n");
        
        Array.Reverse(array1);
        for (i = 0; i < array1.Length; i++)
        {
            Console.Write("{0} ", array1[i]);
        }

        
        // load reversed elements from array 1 into array 2
        Console.WriteLine("\n");
        for (i = 0; i < array1.Length; i++)
        {
            array2[i] = array1[i];
            Console.Write("{0} ", array2[i]);
        }


        Console.ReadKey();
    }
}

Google Chrome Browser – 79.0.3945.88

email me

Description

Google Chrome is a cross-platform web browser developed by Google. It was first released in 2008 for Microsoft Windows, and was later ported to Linux, macOS, iOS, and Android. The browser is also the main component of Chrome OS, where it serves as the platform for web apps. more…

 

Download

New Chrome browser is available here:

https://enterprise.google.com/intl/en_version/chrome/chrome-browser/  mirror


Size

58.1 MB


Silent Install

setup.msi /quiet /norestart

or

chocolatey: choco install googlechrome -y


Install Location (10 Folders, 99 Files, 448 MB on disk)

C:\Program Files (x86)\Google\Chrome\Application\79.0.3945.88

view contents: installed files  more info


Silent Uninstall

msiexec /x{3887A4F3-6B98-3B9D-BA15-654AE6C48ABA} /qn /norestart

or

“C:\Program Files (x86)\Google\Chrome\Application\79.0.3945.88\Installer\setup.exe” –uninstall –multi-install –chrome –system-level –force-uninstall

or

chocolatey: choco uninstall googlechrome -y


Registry

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3887A4F3-6B98-3B9D-BA15-654AE6C48ABA}

 

App GUID

{3887A4F3-6B98-3B9D-BA15-654AE6C48ABA}


MSI Property Table


MSI CustomAction Table


MSI InstallExecuteSequence Table

 

Notes

Download Chrome for Mac

Chrome v79 Features

Chrome Platform Status

Chrome Scrubber

 

Mac – Disable Chrome Auto Updates

Method 1

On Mac, you can go to “Users > Your Mac Drive > Library > Google > GoogleSoftwareUpdate” and rename this folder.


Method 2

Open Finder and go to “Applications” folder.

Right click or control + click on the Google Chrome folder and go to “Show Packaged Content”.

Click “Contents” folder and open “Info.plist” file. Remember you need to have editors like Xcode to open plist file. Also you should have write permission for both “Contents” folder and “Info.plist” file to edit.

Look for “KSUpdateURL” key. In our case this is pointing to “https://tools.google.com/service/update2”.

Simply rename the file to something else and save your changes.


Method 3

#!/bin/sh

Version=$(/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version | awk '{print $3}')

sudo rm -rf /Applications/Google\ Chrome.app/Contents/Frameworks/Google\ Chrome\ Framework.framework/Versions/"$Version"/Frameworks/KeystoneRegistration.framework

 

tags: Chrome development, Chrome scripting, Chrome automation, MrNetTek

Slack – 4.3.0

email me

Description

Slack is essentially a chat room for your whole company, designed to replace email as your primary method of communication and sharing. Its workspaces allow you to organize communications by channels for group discussions and allows for private messages to share information, files, and more all in one place. more…


Download

New Slack setup is available here:
https://slack.com/downloads/windows

Admin install here (use this for SCCM and Intune):
http://slack.com/ssb/download-win64-msi-legacy


Size

68.4 MB


Install

setup.exe

or

chocolately: choco install slack


Install Location (51 Folders, 233 Files, 232 MB on disk)

%localappdata%\slack

view contents: installed files


Silent Uninstall

"%localappdata%\slack\Update.exe" --uninstall -s

or

chocolately: choco uninstall slack

 

Registry

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\slack

 

 

Notes

Download Slack for Mac

Slack Blog

Slack Support

Slack News

Deploy Slack via Microsoft Installer

 

Slack 4.3.0

December 16, 2019

Bug Fixes

  • We’ve tinkered with the internal workings and polished some rough edges. The app is now better than it was.

 

tags: Slack silent install, Slack automation, MrNetTek

Intune – Deploy Apple iTunes Package

email me

Deploy Apple iTunes using Intune.

 

Steps

Step 1 – Create C:\intune\iTunes folder.

 

Step 2 – Extract and copy iTunes setup files to the C:\intune\iTunes folder.

 

Step 3 – Create _Intune.cmd in iTunes folder containing the following code:

cd "%~dp0"

msiexec.exe /i "AppleApplicationSupport.msi" /qn /norestart
msiexec.exe /i "AppleApplicationSupport64.msi" /qn /norestart
msiexec.exe /i "AppleMobileDeviceSupport64.msi" /qn /norestart
msiexec.exe /i "Bonjour64.msi" /qn /norestart
msiexec.exe /i "AppleSoftwareUpdate.msi" /qn /norestart
msiexec.exe /i "iTunes64.msi" /qn /norestart IAcceptLicense=Yes ALLUSERS=1 DESKTOP_SHORTCUTS=1 INSTALL_ASUW=0 NO_ASUW=1 SCHEDULE_ASUW=0

::add any other commands here

 

Step 4 – Create iTunes64.intunewin file using the IntuneWinAppUtil.exe tool:

IntuneWinAppUtil.exe -c C:\intune\iTunes -s iTunes64.msi -o C:\intune

Output

Validating parameters
Validated parameters with 12 milliseconds
Compressing the souce folder ‘C:\intune\iTunes’ to ‘C:\Users\Homelab\AppData\Local\Temp\f08c1d40-f0a2-4d74-8a6c-8fc30d136656\IntuneWinPackage\Contents\iTunes64.intunewin’
Calculated size for folder ‘C:\intune\iTunes’ is 292516314 with 0 milliseconds
Compressed folder ‘C:\intune\iTunes’ successfully with 9832 milliseconds
Checking file type
Checked file type with 110 milliseconds
Encrypting file ‘C:\Users\Homelab\AppData\Local\Temp\f08c1d40-f0a2-4d74-8a6c-8fc30d136656\IntuneWinPackage\Contents\iTunes64.intunewin’
‘C:\Users\Homelab\AppData\Local\Temp\f08c1d40-f0a2-4d74-8a6c-8fc30d136656\IntuneWinPackage\Contents\iTunes64.intunewin’ has been encrypted successfully with 795 milliseconds
Computing SHA256 hash for C:\Users\Homelab\AppData\Local\Temp\f08c1d40-f0a2-4d74-8a6c-8fc30d136656\IntuneWinPackage\Contents\f025daec-c6bb-4cf0-9ce2-395354f5474c
Computed SHA256 hash for ‘C:\Users\Homelab\AppData\Local\Temp\f08c1d40-f0a2-4d74-8a6c-8fc30d136656\IntuneWinPackage\Contents\f025daec-c6bb-4cf0-9ce2-395354f5474c’ with 2645 milliseconds
Computing SHA256 hash for C:\Users\Homelab\AppData\Local\Temp\f08c1d40-f0a2-4d74-8a6c-8fc30d136656\IntuneWinPackage\Contents\iTunes64.intunewin
Computed SHA256 hash for C:\Users\Homelab\AppData\Local\Temp\f08c1d40-f0a2-4d74-8a6c-8fc30d136656\IntuneWinPackage\Contents\iTunes64.intunewin with 2727 milliseconds
Copying encrypted file from ‘C:\Users\Homelab\AppData\Local\Temp\f08c1d40-f0a2-4d74-8a6c-8fc30d136656\IntuneWinPackage\Contents\f025daec-c6bb-4cf0-9ce2-395354f5474c’ to ‘C:\Users\Homelab\AppData\Local\Temp\f08c1d40-f0a2-4d74-8a6c-8fc30d136656\IntuneWinPackage\Contents\iTunes64.intunewin’
File ‘C:\Users\Homelab\AppData\Local\Temp\f08c1d40-f0a2-4d74-8a6c-8fc30d136656\IntuneWinPackage\Contents\iTunes64.intunewin’ got updated successfully with 429 milliseconds
Generating detection XML file ‘C:\Users\Homelab\AppData\Local\Temp\f08c1d40-f0a2-4d74-8a6c-8fc30d136656\IntuneWinPackage\Metadata\Detection.xml’
Generated detection XML file with 38 milliseconds
Compressing folder ‘C:\Users\Homelab\AppData\Local\Temp\f08c1d40-f0a2-4d74-8a6c-8fc30d136656\IntuneWinPackage’ to ‘C:\intune\iTunes64.intunewin’
Calculated size for folder ‘C:\Users\Homelab\AppData\Local\Temp\f08c1d40-f0a2-4d74-8a6c-8fc30d136656\IntuneWinPackage’ is 277002583 with 0 milliseconds
Compressed folder ‘C:\Users\Homelab\AppData\Local\Temp\f08c1d40-f0a2-4d74-8a6c-8fc30d136656\IntuneWinPackage’ successfully with 1688 milliseconds
Removing temporary files
Removed temporary files with 27 milliseconds
File ‘C:\intune\iTunes64.intunewin’ has been generated successfully

[=================================================]   100%
Done!!!

 

Step 5 – Azure Portal > Microsoft Intune > Client Apps > Apps > Add > Windows app (Win32)

Navigate to iTunes64.intunewin:

Fill in App information:

Fill in Program Config:
Install: _Intune.cmd
Uninstall: “msiexec /x “{9C96D8AC-EE43-4B47-877C-D11595511C8E}” /q

Fill in basic Requirements:

Fill in Detection Rule Config:
Path: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9C96D8AC-EE43-4B47-877C-D11595511C8E}
Value: DisplayVersion
Method: Version comparison
Operator: Equals
Value: 12.10.3.1
Associated with a 32 bit app: No

 

Step 6 – Click Add button.

 

Step 7 – Assign a group to the application and Save:

 

Step 8 – Force a sync or reboot client computer.

 

Notes

Intune Standalone – Win32 app management

Add a Windows line-of-business app to Microsoft Intune

Microsoft Intune Documentation

 

tags: iTunes Intune automation, Intune packaging, Intune scripting, MrNetTek

PowerShell – v7.0.0 (RC 1)

email me

Description

PowerShell 7 is intended to become the replacement product for PowerShell Core 6.x products, as well as Windows PowerShell 5.1, which is the last supported Windows PowerShell version. PS7, once it’s officially released, will become the best tool in your scripting arsenal. more…


Download PowerShell 7, RC 1

https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.1/PowerShell-7.0.0-rc.1-win-x64.zip   MSI   mirror


PowerShell Command to Download & Install PS7 on Windows

iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -Preview"

 

Installation Location (56 Folders, 986 Files, 225 MB on disk)

C:\Program Files\PowerShell\7-preview

view contents: installed files

 

Access PS7 from Start Menu

 

Check Version

 

List Cmdlets

Get-Command -Type Cmdlet | Sort-Object -Property Noun

view output: cmdlets

 

Notes

https://github.com/PowerShell/PowerShell

PowerShell 7 Release Features

 

Linux Install

wget https://aka.ms/install-powershell.sh; sudo bash install-powershell.sh -preview; rm install-powershell.sh

 

Ignite 2019

PowerShell 7: Q&A on the future of PowerShell

PowerShell unplugged with Jeffrey Snover and Jason Helmick

PowerShell 7 Secrets Management

 

tags: PowerShell 7, RC1, MrNetTek

Intune – Deploy Skype Package

email me

Deploy Skype for Windows using Intune.

 

Steps

Step 1 – Create C:\intune\Skype folder.

 

Step 2 – Copy Skype setup EXE to the C:\intune\Skype folder.

 

Step 3 – Create _Intune.cmd in Skype folder containing the following code:

cd "%~dp0"

taskkill /f /im Skype.exe
timeout /t 2
start "" Skype.exe /VERYSILENT /SP- /NOCANCEL /NORESTART /SUPPRESSMSGBOXES /NOLAUNCH -ms
timeout /t 60 :: pay attention to timing
taskkill /f /im Skype.exe
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Skype_is1" /v DisplayVersion /d "8.55.0.141" /t REG_SZ /f /REG:32

::add any other commands here

 

Step 4 – Create Skype.intunewin file using the IntuneWinAppUtil.exe tool:

IntuneWinAppUtil.exe -c C:\intune\Skype -s Skype.exe -o C:\intune

Output

Validating parameters
Validated parameters with 6 milliseconds
Compressing the souce folder ‘C:\intune\Skype’ to ‘C:\Users\Homelab\AppData\Local\Temp\cc09215e-4506-4877-86f7-7f7efe4c5b29\IntuneWinPackage\Contents\Skype.intunewin’
Calculated size for folder ‘C:\intune\Skype’ is 69802161 with 0 milliseconds
Compressed folder ‘C:\intune\Skype’ successfully with 2301 milliseconds
Checking file type
Checked file type with 5 milliseconds
Encrypting file ‘C:\Users\Homelab\AppData\Local\Temp\cc09215e-4506-4877-86f7-7f7efe4c5b29\IntuneWinPackage\Contents\Skype.intunewin’
‘C:\Users\Homelab\AppData\Local\Temp\cc09215e-4506-4877-86f7-7f7efe4c5b29\IntuneWinPackage\Contents\Skype.intunewin’ has been encrypted successfully with 209 milliseconds
Computing SHA256 hash for C:\Users\Homelab\AppData\Local\Temp\cc09215e-4506-4877-86f7-7f7efe4c5b29\IntuneWinPackage\Contents\ad9e3d7c-7a93-4148-869c-621ad1a849fe
Computed SHA256 hash for ‘C:\Users\Homelab\AppData\Local\Temp\cc09215e-4506-4877-86f7-7f7efe4c5b29\IntuneWinPackage\Contents\ad9e3d7c-7a93-4148-869c-621ad1a849fe’ with 613 milliseconds
Computing SHA256 hash for C:\Users\Homelab\AppData\Local\Temp\cc09215e-4506-4877-86f7-7f7efe4c5b29\IntuneWinPackage\Contents\Skype.intunewin
Computed SHA256 hash for C:\Users\Homelab\AppData\Local\Temp\cc09215e-4506-4877-86f7-7f7efe4c5b29\IntuneWinPackage\Contents\Skype.intunewin with 616 milliseconds
Copying encrypted file from ‘C:\Users\Homelab\AppData\Local\Temp\cc09215e-4506-4877-86f7-7f7efe4c5b29\IntuneWinPackage\Contents\ad9e3d7c-7a93-4148-869c-621ad1a849fe’ to ‘C:\Users\Homelab\AppData\Local\Temp\cc09215e-4506-4877-86f7-7f7efe4c5b29\IntuneWinPackage\Contents\Skype.intunewin’
File ‘C:\Users\Homelab\AppData\Local\Temp\cc09215e-4506-4877-86f7-7f7efe4c5b29\IntuneWinPackage\Contents\Skype.intunewin’ got updated successfully with 84 milliseconds
Generating detection XML file ‘C:\Users\Homelab\AppData\Local\Temp\cc09215e-4506-4877-86f7-7f7efe4c5b29\IntuneWinPackage\Metadata\Detection.xml’
Generated detection XML file with 30 milliseconds
Compressing folder ‘C:\Users\Homelab\AppData\Local\Temp\cc09215e-4506-4877-86f7-7f7efe4c5b29\IntuneWinPackage’ to ‘C:\intune\Skype.intunewin’
Calculated size for folder ‘C:\Users\Homelab\AppData\Local\Temp\cc09215e-4506-4877-86f7-7f7efe4c5b29\IntuneWinPackage’ is 69517434 with 0 milliseconds
Compressed folder ‘C:\Users\Homelab\AppData\Local\Temp\cc09215e-4506-4877-86f7-7f7efe4c5b29\IntuneWinPackage’ successfully with 412 milliseconds
Removing temporary files
Removed temporary files with 8 milliseconds
File ‘C:\intune\Skype.intunewin’ has been generated successfully

[=================================================]   100%
Done!!!

 

Step 5 – Azure Portal > Microsoft Intune > Client Apps > Apps > Add > Windows app (Win32)

Navigate to Skype.intunewin:

Fill in App information:

Fill in Program Config:
Install: _Intune.cmd
Uninstall: “C:\Program Files (x86)\Microsoft\Skype for Desktop\unins000.exe” /SILENT

Fill in basic Requirements:

Fill in Detection Rule Config:
Path: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Skype_is1
Value: DisplayVersion
Method: Version comparison
Operator: Equals
Value: 8.55.0.141
Associated with a 32 bit app: Yes

 

Step 6 – Click Add button.

 

Step 7 – Assign a group to the application and Save:

 

Step 8 – Force a sync or reboot client computer.

 

Notes


Intune Standalone – Win32 app management

Add a Windows line-of-business app to Microsoft Intune

Microsoft Intune Documentation

 

Monitor Setup Process

:WAIT
cls
timeout /t > 1 nul
start /b /wait /LOW c:\windows\system32\TASKLIST.exe /FI “IMAGENAME eq setup.exe” | find /i “setup.exe” && (goto :WAIT)


Custom Publisher

reg add “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Skype_is1” /v Publisher /d “Intune” /t REG_SZ /f /REG:32

 


tags: Skype Intune automation, Intune packaging, Intune scripting, MrNetTek