Showing results for Regular Expressions - Scripting Blog [archived]

Aug 27, 2019
0
0

Automating Quser through PowerShell

Doctor Scripto
Doctor Scripto

Summary: Using PowerShell to automate Quser to identify users to Logoff systems in Windows Hey Doctor Scripto! I need to log a user off every computer they’re logged into. The problem is, I don’t know which ones. How can I discover which computers they’re logged into and then log them off? That's a most excellent question!  I know just the pe...

PowerShellregular expressionsDoctor Scripto
Oct 28, 2016
0
0

PowerTip: Know the difference between the .split() method and ‘-split’

Doctor Scripto
Doctor Scripto

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how to split a string by using a string instead of just a character. I am trying to split the string “this is my amazing string” on the pattern “my” by using “this is my amazing string”.split(“my”) but it’s giving me a bunch of garbled stuff back. How do I accomplish my goal?  You...

Windows PowerShellPowerTipguest blogger
Oct 28, 2016
0
2

PowerShell regex crash course – Part 5 of 5

Doctor Scripto
Doctor Scripto

Summary: Thomas Rayner, Microsoft Cloud and Datacenter Management MVP, shows the basics of working with regular expressions in PowerShell. Hello! I’m Thomas Rayner, a proud Cloud and Datacenter Management Microsoft MVP, filling in for The Scripting Guy! this week. You can find me on Twitter (@MrThomasRayner), or posting on my blog, workingsysadmin...

Windows PowerShellguest bloggerThomas Rayner
Oct 21, 2016
0
0

PowerTip: How to use regular expressions to split a string without losing the character you split on

Doctor Scripto
Doctor Scripto

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how to split a string without losing the character you split on. I’m splitting this file name some file.txt into its name and extension by going “some file.txt” –split “.”. It’s giving me some file and txt, but I want to keep the dot and get .txt instead. How can I do this? You c...

Windows PowerShellPowerTipguest blogger
Oct 14, 2016
0
0

PowerTip: How to detect a valid Active Directory user name using regular expressions

Doctor Scripto
Doctor Scripto

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how use regex to detect if a string is a valid Active Directory user name. The invalid characters for an Active Directory user name are and . How do I tell if a string is a valid Active Directory user name?   You can treat this array of characters as a pattern and see if t...

Windows PowerShellPowerTipguest blogger