Browse by Tags

Tagged Content List
  • Blog Post: PowerTip: Remove Leading and Trailing Spaces with PowerShell

    Summary : Use the Trim() method to remove extraneous space from a String object. Is there an easy way to drop all spaces that are before or after a string in Windows PowerShell? Use the Trim() method to remove all spaces before and after a string from the output, for example: $Something='...
  • Blog Post: Weekend Scripter: Manipulating Word and Excel with PowerShell

    Summary : Leverage the Office API to manipulate data in Word and Excel with Windows PowerShell. Honorary Scripting Guy, Sean Kearney, is here today to give Ed the day off. Why? Well, it's his birthday, of course! People worldwide have been sending Ed Happy Birthday wishes. His inbox almost went...
  • Blog Post: PowerTip: Use Windows PowerShell to Open Word Document

    Summary : Learn how to use Windows PowerShell to open a Microsoft Word document. How can I open a Word document with Windows PowerShell? Use the New-Object cmdlet: $Filename='C:\HappyBirthdayEd.docx' $Word=NEW-Object –comobject Word.Application $Document=$Word.documents.open...
  • Blog Post: Weekend Scripter: Exporting and Importing Photos in Active Directory

    Summary : Use Windows PowerShell to import and export photos in Active Directory. Honorary Scripting Guy, Sean Kearney, is here. I was playing about with Active Directory this week. I wanted to be able to get photos to automatically populate on my workstations running Windows 7. By doing some online...
  • Blog Post: PowerTip: Use PowerShell to Identify Users Without a Photo

    Summary : List all users who do not have a photo assigned in Active Directory. Is there a simple way that I can use Windows PowerShell to identify users who do not have a photo assigned in Active Directory? Target the ThumbnailPhoto property, and filter the users for Null : GET-ADUSER –filter...
  • 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: Weekend Scripter: Basic Lync Server 2013 Backup and Restore—Part 2

    Summary : Use native automation and Windows PowerShell cmdlets to back up Lync Server 2013. Honorary Scripting Guy, Sean Kearney, is here to finish up my crazy weekend fun automating Lync backup. So we've already gone through probably the trickiest part, which is getting the bulk of the Lync...
  • Blog Post: PowerTip: Document Server's IP Addresses by Using PowerShell

    Summary : Use Windows PowerShell to document the IP addresses on a server. How can I use Windows PowerShell to easily go through my server environment and document the IP addresses in use on each machine? We can do this with a wee bit o' magic from the new Get-NetIPConfiguration cmdlet in Windows...
  • Blog Post: Weekend Scripter: Basic Lync Server 2013 Backup and Restore—Part 1

    Summary : Learn how to make a rudimentary backup for a simple Lync Server environment. Honorary Scripting Guy, Sean Kearney, is here. Today we're going to play a game of "Let's Pretend." Let's pretend you got hired in a new company or are taking over from someone who had to...
  • Blog Post: PowerTip: Export Lync Topology with PowerShell

    Summary : Use the Lync cmdlets to obtain a copy of the Lync topology. Instead of going through the GUI wizard, can I use Windows PowerShell to schedule a fresh copy of my Lync topology as a regular nightly task so I can compare deltas? Run the following Windows PowerShell cmdlet to create a file...
  • Blog Post: Managing Lync Server 2013 with Windows PowerShell—Part 5

    Summary : Learn about basic Lync auditing. Hey, Scripting Guy! I go sites and need to work on various Lync servers. Often my first challenge is getting their configuration. Where do I start? —RD Hello RD, Honorary Scripting Guy, Sean Kearney, is here to help you out with a little...
  • Blog Post: PowerTip: List All Lync Enterprise Voice Users with PowerShell

    Summary : Get a list of users and phone numbers from your Lync infrastructure. How can I use Windows PowerShell to pull a weekly list of all our Lync Telephone numbers? Use the Get-CSUser cmdlet, and in your Lync Server management shell, type: GET-CSUser | Where { $_.EnterpriseVoiceEnabled ...
  • Blog Post: Managing Lync Server 2013 with Windows PowerShell—Part 4

    Summary : Have a rollback plan for disabling a user in Lync. Hey, Scripting Guy! Before I shut down all of these Lync accounts on our environment, my boss would like to see what my rollback plan is. Other than restoring from backup, is there a quicker "undo" I can leverage by using Windows...
  • Blog Post: PowerTip: Get List of Blocked Domains on Lync with PowerShell

    Summary : Use Windows PowerShell to get a list of all domains that are blocked from federating with Lync. I am auditing a client's Lync server and need to pull up a list of all the Domains that are presently blocked or not blocked with Lync. How can I easily do that with PowerShell? Run the...
  • Blog Post: Managing Lync Server 2013 with Windows PowerShell—Part 3

    Summary : Use Windows PowerShell to remove Active Directory users for Lync. Honorary Scripting Guy, Sean Kearney, is here. Note This is the third part in a series. You might also enjoy reading: Managing Lync Server 2013 with Windows PowerShell—Part 1 Learn how to enable users. Managing...
  • Blog Post: PowerTip: Remove User from Lync Server 2013 with PowerShell

    Summary : Learn how to use -whatif to safely remove a user from Lync Server 2013. I need to remove users from Lync by using PowerShell, but I'm a bit nervous. Is there some kind of built-in test mode in Lync? Use the -whatif parameter when you disable the user to show what will happen without...