As mentioned in the previous blog post I was invited to speak at iSense to talk about PowerShell and Security. This event was fully by sponsored by iSense who provided the attendees with a great experience. Before my session I was briefly interviewed and the interview, in Dutch, will be available soon.
Security is a topic that continues to make headlines around the world and as a result, PowerShell is mentioned more often either as an method to exploit or to prevent and secure your system. In this presentation I showed how PowerShell can be configured to provide insights in what scripts and tools are running in your environment and how to secure your PowerShell endpoints using Just Enough Administration, JEA.
The audience after 90 minutes of PowerShell and Security
After the presentation I received a lot of questions about PowerShell in general and the Dutch PowerShell User Group, we will soon be holding another PowerShell User Group meeting, for more information visit the following link: 10th DuPSUG Meeting, there are at the time of writing still a few tickets available for this event on the 9th of March.
Furthermore, at the Dutch PowerShell User Group we are working on putting out some events that are a bit more beginner oriented. For anyone who is interested in learning more about PowerShell stay tuned as we have a lot of good interesting stuff in the works.
Recently I was invited by iSense to come and speak at one of their technical evenings. On the 16th of February I will be speaking on PowerShell and Security. To quote a short excerpt from the iSense website:
“This demo-rich session goes into detail on some best practices on securing PowerShell and highlights and the steps that have been taken in PowerShell 5.0 that allow you to do so. In the first section of this evening we will touch some of the basic concepts of security that we have available to us in PowerShell. Then Jaap will go into detail how you can correctly implement them by demoing the functionality.”
Recently the Storage Sense functionality has been added to Windows. Unfortunately there are no PowerShell commands available to manage this so I decided to write this function to be able to manage the different settings that are available in regards to Storage Sense.
There are a number of settings that can be configured in the Settings > Storage > Storage sense, settings menu. The settings that can be configured are as follows:
By clicking: Change how we free up space, the following options become available:
So in order to configure this using PowerShell I have created the Set-StorageSense function with the following parameters:
So if you would like to disable this functionality and not have Windows automatically clear out temporarily and otherwise obsolete files you can run the following command:
Alternatively the other options can also be configured, the following command Enables Storage Sense and configures all cleanup options to true while displaying verbose output:
This would of course not be complete without being able to query this data as well, which is possible using the Get-StorageSense function:
Although I looked into manually triggering the Clean Up job, this is something that did not seem possible, I used Sysinternals Procmon to determine which command is associated with that. But even when running this as the System account it did not appear to clean anything. I will provide the execution in case it is of value for anyone else:
On the 23rd of January I had the opportunity to speak at the MS Cloud Summit Paris pre-conference. Together with the dbatools / dbareports legends, Chrissy LeMaire and Rob Sewell we covered an entire day of PowerShell, Azure and SQL Server. The event itself has been really great and well organized, so I would like to thank the organization for putting together such a fantastic event for the European technical community!
As always I have made the code and slides available on GitHub, so if you are interested in the content that I delivered have a look over here:
On the 23rd of January, I will be presenting, together with Chrissy Lemaire and Rob Sewell, at the MS Cloud Summit in Paris. Together we will be taking you through the basics of PowerShell Automation, Azure and SQL Server. Rob and Chrissy will be showcasing the capabilities of the DbaTools PowerShell module.
The MS Cloud Summit Paris is a sold-out community event with over 600 attendees and speakers from all over the world. Here is a short summary of the event:
1 day pre-conference workshops
2 days of conference
600 attendees expected
6 tracks – 60 sessions
Microsoft Cloud technologies (Azure, Office 365, Data Platform)
Microsoft Hybrid technologies (SQL Server, SharePoint, etc.)
Valuable international and french speakers
There are currently only tickets available for the pre-conference sessions, so if you did not decide yet there is still a change to join us there.
Working with Bash on Windows, I can say that it significantly simplified the way I can work cross-platform. It has allowed me to use native Linux tools, when working with Linux systems, which is a big step up from using a mix of compiled for Windows Unix tools and GUI applications. Because of this unique functionality Windows 10 has a big lead over any other platform as my day-to-day platform.
For example it is possible to add a new Windows users account directly by using the net.exe tools:
net.exe user /add testaccount
net.exe user /add testaccount
Alternatively it is also possible to start Windows PowerShell in Bash to execute a command, for example it becomes possible to use PowerShell to determine which processes are running in the Windows environment and the ps command to determine what is running in Linux:
For me the greatest advantage is the fact that Windows executable files can also be directly called from bash, simplifying the interaction between the different OSes. An example of this is opening explorer in your current working folder in the bash terminal:
When a path is not accessible for the Windows application, for example anywhere in the Unix file system, a proper error message will be displayed:
Using this same method it is also possible to add the path to your favorite script editor to the Bash on Windows path allowing them to be directly called from the console. In the following example I will show how to open VSCode directly from Bash:
exportPATH=$PATH:/mnt/c/Program\ Files\ \(x86\)/Microsoft\ VS\ Code/
export PATH=$PATH:/mnt/c/Program\ Files\ \(x86\)/Microsoft\ VS\ Code/
As discussed in the previous post on configuring Lunar Calenders in Windows 10, another interesting feature was also introduced in the 15002 Windows 10 Build: Blue Light Settings. Recently more operating systems have included options for reducing the amount of blue light emitted after sundown. This is easier on your eyes and allows you to fall asleep better at night time.
There are a number of settings that can be configured in the Settings > Display > Blue light settings, settings menu. The settings that can be configured are as follows:
Because automation is a great thing and manually clicking through GUI interfaces is not always optimal I decided to write a PowerShell function to simplify the configuration. For example you could utilize this function to automatically disable the reduced blue light settings when color sensitive work is performed, or lower the amount of blue light emitted as the night progresses. These are some of the actions that the Set-BlueLight function can perform.
To instantly turn of the reduced blue light setting the following code can be run:
To enable the reduced color mode and set the color shift to Medium run the following code:
To automatically reduce blue light emitted based on the Day and Night cycle in your geographical location execute this:
The values that are configured by the script are byte arrays in the registry, so it required a bit of reverse engineering to get the values to match the settings in the control panel. The function is currently available on GitHub in my Shared Scripts repository: Set-BlueLight
This function will be added to the CustomizeWindows10 module after I have developed my functional and unit tests to ensure the quality of this function.
For more information about the functions and modules discussed in this article, please refer to the following links: