Browse by Tags

Tagged Content List
  • Blog Post: PowerTip: Use PowerShell to Create OU in Active Directory

    Summary : Use Windows PowerShell to easily create an organizational unit in Active Directory. How can I use Windows PowerShell to create a new organizational unit (OU) in Active Directory? Use the New-ADOrganizationalUnit cmdlet, and specify the name and path. A description is optional. If you...
  • Blog Post: PowerTip: Compare Two Objects with PowerShell

    Summary : Learn how to use Windows PowerShell to compare two objects to see differences. How can I use Windows PowerShell to see if a particular property from two objects is the same? Use the Compare-Object cmdlet, specify the reference object, the object to compare, and the property you are interested...
  • Blog Post: PowerTip: Use PowerShell to Get Domain Password Policy

    Summary : Use Windows PowerShell to get the domain password policy. How can I use Windows PowerShell to retrieve the default password policy for my domain? Use the Get-ADDefaultDomainPasswordPolicy cmdlet.
  • Blog Post: PowerTip: Determine What Character a String Starts With

    Summary : Use Windows PowerShell to determine what character a string starts with. How can I use Windows PowerShell to show me if a string starts with a particular letter (this also needs to be case sensitive)? Use the StartsWith method from the String class, and supply the character to the method...
  • Blog Post: PowerTip: Use PowerShell to Get Licensed Users in Office 365

    Summary : Use Windows PowerShell to get a list of users who are licensed in Office 365. How can I get a list of all users that are licensed in Office 365? Use the Get-Msoluser cmdlet from the MSOnline module and filter on the IsLicensed property: Get-Msoluser | Where { $_.Islicensed }
  • Blog Post: PowerTip: Provide Alternate Name to Nouns in Module

    Summary : Use Windows PowerShell to provide alternate names to nouns in modules to avoid conflicts. How can I use Windows PowerShell to avoid the problem of having conflicting cmdlet names in different modules? Use the Prefix parameter with Import-Module . Prefix will take whatever letter segment...
  • Blog Post: PowerTip: Convert All Uppercase String to Lowercase

    Summary : Use Windows PowerShell to convert a string to all lowercase characters. How can I use Windows PowerShell to convert a string that is in all uppercase to all lowercase characters? Use the ToLower method from the String class: "STRING".ToLower()
  • Blog Post: PowerTip: Load All PowerShell Modules at Startup

    Summary : Learn how to load all Windows PowerShell modules at startup. How can I load all of my Windows PowerShell modules when I start the Windows PowerShell console? In your Windows PowerShell profile, use the Get-Module cmdlet and pipe the results to the Import-Module cmdlet, for example: ...
  • Blog Post: PowerTip: Use Windows PowerShell to Get Migration Statistics

    Summary : Use Windows PowerShell to pull statistics about user migrations. How can I use Windows PowerShell to easily display a report with the time and amount of data transferred with my staged migrations? Use the Get-MigrationUser and Get-MigrationUserStatistics cmdlets and access some key properties...
  • Blog Post: PowerTip: Use PowerShell to Get List of Migration Batches in Office 365

    Summary : Use Windows PowerShell to identify all migration batches and their status in Office 365. Rather than navigating the Office 365 console to check the status of a migration, is there an easy way to do it with Windows PowerShell? To get list of all migration batches in Office 365 and their...
  • Blog Post: PowerTip: Use PowerShell to List All Domains in Office 365 Subscription

    Summary : Use Windows Powershell and the MSOnline cmdlets to identify all Internet domains attached to an Office 365 subscription. How can I use Windows PowerShell to easily audit an Office 365 subscription for domains that are attached to it? Use the Get-MSolDomain cmdlet, and if you want a list...
  • Blog Post: PowerTip: Display Graphical PowerShell Help​

    Summary : Learn how to display graphical Windows PowerShell Help. How can I see Windows PowerShell Help in a graphical way so I can float the Help? Use the –ShowWindow parameter from the Get-Help cmdlet, for example: Get-Help Get-Process -ShowWindow
  • Blog Post: PowerTip: Select Two Random Numbers from 20 Possibilities

    Summary : Use Windows PowerShell to select two random numbers from twenty possible numbers. How can I use Windows PowerShell to select two of twenty attendees at user group to receive prizes? Create a range of input numbers with the Get-Random cmdlet, then use the –Count parameter to retrieve...
  • Blog Post: PowerTip: Read NTFS File System Stream with PowerShell

    Summary : Use Windows PowerShell to read a specific NTFS file system stream. How can I use Windows PowerShell to read a specific NTFS file system stream? Use the Get-Content cmdlet and specify the name of the file and the name of the stream. This example reads a stream named Data : Get-Content...
  • Blog Post: PowerTip: Use PowerShell to Generate Tenant Site Report

    Summary : Use Windows PowerShell to generate a report about Office 365 tenant sites. How can I use Windows PowerShell to generate a report about my Office 365 tenant sites? Install the SharePoint Online Management Shell and install the cmdlet library for SharePoint Online (provided by MVP, Gary...
  • Blog Post: PowerTip: Use PowerShell to Add Content to File Stream

    Summary : Use Windows PowerShell to add content to the file system stream of a file. How can I use Windows PowerShell to add data to an alternate NTFS file system stream of a file? Use the Add-Content cmdlet and specify the name of the stream for the Stream parameter, then specify the data in the...
  • Blog Post: PowerTip: Use PowerShell to Get Computer Name

    Summary : Use Windows PowerShell to get your computer name. How can I use Windows PowerShell to easily retrieve my computer name? Use the environmental variable ComputerName : $env:computername
  • Blog Post: PowerTip: Line Continuation in PowerShell

    Summary : Ensure a line continuation in Windows PowerShell. What the line continuation character should use to ensure my Windows PowerShell code continues to the next line? The line continuation character in Windows PowerShell is the backtick. Type a <space>, the backtick, and then press...
  • Blog Post: PowerTip: Use PowerShell Grid View to Display Logon Info

    Summary : Learn how to display user logon information. How can I use Windows PowerShell to display user logon information in an easy graphical manner? Create two hash tables using environmental variables, and pipe the input to the Out-Gridview cmdlet, for example: @{"username" = $env...
  • Blog Post: PowerTip: Return Specific Number of PowerShell Cmdlets

    Summary : Learn how to return only a specific number of Windows PowerShell cmdlets. How can I find only four Windows PowerShell cmdlets that use the verb Get , without seeing a long scrolling list of found cmdlets? Use the TotalCount parameter of the Get-Command cmdlet, for example: Get-Command...
  • Blog Post: PowerTip: Find Specific PowerShell Cmdlet Help

    Summary : Learn how to find help for a specific Windows PowerShell cmdlet parameter. How can I find more information about a specific Windows PowerShell parameter that I saw a presenter use? Use the Get-Help cmdlet, and specify the Windows PowerShell cmdlet and parameter names. This example returns...
  • Blog Post: PowerTip: Read Text File in Raw Mode with PowerShell

    Summary : Use Windows PowerShell to read a text file in raw mode. How can I use Windows PowerShell to read a text file as a single line of text, not as an array of strings created by end-of-line returns? Use the –Raw parameter with Get-Content . This forces Windows PowerShell to ignore new...
  • Blog Post: PowerTip: Find All PowerShell Cmdlets Except…

    Summary : Learn how to find all Windows PowerShell cmdlets except those from a specific module. How can I find all Windows PowerShell cmdlets that begin with the verb "get" but are not contained in the Windows PowerShell module named “PowerShellCookbook”? Use the Get-Command...
  • Blog Post: PowerTip: Use PowerShell to Parse Delimiters in File

    Summary : Use Windows PowerShell to parse file delimiters in a file. How can I use Windows PowerShell to break out lines in a text file that are delimited by “\\”? Here is the file content: PS C:\> Get-Content C:\fso\AnEmptyFile.txt This is content \\mydata\\more stuff ...
  • Blog Post: PowerTip: Use PowerShell to Add Content to File

    Summary : Learn how to use Windows PowerShell to add content to a file. How can I use Windows PowerShell to add content to a file? Use the Add-Content cmdlet, and specify the path to the file and the value of the content, for example: Add-Content C:\fso\AnEmptyFile.txt -Value "This is content"