I just came back yesterday from the Microsoft MVP Global Summit 2015 who took place in the beautiful city of Seattle from the 2nd to 5th of November 2015. This was the second time that I attend this event which was really well organized. I really had a blast meeting with all the MVP and Microsoft teams.
What is the MVP Global Summit ?
The annual MVP Global Summit is one of the best weeks of the year; there is no other technical event like it. Experts in every Microsoft category converge for training, talks, and events. It provides Microsoft with needed product feedback and helps set the mood for the next release of products.
Pictures
Here are some picture of the event and the people I got a chance to hang out with.
2015/11/07
2015/11/01
Montreal PowerShell User Group #02 - Materials and pictures
Here is the material from our second Montreal PowerShell User Group meeting that occurred last Tuesday (2015/10/27).
The Powerpoint presentations and PowerShell codes is available on the meetup group page and Github:
https://github.com/lazywinadmin/MTLPUG/tree/master/MTLPUG_02
http://www.meetup.com/MontrealPowerShellUserGroup/files/
2015/10/20
Montreal PowerShell User Group #02 - Using the Pipeline/Creating Script and Function
Join us for the Montreal PowerShell User Group #02 meeting on the Tuesday 27th of October 2015 from 6:00pm to 9:00pm at the Warner Brothers Games Studio!
We will have the two following presentations: Using the PowerShell Pipeline (Beginner level) and Creating Script/Function (Beginner/Intermediate level).
Both presentations will be presented by User Groups members: Martin Lebel and Gary Szabo. (Thank you guys!)
Hope to see you there! Free Pizza, Pop Corn and some games/movies to win!
Presentations
• Using the Pipeline and formatting the output presented by Martin Lebel
• Creating PowerShell Script and Function presented by Gary Szabo
When
Tuesday, 27th of October 2015 from 6:00pm to 9:00pm
Where
Warner Brothers Games - 888 Maisonneuve Est - 6th Floor
Room: Jack Warner (In front of elevators)
2015/09/16
Montreal PowerShell User Group #01 - Material and pictures from my talk on Introduction to PowerShell
Here is the material from my presentation on Introduction to PowerShell at the first Montreal PowerShell User Group meeting that occurred yesterday (2015/09/15).
The Powerpoint presentation and PowerShell code is available on the meetup group page and Github:
- https://github.com/lazywinadmin/MTLPUG/tree/master/MTLPUG_01
- http://www.meetup.com/MontrealPowerShellUserGroup/files/
Even thought I was a bit stress to present, I really loved the experience and I can't wait for the next meeting! We had a great group (17 people) who showed great interest and asked tons of questions!!
The next meeting will probably occur around the end of October.
2015/09/04
PowerShell/SCCM - Create a Dynamic Variable list during the task sequence
In my previous article I talked about SCCM Application and how to retrieve the applications targeted to a user.
Today I'll show how we can build a function to create a list of dynamic variables. This would be used in a Task Sequence during the Operating System Deployment in the task "Install Application".
First we will need to find the list of applications and then create a variable with a specific pattern for each of them.
In the following task "Run PowerShell Shell Script", the script will retrieve in SCCM all the Applications advertised on the users (showed in previous article) and then create a bunch of variables that will be used in the task "Install Application".
Today I'll show how we can build a function to create a list of dynamic variables. This would be used in a Task Sequence during the Operating System Deployment in the task "Install Application".
First we will need to find the list of applications and then create a variable with a specific pattern for each of them.
What does it look like inside the task Sequence ?
Before we dig into the PowerShell, I think it is important to understand where everything will goes.In the following task "Run PowerShell Shell Script", the script will retrieve in SCCM all the Applications advertised on the users (showed in previous article) and then create a bunch of variables that will be used in the task "Install Application".
2015/09/03
PowerShell/SCCM - Find Applications advertised to a user
The following function helps you retrieve all the deployment that a user is supposed to received.
We use this during the Operating System Deployment (OSD). Using the UDI we get the user account that will receive the workstation currently being deployed. This script allow us to retrieve in SCCM all the Application advertised on the user that needed to be deployed on the computer during the task sequence.
I know this could probably be done with the Configuration Manager module, but I'm pretty new with it and I was not sure it could be loaded in a task sequence, if you have the answer let me know in the comment section.
Here is the step by step how I found my solution. You can also go straight to the function at the end of this article.
We use this during the Operating System Deployment (OSD). Using the UDI we get the user account that will receive the workstation currently being deployed. This script allow us to retrieve in SCCM all the Application advertised on the user that needed to be deployed on the computer during the task sequence.
I know this could probably be done with the Configuration Manager module, but I'm pretty new with it and I was not sure it could be loaded in a task sequence, if you have the answer let me know in the comment section.
Here is the step by step how I found my solution. You can also go straight to the function at the end of this article.
Define Default Parameters
First I define a splatting to avoid repeating the same parameters in each command.# Define default parameters (Splatting) $Splatting = @{ ComputerName = "Sccm01.lazywinadmin.com" NameSpace = "root\SMS\Site_FX1" }
Retrieve a user in SCCM CMDB
Then I need to find a user in the SCCM Database to retrieve its ResourceID.# Find the User in SCCM CMDB $User = Get-WMIObject @Splatting -Query "Select * From SMS_R_User WHERE UserName='FxTest'"
Retrieve the collections the user is member of
# Find the collections where the user is member of $Collections = Get-WmiObject -Class sms_fullcollectionmembership @splatting -Filter "ResourceID = '$($user.resourceid)'"
2015/08/31
Montreal PowerShell User Group #01 - Introduction to PowerShell
-English-
This is our first Montreal PowerShell User Group ! We'll start easy with a presentation on the basics of PowerShell ! Hope to see you there! Pizza, PopCorn and some free games to win!
When
Tuesday, 15th of September 2015Where
Warner Brothers Games - 888 Maisonneuve Est - 6th FloorRoom: Jack Warner (In front of elevators)
2015/08/30
PowerShell - Remove special characters from a string using Regular Expression (Regex)
Some more string manipulations! Today I'd like to remove the special characters and only keep alphanumeric characters using Regular Expression (Regex).
You might be interested to check a previous article where I showed how to remove diacritics (accents) from some strings, see here: http://www.lazywinadmin.com/2015/05/powershell-remove-diacritics-accents.html
My goal is to be able to keep only any characters considered as letters and any numbers.
If you are familiar with Regex, you could do something simple as using the metacharacter \w or [a-z] type of things. It's great when you only work with english language but does not work when you have accents or diacritics with Latin languages for example.
You might be interested to check a previous article where I showed how to remove diacritics (accents) from some strings, see here: http://www.lazywinadmin.com/2015/05/powershell-remove-diacritics-accents.html
If you are familiar with Regex, you could do something simple as using the metacharacter \w or [a-z] type of things. It's great when you only work with english language but does not work when you have accents or diacritics with Latin languages for example.
Preview of the final solution |
2015/08/29
PowerShell/Office 365 - Get an Exchange Online user's distribution groups efficiently
In my previous post I showed how to retrieve the membership of one or multiple groups. In today's post I want to find the Distribution groups a user belongs to.
There are multiple approaches you could be using to gather this information but as an example I'll re-use the same one-liner from my previous article and simply filter with Where-Object to find a particular User.
This is probably the route PowerShell beginners would take and it is working 'Fine' in a small environment but not very efficient, you'll see in the following example.
In this environment, there are a bit more than 1800 Distribution Groups. I want to know which Distribution Group I'm member of.
Retrieving the count of Distribution Groups and an User account in Office 365 |
2015/08/24
PowerShell/Office 365 - Get the distribution groups membership
I was recently looking at Office365/Exchange Online to retrieve Distribution Group membership. This is pretty simple using something like:
Not that prior to perforce the following command you need to be already connected to Office365, see this post.
As the error message is stating that this Cmdlet does not accept input :-/
By using Get-Help on Get-DistributionGroupMember, we can check the parameters accepting Input:
Get-DistributionGroupMember -Identity "Marketing"
Not that prior to perforce the following command you need to be already connected to Office365, see this post.
Retrieving all members of each Distribution Group
Now if I want to retrieve all the Distribution group members, it's bit trickier you'll see. First I started by listing the groups members. My PowerShell instinct made me type Get-DistributionGroup|Get-DistributionGroupMember but it did not work, see below:As the error message is stating that this Cmdlet does not accept input :-/
By using Get-Help on Get-DistributionGroupMember, we can check the parameters accepting Input:
(Get-Help Get-DistributionGroupMember).parameters.parameter|Select-Object name,parametervalue,pipelineinput
2015/08/15
Windows 10 ADK - Issues while uninstalling Windows 8.1 ADK and installing Windows 10 ADK
Installing Windows 10 Assessment and Deployment Kit (ADK) on SCCM 2012 R2 SP1 was a bit tricky. To "upgrade" the Windows ADK from 8.1 to 10, Microsoft recommend to remove Windows 8.1 ADK prior to the installation of Windows 10 ADK. We had some issue uninstalling Windows 8.1 ADK and installing the Windows 10 ADK
We found different solutions online such as:
Uninstalling the Windows 8.1
Issue
Uninstall did not complete successfully.
An error occured while uninstalling "Deployment Tools."
Could not acquire privileges; GLE=0x514
Returning Status 0x514
You can also look at the ADK install/uninstall logs here: C:\Users\<Account>\AppData\Local\Temp\adkAn error occured while uninstalling "Deployment Tools."
Could not acquire privileges; GLE=0x514
Returning Status 0x514
- Unjoin, install ADK and Rejoin the computer to the domain
- Run the installer as a Local Administrator or domain admin
Unjoining the machine was out of questions and the second solution did not work (Same error message).
I also tried to
- Remove one component at the time but always got stuck on the "Deployment Tools" component.
- Repair W8.1 ADK and try again
Same result...
2015/06/28
PowerShell - Using Office 365 REST API to get Calendar Events
A couple of weeks ago I was looking at a way to find the Calendar Events of an Office365 shared mailbox using PowerShell. Unfortunately I was not able to find a way to accomplished this task using the O365 Cmdlets. (Let me know in the comments if you know how...)
Update 2017/04/02: Support for timezone, Updated the function with error handler and some verbose messages. Added examples to retrieve the list of attendees emails
Update 2016/04/19: Function updated to support PageResult parameter
So I turned to the PowerShell Community and posted tweet about it.
Quickly I got an answer from @Mjolinor and @Glenscales who sent me some great stuff by using REST API. Thanks again guys!!
This is the example Glen sent me:
This example shows how to list the calendar events for the next week. This is great and exactly what I needed, plus this run super fast compared to using the PowerShell module.
Of course you will need to have permissions on the specified mailbox.
Even though it show this as a CustomObject, the object type is Microsoft.OutlookServices.Event, see this MSDN page to find all the properties and methods available: https://msdn.microsoft.com/office/office365/APi/complex-types-for-mail-contacts-calendar#EventResource
Update 2017/04/02: Support for timezone, Updated the function with error handler and some verbose messages. Added examples to retrieve the list of attendees emails
Update 2016/04/19: Function updated to support PageResult parameter
So I turned to the PowerShell Community and posted tweet about it.
Any way to list calendar items of a shared mailbox using #PowerShell on #office365 (#Exchange Online) ? Can't find my answer so far
— François-Xavier Cat (@LazyWinAdm) April 30, 2015
Quickly I got an answer from @Mjolinor and @Glenscales who sent me some great stuff by using REST API. Thanks again guys!!
Invoke-RestMethod -Uri "https://outlook.office365.com/api/v1.0/users/sharedmailbox@domain.com/calendarview?startDateTime=$(Get-Date)&endDateTime=$((Get-Date).AddDays(7))" -Credential (Get-Credential) | foreach-object{ $_.Value }
This example shows how to list the calendar events for the next week. This is great and exactly what I needed, plus this run super fast compared to using the PowerShell module.
Of course you will need to have permissions on the specified mailbox.
Even though it show this as a CustomObject, the object type is Microsoft.OutlookServices.Event, see this MSDN page to find all the properties and methods available: https://msdn.microsoft.com/office/office365/APi/complex-types-for-mail-contacts-calendar#EventResource
2015/05/21
PowerShell - Remove Diacritics (Accents) from a string
In the last few days, I have been working on a Onboarding automation process that need to handle both French and English and one of the step needed to remove the accents (also knows as Diacritics) from some strings passed by the users.
The following approach uses String.Normalize to split the input string into constituent glyphs (basically separating the "base" characters from the diacritics) and then scans the result and retains only the base characters. It's just a little complicated, but really you're looking at a complicated problem...
UPDATE: Thanks to Marcin Krzanowicz who provided another solution, see the Method 2 below. His version works with Polish characters too where the method 1 doesn't.
UPDATE (2016/10/10): Added an example to replace diacritics in multiple files
Method 1
The following code is available on my PowerShell GitHub repository.
This code is available on my GitHub repository.
Method 2 (From Marcin Krzanowicz)
If you want to take this to the next level and remove diacritics from multiple files, you could do something like this:
Thanks for reading! If you have any questions, leave a comment or send me an email at fxcat@lazywinadmin.com. I invite you to follow me on Twitter @lazywinadm / Google+ / LinkedIn. You can also follow the LazyWinAdmin Blog on Facebook Page and Google+ Page.
The following approach uses String.Normalize to split the input string into constituent glyphs (basically separating the "base" characters from the diacritics) and then scans the result and retains only the base characters. It's just a little complicated, but really you're looking at a complicated problem...
UPDATE: Thanks to Marcin Krzanowicz who provided another solution, see the Method 2 below. His version works with Polish characters too where the method 1 doesn't.
UPDATE (2016/10/10): Added an example to replace diacritics in multiple files
Method 1
The following code is available on my PowerShell GitHub repository.
function Remove-StringDiacritic { <# .SYNOPSIS This function will remove the diacritics (accents) characters from a string. .DESCRIPTION This function will remove the diacritics (accents) characters from a string. .PARAMETER String Specifies the String on which the diacritics need to be removed .PARAMETER NormalizationForm Specifies the normalization form to use https://msdn.microsoft.com/en-us/library/system.text.normalizationform(v=vs.110).aspx .EXAMPLE PS C:\> Remove-StringDiacritic "L'été de Raphaël" L'ete de Raphael .NOTES Francois-Xavier Cat @lazywinadm www.lazywinadmin.com #> param ( [ValidateNotNullOrEmpty()] [Alias('Text')] [System.String]$String, [System.Text.NormalizationForm]$NormalizationForm = "FormD" ) BEGIN { $Normalized = $String.Normalize($NormalizationForm) $NewString = New-Object -TypeName System.Text.StringBuilder } PROCESS { $normalized.ToCharArray() | ForEach-Object -Process { if ([Globalization.CharUnicodeInfo]::GetUnicodeCategory($psitem) -ne [Globalization.UnicodeCategory]::NonSpacingMark) { [void]$NewString.Append($psitem) } } } END { Write-Output $($NewString -as [string]) } }
This code is available on my GitHub repository.
Method 2 (From Marcin Krzanowicz)
function Remove-StringLatinCharacters { PARAM ([string]$String) [Text.Encoding]::ASCII.GetString([Text.Encoding]::GetEncoding("Cyrillic").GetBytes($String)) }
Extra: Remove Diacritics from multiple files
If you want to take this to the next level and remove diacritics from multiple files, you could do something like this:
# Modify the function to make it compatible with the pipeline function Remove-StringLatinCharacters { PARAM ( [parameter(ValueFromPipeline = $true)] [string]$String ) PROCESS { [Text.Encoding]::ASCII.GetString([Text.Encoding]::GetEncoding("Cyrillic").GetBytes($String)) } } # Exemple with multiple Text files located in the directory c:\test\ Foreach ($file in (Get-ChildItem c:\test\*.txt)) { # Get the content of the current file and remove the diacritics $NewContent = Get-content $file | Remove-StringLatinCharacters # Overwrite the current file with the new content $NewContent | Set-Content $file }
Thanks for reading! If you have any questions, leave a comment or send me an email at fxcat@lazywinadmin.com. I invite you to follow me on Twitter @lazywinadm / Google+ / LinkedIn. You can also follow the LazyWinAdmin Blog on Facebook Page and Google+ Page.
2015/05/18
PowerShell - Report Expiring User accounts
In the video game industry it is common practice to hire consultants to take care of the Quality Assurance, which consists of a means of the software engineering processes and methods used to ensure quality. Those people are most likely Testers and usually spend most of their day testing games in development to find bugs.
The problem is, once in a while managers forget to update the expiration dates of their Consultant/External Partners even if they got a couple of reminders, and since we have some automation process taking care of the off-boarding (thanks to PowerShell! ;-)...it is becoming fun when those guys can't connect to their accounts on Monday morning...and they lost all their access.
So I wrote a tiny script to report any expiring user accounts and send it to the IT department every Monday morning, just to give us a heads up.
Report Example
The problem is, once in a while managers forget to update the expiration dates of their Consultant/External Partners even if they got a couple of reminders, and since we have some automation process taking care of the off-boarding (thanks to PowerShell! ;-)...it is becoming fun when those guys can't connect to their accounts on Monday morning...and they lost all their access.
So I wrote a tiny script to report any expiring user accounts and send it to the IT department every Monday morning, just to give us a heads up.
Report Example
2015/05/04
Microsoft Ignite 2015 in Chicago
This time I'm going to attend the Microsoft Ignite all week but first I will meet my coworkers at the NetherRealm video games studio (where they work on Mortal Kombat) and visit their workplace.
If you want to meet me, I'm planning to attend sessions related to Nano servers, Docker/Containers, Windows Server/System Center and anything interesting on Automation.
I will also be at the Scripting Guys and Sapien Booth:
- Scripting Guys Booth - Tuesday May 5 - 10:30am
- Sapien Technologies Booth #355 - Wednesday May 6 - 3:00pm
Willis Tower |
Running the Chicago's Marathon in 2012 Marathon is a 26 miles/42 km race, I finished in 3 hours and 20 minutes! :-) |
Thanks for reading! If you have any questions, leave a comment or send me an email at fxcat@lazywinadmin.com. I invite you to follow me on Twitter @lazywinadm / Google+ / LinkedIn. You can also follow the LazyWinAdmin Blog on Facebook Page and Google+ Page.
2015/04/12
PowerShell/Active Directory - Retrieve Groups managed by a User
I recently had an interesting request at work:
Finding a way to list all the groups a specific user was managing.
If you look into the properties of an Active Directory group object, you will find under the tab "ManagedBy" the name of a user or group who is managing the group and possibly its members if the "Manager can update membership list" is checked.
This is nice for one group.... what if the user manage tons of them ?
Finding a way to list all the groups a specific user was managing.
If you look into the properties of an Active Directory group object, you will find under the tab "ManagedBy" the name of a user or group who is managing the group and possibly its members if the "Manager can update membership list" is checked.
Group object properties / Managed By tab |
This is nice for one group.... what if the user manage tons of them ?
2015/04/10
PSBlogWeek on Advanced Functions - Free eBook available
Last week I participated to the PowerShell Blog Week with a couple of community well-known Bloggers/Enthusiasts/MVP. The topic of the week was Advanced Functions.
It seems a lot of people enjoyed the event and I hope a great amount learned something from it.
I'm happy to announced that all the articles have been combined into a free ebook (Thanks to Jeffery Hicks) available in different format.
PowerShell Blog Week - Advanced Functions
By Adam Bertram, Boe Prox, Francois-Xavier Cat, Jeffery Hicks, June Blender, Mike F. Robbins.
Download:
Thanks for reading! If you have any questions, leave a comment or send me an email at fxcat@lazywinadmin.com. I invite you to follow me on Twitter @lazywinadm / Google+ / LinkedIn. You can also follow the LazyWinAdmin Blog on Facebook Page and Google+ Page.
It seems a lot of people enjoyed the event and I hope a great amount learned something from it.
I'm happy to announced that all the articles have been combined into a free ebook (Thanks to Jeffery Hicks) available in different format.
PowerShell Blog Week - Advanced Functions
By Adam Bertram, Boe Prox, Francois-Xavier Cat, Jeffery Hicks, June Blender, Mike F. Robbins.
Table of Content:
Download:
Thanks for reading! If you have any questions, leave a comment or send me an email at fxcat@lazywinadmin.com. I invite you to follow me on Twitter @lazywinadm / Google+ / LinkedIn. You can also follow the LazyWinAdmin Blog on Facebook Page and Google+ Page.
2015/03/30
Standard and Advanced PowerShell functions
This post is part of the PowerShell Blogging Week (#PSBlogWeek), a series of coordinated posts designed to provide a comprehensive view of a particular topic.
This week topic will be focused on Windows PowerShell Advanced Functions.
When you have been working with PowerShell for some time, creating reusable tools is an obvious evolution to avoid writing the same code over and over again. You will want to have modular pieces of code that only do one job and do it well - that’s the role of functions.
Let's suppose you have to accomplish a task that requires multiple lines of code, for example:
This week topic will be focused on Windows PowerShell Advanced Functions.
In this series:
In this post, we'll discuss Standard and Advanced Functions and why you should write advanced functions.- Standard and Advanced PowerShell Functions by François-Xavier Cat (@LazyWinAdm) (March 30, 2015)
- PowerShell Advanced Functions: Can we build them better? With parameter validation, yes we can! by Mike F. Robbins (@mikefrobbins) (March 31, 2015)
- Dynamic Parameters and Parameter Validation by Adam Bertram (@adbertram) (April 1, 2015)
- Supporting WhatIf and Confirm in Advanced Functions by Jeffery Hicks (@JeffHicks) (April 2, 2015)
- Advanced Help for Advanced Functions by June Blender (@juneb_get_help) (April 3, 2015)
- A Look at Try/Catch in PowerShell by Boe Prox (@proxb) (April 4, 2015)
When you have been working with PowerShell for some time, creating reusable tools is an obvious evolution to avoid writing the same code over and over again. You will want to have modular pieces of code that only do one job and do it well - that’s the role of functions.
Let's suppose you have to accomplish a task that requires multiple lines of code, for example:
# Computer System Get-WmiObject -Class Win32_ComputerSystem # Operating System Get-WmiObject -class win32_OperatingSystem # BIOS Get-WmiObject -class Win32_BIOS
2015/03/27
PowerShell Blogging Week
Next week, from the 30th of March to the 4th of April, I will be participating to the PowerShell Blogging Week with a couple of community well-known Bloggers/Enthusiasts/MVP.
But.. what is the PowerShell Blogging Week: This event was initiated by Jeffery Hicks and Adam Bertram and will focus on one PowerShell topic.
Each participants will be posting one article on his/her affected day, on their respective blog. You can follow the event by following the blogs bellow, using the twitter hashtag #PSBlogWeek or the Twitter list created by Mike F Robbins.
Topic of the PBW: PowerShell Advanced Functions.
Here’s the list of bloggers who are involved, their Names, Twitter handles and their blog:
Stay tunned !!
Thanks for reading! If you have any questions, leave a comment or send me an email at fxcat@lazywinadmin.com. I invite you to follow me on Twitter @lazywinadm / Google+ / LinkedIn. You can also follow the LazyWinAdmin Blog on Facebook Page and Google+ Page.
But.. what is the PowerShell Blogging Week: This event was initiated by Jeffery Hicks and Adam Bertram and will focus on one PowerShell topic.
Each participants will be posting one article on his/her affected day, on their respective blog. You can follow the event by following the blogs bellow, using the twitter hashtag #PSBlogWeek or the Twitter list created by Mike F Robbins.
Topic of the PBW: PowerShell Advanced Functions.
Here’s the list of bloggers who are involved, their Names, Twitter handles and their blog:
Name
|
Twitter
|
Blog
|
---|---|---|
Adam Bertram | @adbertam | http://www.adamtheautomator.com/ |
Boe Prox | @proxb | http://learn-powershell.net/ |
Francois-Xavier Cat | @lazywinadm | http://www.lazywinadmin.com/ |
Jeffery Hicks | @jeffhicks | http://jdhitsolutions.com/blog/ |
June Blender | @juneb_get_help | http://www.sapien.com/blog/ |
Mike F. Robbins | @mikefrobbins | http://mikefrobbins.com/ |
Stay tunned !!
Thanks for reading! If you have any questions, leave a comment or send me an email at fxcat@lazywinadmin.com. I invite you to follow me on Twitter @lazywinadm / Google+ / LinkedIn. You can also follow the LazyWinAdmin Blog on Facebook Page and Google+ Page.
2015/03/01
Update: LazyTS v1.1
I found some time over the week-end to fix some bugs and add a few things to LazyTS. You'll now be able to quickly search though the displayed data using the small highlight util and open a Remote Desktop connection using the Shadow feature (View and Control)
See this link for more information about RDP Shadow.
Feature requests and Bugs report
I also want to thank those who are sending me features request and reporting bugs ! This is greatly helpful !!! Merci!! You can contact me using info (at) lazywinadmin.com
2015/03/04 Update: Fixed issue when using RDP Shadow and getting the error "This computer name is invalid"
2015/03/02 Update: Fixed a small issue where you got the following message : Exception setting "Item": "Exception calling "Set_Item" with "2" argument(s): "Cannot set Column 'CurrentTime' to be null. Please use DBNull instead."" This was related to an issue with ConvertTo-DataTable
See this link for more information about RDP Shadow.
What is LazyTS ?
LazyTS is a PowerShell script to manage Sessions and Processes on local or remote machines. It also allows you to Disconnect/Stop sessions and Send Interactive message to one or more sessions.
This tool is using the module PSTerminalService which relies on the Cassia .NET Library.I used Sapien PowerShell Studio 2014 to which make life easier if you want to start building WinForms tools and add PowerShell code.
LazyTS is a PowerShell script to manage Sessions and Processes on local or remote machines. It also allows you to Disconnect/Stop sessions and Send Interactive message to one or more sessions.
This tool is using the module PSTerminalService which relies on the Cassia .NET Library.I used Sapien PowerShell Studio 2014 to which make life easier if you want to start building WinForms tools and add PowerShell code.
Feature requests and Bugs report
I also want to thank those who are sending me features request and reporting bugs ! This is greatly helpful !!! Merci!! You can contact me using info (at) lazywinadmin.com
2015/03/04 Update: Fixed issue when using RDP Shadow and getting the error "This computer name is invalid"
2015/03/02 Update: Fixed a small issue where you got the following message : Exception setting "Item": "Exception calling "Set_Item" with "2" argument(s): "Cannot set Column 'CurrentTime' to be null. Please use DBNull instead."" This was related to an issue with ConvertTo-DataTable
2015/02/24
Two free live trainings from MVA on Desired State Configuration !
This week Microsoft Virtual Academy (also knows as MVA) will host two great live training events, one tomorrow and another one after tomorrow on Desired State Configuration.
If you are not familiar with MVA, It provides free online IT training & learning of Windows, Microsoft Technologies through courses designed by industry experts.
I did not play much with this new feature but I plan to invest more time into it in the next few weeks, this is definitely the future of system configuration management. If you are like me the two following events are a great way to start!
UPDATE: Videos are now available, see links below
If you are not familiar with MVA, It provides free online IT training & learning of Windows, Microsoft Technologies through courses designed by industry experts.
I did not play much with this new feature but I plan to invest more time into it in the next few weeks, this is definitely the future of system configuration management. If you are like me the two following events are a great way to start!
UPDATE: Videos are now available, see links below
What is Desired State Configuration ?
DSC is a new management platform in Windows PowerShell that enables deploying and managing configuration data for software services and managing the environment in which these services run.
DSC provides a set of Windows PowerShell language extensions, new Windows PowerShell cmdlets, and resources that you can use to declaratively specify how you want your software environment to be configured. It also provides a means to maintain and manage existing configurations.
Source: Technet
DSC is a new management platform in Windows PowerShell that enables deploying and managing configuration data for software services and managing the environment in which these services run.
DSC provides a set of Windows PowerShell language extensions, new Windows PowerShell cmdlets, and resources that you can use to declaratively specify how you want your software environment to be configured. It also provides a means to maintain and manage existing configurations.
Source: Technet
2015/02/15
Introducing WinFormPS: PowerShell module to interact with WinForms controls
I started to work on a PowerShell module called WinFormPS.
This module contains a few functions that let you interact with Windows Form controls such as DataGridView, ListBox or Button controls for example.
To build those forms I mostly use PowerShell Studio from Sapien but this can also work with any simple Form created from scratch.
The motivation to create User Interfaces has always been to ease the work of departments and teams with some of their heavy tasks, or simply to speed up some very repetitive processes. I definitely don't have a developer background, so please bear with me and feel free to critique or push update to the module on GitHub :-)
WinForms
Windows Forms (WinForms) is the name given to a graphical (GUI) class library included as a part of Microsoft .NET Framework, providing a platform to write rich client applications for desktop, laptop, and tablet. While it is seen as a replacement for the earlier and more complex C++ based Microsoft Foundation Class Library, it does not offer a comparable paradigm and only act as a platform for the user interface tier in a multi-tier solution. -Wikipedia
Windows Forms (WinForms) is the name given to a graphical (GUI) class library included as a part of Microsoft .NET Framework, providing a platform to write rich client applications for desktop, laptop, and tablet. While it is seen as a replacement for the earlier and more complex C++ based Microsoft Foundation Class Library, it does not offer a comparable paradigm and only act as a platform for the user interface tier in a multi-tier solution. -Wikipedia
2015/02/04
PowerShell Studio 2014/2015 - Editor Preset : Dark theme
Today a quick post to share one of the editor preset I created for Sapien PowerShell Studio.
Because I prefer to work with a dark theme, when installing PowerShell Studio, one of the first thing I do is to set my layout to Editor Only and put a Dark theme like the "Visual Studio 2013 Dark".
On the editor side, the tool come with a couple of preset but none of them are dark/black.
So I created my own...
Update: Adding details on how to change the PowerShell Studio theme and link to Anonymous Pro font
Download from GitHub
https://github.com/lazywinadmin/PowerShell/tree/master/_PowerShellStudio/EditorPresets
2015/01/18
I'm a SAPIEN MVP 2015
A few weeks ago, Sapien announced on their blog the introduction of the SAPIEN Most Valuable Professional (MVP) award. This program goal is to recognize and show their appreciation for community members who promote their products and contribute to their improvement and success.
And last week I received some unexpected great news from June Blender (SAPIEN Technologies Inc)!!
Congratulations! As a token of our appreciation for your help in the SAPIEN community, we have awarded you a SAPIEN MVP award for 2015."
If you follow my blog, you probably noticed that I've been playing with Sapien tools for a while now, mostly with the PrimalForms/PowerShell Studio products but also with the recent WMI Explorer. Some of my contributions include the creations of Youtube videos on how to create basic GUIs and I also got the chance to participate to the PowerShell Studio 2014 Beta program.
Thanks SAPIEN! It's great pleasure and honor to receive the SAPIEN MVP Award :-)
Sapien MVP Page - Francois-Xavier Cat
2015/01/17
PowerShell/SCSM - Change the Status of a Manual Activity or a Service Request.
Using the PowerShell module SMlets you can easily change the Status of a Ticket inside System Center Service Manager.
Here are the small bits of code to change the Status of a Manual Activity and a Service Request.
Here are the small bits of code to change the Status of a Manual Activity and a Service Request.
# Import the module Import-Module -Name smlets # Get a specific manual activity $ManualActivity = Get-SCSMObject -Class (Get-SCSMClass -Name System.WorkItem.Activity.ManualActivity$) -filter "ID -eq MA51163" # Change the status of the Manual Activity Set-SCSMObject -SMObject $ManualActivity -Property Status -Value Completed # Get a specific Service Request $ServiceRequest = Get-SCSMObject -Class (Get-SCSMClass -Name System.WorkItem.ServiceRequest$) -filter "ID -eq SR51160" # Change the status of the Service Request to Completed Set-SCSMObject -SMObject $ServiceRequest -Property Status -Value Completed
2015/01/10
PowerShell Studio 2014 - DataGridView Sorting
When creating graphical tools with PowerShell Studio 2014 and using the DataGridView control, I often find myself looking for the following tip!
The DataGridView control provides a customizable table for displaying data. You can extend the DataGridView control in a number of ways to build custom behaviors into your applications. A DataView provides a means to filter and sort data within a DataTable. The following example shows how to sort a DataGridView by using a DataTable Object.
In this example, I'm using PowerShell Studio 2014 from SAPIEN, you can download a 45 days trial version here.
The DataGridView control provides a customizable table for displaying data. You can extend the DataGridView control in a number of ways to build custom behaviors into your applications. A DataView provides a means to filter and sort data within a DataTable. The following example shows how to sort a DataGridView by using a DataTable Object.
In this example, I'm using PowerShell Studio 2014 from SAPIEN, you can download a 45 days trial version here.
2015/01/06
PowerShell Tip - PSReadLine shortcuts
PSReadLine is one of the module I've been using for a while now and I can't work without it anymore!!!!
2015/01/03
and that was 2014…
We just started 2015 so I figured it was the time to look back at what I did in the past 12 months.
I have some of stats which may be of interest, but of course also on a more personal level 2014 was an Awesome year !!
Achievements and Projects
Thanks for reading! If you have any questions, leave a comment or send me an email at fxcat@lazywinadmin.com. I invite you to follow me on Twitter @lazywinadm / Google+ / LinkedIn. You can also follow the LazyWinAdmin Blog on Facebook Page and Google+ Page.
I have some of stats which may be of interest, but of course also on a more personal level 2014 was an Awesome year !!
Achievements and Projects
- Became a Microsoft MVP for Windows PowerShell !! What an achievement!! And had the chance to attend my first Summit in November where I got to meet tons of other MVPs.
- Received the PowerShell Heroes 2014 recognition from PowerShell.org with 4 other people
- Joined Warner Brother Games studio in Montreal as a Senior System Administrator. My role is mostly focused on Automation and Microsoft Products
- Created the PowerShell Module NetBackupPS, which basically parse the output of the Symantec NetBackup cmd line tools. Unfortunately I don't have access to this solution so I can't really continue the development but the code in on GitHub and anybody is welcome to contribute.
- Created the PowerShell Module WinFormPS, which allows you to interact with some Winform controls.
- Created the PowerShell Module AdsiPS, which allows you to interact with Active Directory. Microsoft AD Module and Quest AD Snapin are really awesome but I wanted to develop my knowledge with Active Directory and play around with .NET Framework/LDAP Queries.
- Presented my first presentation on "How to get started with PowerShell" at my work office
Stats for my blog lazywinadmin.com for 2014:
- 39 Blog Posts
- +450 000 pageviews
- Top5 2014 blog posts:
Thanks for reading! If you have any questions, leave a comment or send me an email at fxcat@lazywinadmin.com. I invite you to follow me on Twitter @lazywinadm / Google+ / LinkedIn. You can also follow the LazyWinAdmin Blog on Facebook Page and Google+ Page.
Microsoft MVP 2015 for PowerShell !
What an Amazing way to start the year !!! It is a great pleasure and honor to receive the Microsoft Most Valuable Professional (MVP) Award for a second year for my contributions in Windows PowerShell. Can't wait to stack the 2015 ring on the MVP Award trophy!
HUGE Thank you to my family, friends and people who support me!!!
HUGE Thank you to my family, friends and people who support me!!!
Chère/Cher Francois-Xavier Cat,
Félicitations! Nous sommes heureux de vous remettre la récompense MVP Microsoft® 2015! Cette récompense est accordée aux leaders d'exception de la communauté technique qui partagent activement leur expertise pratique de grande qualité. Nous apprécions vos remarquables contributions dans les communautés techniques PowerShell lors de cette année passée.
Subscribe to:
Posts (Atom)