Browse by Tags

Tagged Content List
  • 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...
  • Blog Post: PowerTip: Use PowerShell to Get Hash Code of Tuple

    Summary : Learn how to get the hash code of a tuple by using Windows PowerShell. How can I use Windows PowerShell to get the hash code for a tuple? Call the GetHashCode method from your Tuple object —for example, this command creates a tuple and obtains the hash code of it: $t = [tuple...
  • Blog Post: PowerShell String Theory

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to work with strings. Microsoft Scripting Guy, Ed Wilson, is here. This has been an exciting week around the Scripting Household. From our lanai, we can see several little rabbits hopping around—they seem to like...
  • Blog Post: PowerTip: Remove First Two Letters of String

    Summary : Learn how to use Windows PowerShell remove the first two letters from a string. How can I use Windows PowerShell to remove the first two letters from a string? Use the SubString method, for example: $a = “String” $a.substring(2)
  • Blog Post: Weekend Scripter: Hurrah for Curah

    Summary : Teresa Wilson (aka Scripting Wife) talks about how Microsoft Curah solved her search issue. Microsoft Scripting Guy, Ed Wilson, is here. Windows PowerShell MVP, Teresa Wilson is back with us today to share information about Curah. One of the problems with trying to find technical information...
  • Blog Post: PowerTip: Generate Random Beeps with PowerShell

    Summary : Use Windows PowerShell to generate random beeps. How can I generate random beeps by using Windows PowerShell? Create a range of numbers between 190 and 8500 that will determine the tone. Use the Get-Random cmdlet to choose a random number of tones. Pipe the results to the ForEach-Object...
  • Blog Post: Use Windows PowerShell to Prepare for Migration from SharePoint 2007

    Summary : Marc Adam Carter talks about using Windows PowerShell to smooth the way for a large SharePoint 2007 migration. Microsoft Scripting Guy, Ed Wilson, is here. Today our guest blogger is Marc Adam Carter ... If you’re responsible for administering a SharePoint 2013 or SharePoint 2010...
  • Blog Post: PowerTip: Count a Range of Seconds with PowerShell

    Summary : Use Windows PowerShell to count a range of seconds. How can I use Windows PowerShell to count a range of seconds of increasing duration? Use the range operator to create a range of numbers, then pipe the results to the ForEach-Object cmdlet inside a script block call Start-Sleep : ...
  • Blog Post: Handling Errors the PowerShell Way

    Summary : Trevor Sullivan talks about handling errors in Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Today we have guest blogger and Windows PowerShell MVP, Trevor Sullivan ... also find Trevor on Twitter ( https://twitter.com/pcgeek86 ) and his blog ( http://trevorsullivan.net...
  • Blog Post: PowerTip: Find Information About ErrorActionPreference

    Summary : Find information, beyond the basics, for the Windows PowerShell variable ErrorActionPreference . How can I use Windows PowerShell to see information, beyond only the value, for the variable ErrorActionPreference ? Use the Get-Variable cmdlet and pipe the results to the Format-List cmdlet...
  • Blog Post: Getting to Know ForEach and ForEach-Object

    Summary : Learn the differences between ForEach and ForEach-Object in Windows PowerShell. Honorary Scripting Guy and Windows PowerShell MVP, Boe Prox , here today filling in for my good friend, The Scripting Guy. Today I am going to talk about some differences between using ForEach and using ForEach...
  • Blog Post: PowerTip: Use PowerShell to Locate the Help File You Need

    Summary : Learn how to use Windows PowerShell to find the Help file you need. How can I figure out the exact name of the Help file that I am looking for about sessions? Use a wildcard character with Get-Help to narrow down the scope of the Help files: Get-Help about_*session* Name Category...
  • Blog Post: Piping Results from One PowerShell Cmdlet to Another

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about piping the results from one cmdlet to another. Hey, Scripting Guy! I have a problem. When I pipe information from one Windows PowerShell cmdlet to anther (for example, when I use Get-Process and pipe it to Stop-Process ), sometimes it works...
  • Blog Post: PowerTip: Find Information About PowerShell Cmdlet Parameter Sets

    Summary : Learn how to find information about Windows PowerShell cmdlet parameter sets. How can I find information about the various parameter sets for a specific Windows PowerShell cmdlet? Use Get-Command to return cmdlet information, pipe the results to the Select-Object cmdlet, and expand the...
  • Blog Post: Back to Basics Part 5: Outputting Data

    Summary : Microsoft PFE, Gary Siepser, talks about outputting data via the pipeline in this exciting conclusion to a five part series. Microsoft Scripting Guy, Ed Wilson, is here. Today brings an end to a week of guest blog posts by Gary Siepser. You can read the following posts to catch up with the...