Posts

Showing posts from January, 2020

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 ...

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 ) $...