Browse by Tags

Tagged Content List
  • Blog Post: Exclude Delayed Start Services when Checking Status with PowerShell

    Summary : Windows PowerShell MVP, Mike Robbins, shows us how to use Windows PowerShell to check the status of Windows services and improve the accuracy of results. Microsoft Scripting Guy, Ed Wilson, is here. Welcome back guest blogger, Mike Robbins. Mike F Robbins is a senior systems engineer...
  • Blog Post: PowerTip: Use PowerShell to Display Invalid File Names

    Summary : Use Windows PowerShell to display invalid file name characters. How can I use Windows PowerShell to display information about invalid file name characters? Use the System.IO.Path class and call the GetInvalidFileNameChars static method: [System.IO.Path]::GetInvalidFileNameChars()
  • Blog Post: PowerTip: Check Status of PowerShell Preference Variables

    Summary : Learn to easily check the value assignments of Windows PowerShell preference variables. How can I use Windows PowerShell to quickly check the value of Windows PowerShell preference variables? You can use the Windows PowerShell variable drive and look for variables that end with the word...
  • Blog Post: Use PowerShell to Write Verbose Output

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to write verbose output. Hey, Scripting Guy! The other day, you said that I should not use Write-Host . I even read that such usage is dangerous to the health of small canines in 2012 Scripting Games Commentary:...
  • Blog Post: Troubleshoot PowerShell Script Output

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about troubleshooting output from a Windows PowerShell script. Hey, Scripting Guy! First, I want to say that you guys absolutely rock! I mean, I never miss a single day reading your posts. They are always right on, and it is like somehow you read...
  • Blog Post: PowerTip: Use PowerShell to Create Two Column Output

    Summary : Create a two column output of data by using Windows PowerShell. How can I use Windows PowerShell to create output that has two columns? Use the Format-Wide cmdlet, and then use the –Column parameter to specify a number of columns, for example: Get-Process | Format-Wide name ...
  • Blog Post: Troubleshooting a PowerShell SQL Server Script

    Summary : Microsoft Scripting Guy, Ed Wilson, helps a reader with a Windows PowerShell and SQL Server scripting issue. Microsoft Scripting Guy, Ed Wilson, is here. This morning I am sipping a nice cup of Darjeeling tea. I added a bit of peppermint leaves, spearmint leaves, orange peel, licorice root...
  • Blog Post: PowerTip: Start PowerShell with No Profile

    Summary : Start Windows PowerShell with no profile to troubleshoot scripts. How can I use Windows PowerShell to troubleshoot a script that sometimes works and sometimes does not? Look for any external dependencies by starting Windows PowerShell with no profile. Use Start/Run, and in the dialog...
  • Blog Post: Transforming the Active Directory Cmdlets: Part 5

    Summary : Learn how to translate between ADSI, Quest, and Windows PowerShell cmdlets for creating users. Hey, Scripting Guy! Today I'm translating a script for modifying user properties and I could really use some help. There are so many parameters to work with. Where do I start? —LC...
  • Blog Post: PowerTip: List All Parameters for a Cmdlet

    Summary : Learn to provide a parameter list for a cmdlet in a viewable table. I am trying to work with cmdlets with so many parameters that I am having a hard time reading them in Get-Help . Is there a way to list them in a single table? Access the Parameters property by using Get-Command and the...
  • Blog Post: Transforming the Active Directory Cmdlets: Part 4

    Summary : Learn how to translate between ADSI, Quest, and Windows PowerShell cmdlets to read additional user properties. Hey, Scripting Guy! I'm trying figure something out. I can get some properties with the Quest cmdlets without even asking, but when I go to use the Windows PowerShell cmdlets...
  • Blog Post: PowerTip: Identify All Properties for Active Directory User

    Summary : Use the –Properties parameter to find all properties attached to an Active Directory user. How can I use Windows PowerShell rather than digging through the ADSI editor to find the available properties for a user in our Active Directory? Leverage the –Properties parameter on...
  • Blog Post: Transforming the Active Directory Cmdlets: Part 3

    Summary : Learn how to translate between ADSI, Quest, and Windows PowerShell cmdlets for creating users. Hey, Scripting Guy! I downloaded a script from the Internet to remove users, but it's designed to use the newer Windows PowerShell cmdlets. My server environment doesn't have them available...
  • Blog Post: PowerTip: Use PowerShell to Determine ASCII Value

    Summary : Learn to use Windows PowerShell to determine the ASCII numeric value of a character. How can I use Windows PowerShell to tell the ASCII value of a character? You can get the numeric value of an ASCII character quite easily, for example, to get the value of the lowercase letter a , type...
  • Blog Post: Transforming the Active Directory Cmdlets: Part 2

    Summary : Learn how to transcribe between ADSI, Quest, and Windows PowerShell cmdlets for creating users. Hey, Scripting Guy! I used to use the Quest cmdlets to create new users, but I need to rewrite some of my scripts to work with a legacy environment that can't use the .NET Framework. Can...
  • Blog Post: PowerTip: Convert Plain Text to Secure String

    Summary : Learn to convert a plain text password to a secure string for cmdlet parameters. I'm trying to convert some scripts to work with the Active Directory modules, but they need a secure string for the password. How do I create one of these? Use the ConvertTo-SecureString cmdlet, capture...
  • Blog Post: Transforming the Active Directory Cmdlets: Part 1

    Summary : Learn how to translate between ADSI, Quest, and Windows PowerShell cmdlets for creating users in Active Directory. Hey, Scripting Guy! I've got some older scripts that create users by using the [ADSI] accelerator. Can you show me how they might be rewritten to work with the more modern...
  • Blog Post: PowerTip: Find List of Users in Active Directory

    Summary : Use the Filter parameter in the Active Directory module. I was playing with the Active Directory cmdlets and noticed that they seem to need the Distinguished Name. Is there any way to find users instead of supplying this very explicit object each time? Use the –Filter parameter...
  • Blog Post: Trim Your Strings with PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to trim strings and clean up data. Microsoft Scripting Guy, Ed Wilson, is here. The Scripting Wife heads out today to spend time with her other passion at the Blue Ridge Classic Horse Show . Unfortunately, I will not...
  • Blog Post: PowerTip: Remove Spaces from Both Ends of String

    Summary : Learn to use Windows PowerShell to remove spaces from both ends of a string. How can I use Windows PowerShell to remove spaces at both ends of a string? Use the Trim method from the System.String .NET Framework class. In this example, I create a string with a space at each end of the...
  • Blog Post: Using the Split Method in PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using the Split method in Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Dude, dude, dude, (or dudette, as the case may be) I still cannot find my teapot after our move. At least I found my kettle to heat water so I can make...
  • Blog Post: PowerTip: Use PowerShell Split Operator to Break Strings

    Summary : Learn how to use the Windows PowerShell Split operator to break up strings. How can I use Windows PowerShell to break a string at a specific character? Use the Split operator and specify the character to split on, for example: PS C:\> "this,is,a,string" -split ","
  • Blog Post: Join Me in a Few String Methods Using PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using the String class of the Join method in Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. This morning while I was eating breakfast and reviewing my email on my Surface 2 Pro, I noticed that I have meetings all afternoon...
  • Blog Post: PowerTip: Create Empty String with PowerShell

    Summary : Learn how to create an empty string by using Windows PowerShell. How can I use Windows PowerShell to create an empty string? Use the static Empty field from the System.String class: [string]::Empty
  • Blog Post: Keep Your Hands Clean: Use PowerShell to Glue Strings Together

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about several approaches for concatenating strings by using Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. This weekend, I was speaking about blogging and technical writing at the South Carolina Writers Workshop in Rock Hill, South...