Posts

Get-WinVer

#Created by Michael J. Thomas #Last Updated 8/12/2022   Function Get-WinVer { Param ( $ComputerName ) $WinVer = (get-wmiobject win32_operatingsystem -ComputerName $ComputerName).Version #Threshold 1 10240 #Threshold 2 10586 #Redstone 1 14393 #Redstone 2 15063 #Redstone 3 16299[h] #Redstone 4 17134 #Redstone 5 17763 #19H1 18362 #19H2 18363 #20H1 19041 #20H2 19042 #21H1 19043 #21H2 19044 #22H2   19045 Switch ($WinVer){ "10.0.10240"{"Windows 10 Threshold 1"} "10.0.10586"{"Windows 10 Threshold 2"} "10.0.14393"{"Windows 10 Redstone 1"} "10.0.15063"{"Windows 10 Redstone 2"} "10.0.16299"{"Windows 10 Redstone 3"} "10.0.17134"{"Windows 10 Redstone 4"} "10.0.17763"{"Windows 10 Redstone 5"} "10.0.18362"{"Windows 10 19H1"} "10.0.18363"{"Windows 10 19H2"} "10.0.19041"{"Windows 10 20H1&

Set-EmailSizeLimit

Image
  Set-EmailSizeLimit Fix Outlook OST/PST Max Size Limit with PowerShell By Michael J. Thomas I decided to look into some of my projects I did in the past and post some of them here. I created this project when I saw mailboxes that were really large in size like over 50 Gb which were freezing up the outlook mailbox on the local system and users were not able to send out their email.  The server had plenty of space with Office 365 but there were no group policies in place at the time that allowed the systems to have even larger OTS/PST files on the local system.  I created a local solution to fix these right away. One is a program that I made with PowerShell Studio that you can copy to the computer and set the size. The other solution is a PowerShell script that allows you to set the permissions to a remote computer and user. Check them both out and let me know what you think. Hopefully, you will find this to be a handy tool. Enjoy! GUI for Fix Outlook OST/PST Max Size Limit Project Down

Start-Website

Image
  Start-Website Start a website with which ever browser you want it to start with PowerShell By Michael J. Thomas The other day I had built a function that could start a website with which ever browser I decided I wanted it to open with. This comes in handy when testing websites that you build or just with opening sites that are better compatible with one browser over the other. Here is this cool function.  Download Code from GitHub <# .Synopsis    Start-Website with a browser selection option.  .DESCRIPTION    Start-Website function is used to select which web browser you want to open a website with.  .EXAMPLE    Start-Website -Site PowerShellWeekly.com -Browser Edge .EXAMPLE    Start-Website PowerShellWeekly.com Edge     Start-Website ProgrammingEveryDay.com Edge     .EXAMPLE    Start-Website -Site ThomasITServices.com -Browser Chrome .EXAMPLE   Start-Website -Site https://www.affauto.com -Browser IE #> function Start-Website { [CmdletBinding()] param ( [String]$Site, [Validate

Install Admin Pack on Remote Computer

Image
  Install-AdminPack Enable Admin Pack on Remote Computer with PowerShell By Michael J. Thomas There are many ways to get the job done but here is a solution to installing admin pack on a remote computer.  You may have other members of your IT team that need to have this installed on their computer but you don't want to get up and go to their computer. That is the magic of PowerShell Remote Administration.    $ComputerName = "RemoteComputer" Enter-PSSession -ComputerName $ComputerName #If there is a Group Policy blocking Windows Update then do this: Set-ItemProperty -Name "UseWUServer" -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Value "0x00000000" -Type Dword  Restart-Service wuauserv Start-Sleep 2 #Register a Job to run this task for Installing Active Directory Tools $Name='Capability' Register-ScheduledJob -Name $name -ScriptBlock {Add-WindowsCapability -Online -Name "Rsat.ActiveDirectory.DS-LDS.Tools~~~~

Add-RemoteDesktopUsers

Image
Add-RemoteDesktopUsers Add Remote Desktop Users to a Remote Computer with PowerShell By Michael J. Thomas If you are getting tired of adding users to remote computers the manual way for users to have RDP access to their computers. Then the following solution with our PowerShell automation will be a sigh of relief  from your manual labors.  Manual Process:  Open Computer Management  Click Action Menu  Click Connect to Another Computer Type Computer Name "Computer1" Click OK  Expand Down Local Users and Groups  Select Groups  Double Click Remote Desktop Users Group Click Add  Type the User Name "User1" Click OK Click OK again.  Automated Process with PowerShell: Open PowerShell Script and Run Type: Add-RemoteDesktopUsers -ComputerName "Computer1" -UserName -"User1"  <# .Synopsis    Add-RemoteDesktopUsers    Author: Michael J. Thomas    Updated: 01/16/2020 .DESCRIPTION    Add Users to Remote Desktop User

How to use ValidateSet with Switch Statement

Image
How to use ValidateSet with Switch Statement By Michael J. Thomas Use validateset with a switch statement to put together more complex tasks. In the example below I use voicemail messages received from parents in which you can gather the information and then send out notifications to the teachers of the student status by copying the information to the clipboard and being able to paste it in the desired method of communication.  I did not include other code to show how to email this information or send it in another manner. I wanted to keep this simple to understand how to use a validateset with a switch statement in order to take advantage of implementing complex tasks with your functions. You can use this information and put together an on-boarding process for provisioning accounts and user roles. function New-Voicemail { param( [string]$Name, [ValidateSet(6,7,8)]$Grade, [ValidateSet("Tarde","Early","Absence")]$Reason ) $

Mike's Profile Cleanup Tool

Image
Mike's Profile Cleanup Tool This excludes by default the system profile that is listed under special, the default user that is executing this program script. This PowerShell Script pulls a list of user profiles that you can select which ones you want to exclude and then clean the profiles. This tool is useful for those computers that have old profiles on it and the users no longer need them.  #Created by Michael J. Thomas #Created on 12/27/2019 #Updated on 12/28/2019 # Use at your own risk. We are not responsible for any lost of data. # Thomas IT Services. All Rights Reserved. (c) 2019-2020 $ErrorActionPreference = 0 Add-Type -AssemblyName System.Windows.Forms [System.Windows.Forms.Application]::EnableVisualStyles() $Form = New-Object system.Windows.Forms.Form $Form.ClientSize = '446,256' $Form.text = "Mike'`s Profile Cleaner Tool - PowerShellWeekly.com" $Form.TopMost = $true $Form.StartPosition = "CenterScreen" $Form.FormBorderSt