POWERSHELL   Powershell – Could not create SSL/TLS secure channel



I use Powershell to send monitoring results to the Icinga API (passive checks). For example, to check if the Exchange backups were processed correctly, I run a Exchange powershell and then the results are sent using “Invoke-WebRequest” command.

Since I disabled obsolete and insecure TLSv1 and TLSv1.1 protocols in the Exchange server, the script was not working anymore returning error:… Read more

   Exchange – Bulk import of distribution group members from csv



A short but useful post:

Suppose you need to import hundreds of members to a distribution group.
The list is in a CSV file:

Name,Email
user1,user1@domain1.com
user2,user2@domain2.com
user3,user3@domain3.com
user4,user4@domain4.com
user5,user5@domain5.com
user6,user6@domain6.com
user7,user7@domain7.com
user8,user8@domain8.com
user9,user9@domain9.com
user10,user10@domain10.com
user11,user11@domain11.com
user12,user12@domain12.com
user13,user13@domain13.com
user14,user14@domain14.com
user15,user15@domain15.com
user16,user16@domain16.com
user17,user17@domain17.com
user18,user18@domain18.com
...

To bulk import all the users, a simple command like this is enough:… Read more

EXCHANGE   Exchange – Cannot remove exchange certificate



Some days ago I tried to cleanup old certificates from my Exchange servers, but I received the following error:

Exchange - Cannot remove exchange certificate

[PS] C:\> Remove-ExchangeCertificate -Thumbprint D09EDD6D5F18C175254AB97046AAAAAAAAAAAAA

Confirm
Are you sure you want to perform this action?
Remove certificate with thumbprint DD09EDD6D5F18C175254AB97046AAAAAAAAAAAAA from the computer's certificate store?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [?] Help (default is 
Read more

EXCHANGE   Exchange – Setting automatic completion time for Mailbox Move Request



When performing mailbox migrations using the New-MoveRequest, the movement is performed online while the user is using the mailbox without suffering outage until the end.
Only when completing the movement there are some seconds during which the user mailbox is not online.

Thats the reason to use the parameter “SuspendWhenReadyToComplete“. It moves almost all the mailbox except the … Read more

EXCHANGE   Exchange – Mailbox folders permissions to other users



A user asked me the way to grant permissions to other users to access to some of his mailbox folders. And for certain folder only read-only permissions.

Let’s suppose “testuser1” wants to allow accessing some folders to “testuser2”.

Permission configuration (Outlook)

First of all, “testuser2” must have “Reviewer” (read-only) permissions on the mailbox root
Exchange – Mailbox folders permissions to other users 1

Exchange – Mailbox folders permissions to other users 2

Then, configure the permission … Read more

POWERSHELL   Powershell – Script to clone AD groups



Last week I came across a situation where I needed to copy Active Directory groups (including members) as new groups.

Scenario

Suppose we want to clone the “SG-Test1” and “SG-Test2” groups
Windows – Powershell script to clone AD groups - Old Groups

We need two groups (“SG-NewTest1” and “SG-NewTest2”) to be created with the same members included
Windows – Powershell script to clone AD groups - New Groups

Using this powershell scripts you can either clone a single group a list … Read more

POWERSHELL   Powershell – Schedule a task on a list of servers remotely



Maybe you have been interested in configuring a scheduled task on a set of servers of your enviroment. Depending on the quantity it can become a tedious… or a reeeaaaaally tedious process (connect to every server, run "scheduled tasks" console, configure…)

So, as we, sysadmins, usually do… let's make the work easier using scripts…

In this example, the goal is Read more

Lync   Lync – Monitor services status using Nagios



This post shows a Powershell script I use to monitor the status of my Lync services.
This state can be manually checked on the Lync console (Lync 2010 in my scenario):
Lync - Monitor services status using Nagios_1

And with the Get-CsWindowsService powershell command:

PS C:\> Get-CsWindowsService

Status   Name            ActivityLevel
------   ----            -------------
Running  MASTER
Running  REPLICA
Running  RTCSRV          Incoming Requests per Second=0,Mess...
Running  RTCCAA          Concurrent Calls=0
Read more

POWERSHELL   Powershell – Example of recursive function



A recursive functions is a function that makes a call to itself. Recursion is usually used to process tree-like or nested structures with much simpler code than using iterative functions.

This post shows an example in which we need to count the number of files of a folder and each subfolders.
When processed this structure of folders…
Powershell - Example of recursive function

…this is the … Read more