PowerShell Archives - Thoughts https://blog.jstassen.com/tag/powershell/ A place for collecting my miscellaneous thoughts. Fri, 13 Dec 2013 08:25:56 +0000 en-US hourly 1 https://wordpress.org/?v=7.0.7 92836340 Script: PowerShell Calendar Rights https://blog.jstassen.com/2013/03/script-powershell-calendar-rights/ https://blog.jstassen.com/2013/03/script-powershell-calendar-rights/#respond Sat, 16 Mar 2013 00:47:52 +0000 http://blog.jstassen.com/?p=170 Here is a great snip-it of PowerShell script for granting a user rights to view (or even modify) all user calendars in an organization. Excellent for managers. Get-Mailbox | ForEach {Add-MailboxFolderPermission $_":\Calendar" -User email@address.com -AccessRights Reviewer}

The post Script: PowerShell Calendar Rights appeared first on Thoughts.

]]>
Here is a great snip-it of PowerShell script for granting a user rights to view (or even modify) all user calendars in an organization. Excellent for managers.

Get-Mailbox | ForEach {Add-MailboxFolderPermission $_":\Calendar"
-User email@address.com -AccessRights Reviewer}

The post Script: PowerShell Calendar Rights appeared first on Thoughts.

]]>
https://blog.jstassen.com/2013/03/script-powershell-calendar-rights/feed/ 0 170
Grouping Mailboxes with PowerShell https://blog.jstassen.com/2013/01/grouping-mailboxes-with-powershell/ https://blog.jstassen.com/2013/01/grouping-mailboxes-with-powershell/#respond Mon, 14 Jan 2013 04:12:32 +0000 http://blog.jstassen.com/?p=15 Here is a snip-it of PowerShell Code I am using to group and count the number of mailboxes on an Microsoft Exchange Server 2008 using CustomAttribute1. On our server we have a unique ID stored in the CustomAttribute1 for mailboxes that belong to different groupings. For example in the CustomAttribute1 we store the company ID, … Continue reading Grouping Mailboxes with PowerShell →

The post Grouping Mailboxes with PowerShell appeared first on Thoughts.

]]>
Here is a snip-it of PowerShell Code I am using to group and count the number of mailboxes on an Microsoft Exchange Server 2008 using CustomAttribute1.

On our server we have a unique ID stored in the CustomAttribute1 for mailboxes that belong to different groupings. For example in the CustomAttribute1 we store the company ID, in CustomAttribute2 we may store the service level they pay for. We found the need to keep a count of the number of mailboxes belonging to different companies.

$CountMembers = @{}
Get-Mailbox | foreach-object {$CountMembers[$_.CustomAttribute1]++}
$CountMembers

Naturally from here we can append the | Out-File Report.txt to save to a txt file. Ideally I would like to export to a csv, however this data format doesn’t support that. I may look further into this in the future.

We can use this method to group mailboxes by any common attribute actually. Say the count the number of mailboxes on each database using $_.Database

The post Grouping Mailboxes with PowerShell appeared first on Thoughts.

]]>
https://blog.jstassen.com/2013/01/grouping-mailboxes-with-powershell/feed/ 0 15