Latest Posts
📅 2025-01-05
✍️ Bart Schelstraete
Below is an example script which adds a Windows domain group to each database, with the db_reader role. DECLARE @DBName NVARCHAR(255); DECLARE @SQL NVARCHAR(MAX); DECLARE @GroupName NVARCHAR(255) =…
Read more →
📅 2024-03-08
✍️ Bart Schelstraete
You may use the T-SQL code below to find the last logon dates for the SQL accounts. use master; set nocount on -- find users, last logon time, and disabled state declare @users_login_time table (…
Read more →
📅 2024-03-08
✍️ Bart Schelstraete
The T-SQL query below will list the users configured within the database, and the permissions which these users have. SELECT [UserType] = CASE princ.[type] WHEN 'S' THEN 'SQL User' WHEN 'U' THEN…
Read more →
📅 2023-11-06
✍️ Bart Schelstraete
The PowerShell script below logs off a disconnected session if the session has been idle for XX minutes, and it also excludes specific users. Additionally, the script writes a log file that includes…
Read more →
📅 2023-10-26
✍️ Bart Schelstraete
You can use the script below to download a file from a certain location to a temporary file, do a small check, and then copy it to a location. It also sends an email with some feedback. # Define…
Read more →
📅 2023-09-20
✍️ Bart Schelstraete
Below is example code which you can use to add users from a local CSV file (with their UPN) to an Active Directory group. # Start transcript Start-Transcript -Path C:\Temp\Add-ADUsers.log -Append #…
Read more →
📅 2023-08-21
✍️ Bart Schelstraete
Below is a high-level approach on how you might achieve this using PowerShell and the Azure CLI: Install Azure PowerShell: If you haven't already, install the Azure PowerShell module on your machine.…
Read more →
📅 2023-08-21
✍️ Bart Schelstraete
Use the PowerShell command below to get the list of processes on a remote Windows computer, sorted by CPU usage. $remoteComputerName = "rdwevw25" $session = New-PSSession -ComputerName…
Read more →
📅 2023-02-18
✍️ Bart Schelstraete
Yes, Hogwarts Legacy runs great on your little buddy, the Steam Deck! But of course, it's never perfect. Are you looking for some performance improvements? You can try adding the options below. Open…
Read more →
📅 2023-02-17
✍️ Bart Schelstraete
To identify the queries that are responsible for high CPU activity currently, run the following statement: SELECT TOP 10 s.session_id, r.status, r.cpu_time, r.logical_reads, r.reads, r.writes,…
Read more →