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) to 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 – Script to move profile folders



Sometimes we need to move the profiles to a new folder, drive… due to space requirements for example.
The usual way is via the graphical interface:
Powershell - Script to move profile folders 1

But performing this action for a set of users can take us a lot of time and, as a sysadmin should think, the best way to complete this tasks is to work some … 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

POWERSHELL   Powershell – Get-Content error if filename contains brackets



I needed to get the first 5 bytes of a file using the powershell:

PS D:\> Get-Content "D:\TEST\file.txt" -Encoding byte -TotalCount 5
102
100
115
97
102

But for some files the Get-Content command returns the following error "A parameter cannot be found that matches parameter name 'Encoding'"

PS D:\Scripting\CORRUPT> Get-Content "D:\TEST\file[1].txt" -Encoding byte -TotalCount 5
Get-Content : A parameter 
Read more

   Exchange 2013 – Exporting/importing mailboxes to a PST via Powershell



Stop using Outlook to export and/or import PST for your mailboxes. By using the Powershell commands (New-MailboxExportRequest and New-MailboxImportRequest) I have saved much time. And they come with some useful options.

Here some simple and interesting examples:

Simple mailbox export

[PS] C:\> New-MailboxImportRequest -Mailbox "user1" -FilePath "\\MYSERVER\PST\user1.pst"

The path must be an UNC path, a shared folder. After executing the … Read more

EXCHANGE   Exchange 2013 – Assign permissions to book room resources



I created some room mailboxes in Exchange 2010 and gave book permissions to some users using EMC (Exchange Management Console).

Now, after migrating all my mailboxes to Exchange 2013, I need to change some permissions on the room mailboxes. But no way to perform the changes in the web console.

The only way to view and modify booking permissions is Read more

POWERSHELL   Powershell – Excel reports automation (I)



Powershell can be very useful to extract data from our systems.
Excel can be very useful to show that data in a friendly way.
Powershell + Excel = Automatic generation of useful reports

These are the basic powershell sentences and functions needed to start generating our Excel reports using Powershell scripts:

Excel COM object

It is neccesary to reference a … Read more