Apr 19

PowerShell is life

Since it came out, I was using little of PowerShell, but as time went by, I saw the potential of it and I am now barely using GUI mode to make changes now. PowerShell has become my most used way to update info on servers.

  1. I use it for Exchange almost for everything, in conjunction with the RDP restrictions I have now, PowerShell improve my speed by hours.
  2. For Active Directory as I managed new users and change.
  3. Files - search files, move, copy
  4. Bitlocker - alot easier than managed-bde and these is nothing in GUI anyway
  5. Profiles - I have some scripts that I managed user profile in Windows
  6. Reports - when I have to find information and get a report, I use PowerShell too.
  7. Disk - I used to go to diskpart but with PowerShell I can play with data more easily which is what I love.

As an example, today I had to remove all members of a couple of groups. Normally, you could go to ADUC select the group then select all users and click remove and move to the other but today, I did this

$iGroup = Get-ADUsers | ? {$_.Name -like "Internet*"}

Foreach($group in $iGroup){

Get-ADGroupMember | Foreach-Object { Remove-ADGroupMember $group $_ -Confirm:$false -Whatif}


PS : I added a -whatif in the syntax so if you try that it won't actually execute it will just emulate it. Save people from doing errors

I know that most people don't find that line or synthax easy but it took me less than. 5 minutes to write from scratch and it would have taken 20 to so in the GUI. So I call that a win. The more you code as PowerShell the easiest it become. It's really a matter of understanding the logic behind.

So for now thats it. But I will try to post more often.

Feb 19

De retour

Je vais recommencer a bloguer, voyons si je vais avoir du temps

Après plusieurs années...