Category Archives: Categories

msRTCSIP-GroupingID editor.

This is my msRTCSIP-GroupingID editor. I use it to segregate addresslists in Lync solutions. It takes a commaseparated text file containing Company name and GUID for the addresslist assigned to this Company (filename : groupingids.txt) sample:

Name,Value
CompanyA,00000000-0000-0000-0000-000000000010
CompanyB,00000000-0000-0000-0000-000000000011
CompanyC,00000000-0000-0000-0000-000000000012

I have placed this file on the Lync share for my own convenience. Powershell script Groupingeditor.ps1 loads these values to a listbox. It let you search for users and then apply the groupingID to the selected users.

Next Version will contain possibillities to select entire OU’s and list users containing a spesific GroupingID.

GROUPINGEDITOR

groupingids.txt (153B)

groupingeditor.ps1 (4.7KB)

Outlook Roomlist and workinghours.

When using booking assistent and roomlist meeting rooms does not always show in the list as expected. One reason for this is that user make a default invitation and by default the meeting time is this morning witch is already passed. Another thing is that default working hour for the meeting room is 08:00 to 17:00 – outside this the room will not show in the roomlist.

workinghours

Use get-mailboxcalendarconfiguration to get workinghours for a room / mailbox.

Segregating addresslists in Lync

To segregate companies in Lync we would use the msRTCSIP-GroupingID attribute on the user Object.

Default value for this attibute is “<not set>”

2

This would as expected result in the default addresslist 00000…….

1

If we add a value to the attribute i.e : 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF

4

3

After adding this new value I would normally run :> update-csaddresslist

We now get a new a addresslist based on the msRTCSIP-GroupingID value.

5

This will be the addresslist users searches from Lync.

 

Group Manager in Exchange 2010-2013 are unable to manage group membership.

There was a change in RBAC. Group managers are not able to add or remove members of a distribution Group even if it seems so in the Exchange Management Console.

The only options in ECP was to give them the additional permission to great and remove groups. You can create a new role that will enable this permission again. Thanks to Matthew Byrd at Microsoft who has created a Powershell script that does this for us.

http://blogs.technet.com/b/exchange/archive/2009/11/18/how-to-manage-groups-that-i-already-own-in-exchange-2010.aspx

Exchange 2013 move mailbox staus : StalledDueToCI

Tried to move a mailbox from Exchange 2010 to Exchange 2013, but the job would take forever. Status for the job was “StalledDueToCI” ( Get-MoveRequest | Get-MoveRequestStatistics | ft mailboxidentity,status ). I suspected this had something to do with ContentIndexing. And infact it does. Tried to reset Search index for the database containing the failed mailbox.

To reset Exchange search index for a database:

1.Stop Exchange search services:

2.Delete the search folder. Usually a folder inside the folder containing the database.

3.Start Exchange search service.

4. Check Index crawler status to see when it has finished: Get-MailboxDatabaseCopyStatus -Server <servername>| FL Name,*Index*

This worked for some short time. But it would fall back to failed.

After some time searching the Internet found some people claiming that this is a bug and that you would have to create a group i Active Directory named ContentSubmitters. After Checking Exchange Setup Validation http://technet.microsoft.com/en-us/library/bb125224(v=exchg.150).aspx I did not find this group mentioned. 

I do not like to do anything whitout knowing why so I tried to find a Microsoft  article describing this issue. And there it is : http://support.microsoft.com/kb/2807668

Turned out there are 2 solutions to the problem.

1. Create the Active Directory group.

Or.

2. Disable Exchange 2013 from using/checking the group existense.

List members of dynamic groups show incorrect members.

If you use PowerShell to list members of dynamic distribution Groups in Exchange 2013 you would probably see more entries than expected. The PowerShell commands

$dgr=Get-DynamicDistributionGroup “GroupNAme”
Get-Recipient -RecipientPreviewFilter $dgr.RecipientFilter

does not take in to consideration OU filtering. If you look at $dgr.RecipientFiler it only contains the other attributes.

I do not know if this is a bug or by design.

Script to delete files older thans x days

This script will delete files older than 10 days.

$Now = Get-Date
$LastWrite = $Now.AddDays(-10)
$Files = get-childitem -Path “C:\folder_with_files_to_delete” |Where {$_.CreationTime -le $LastWrite}
foreach ($File in $Files)
{Remove-Item -Path $File -Force}

Save this script as “c:\scripts\deleteoldfiles.ps1”

In schedule task select program/script to run : “C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe”

and use : -command “c:\scripts\deleteoldfiles.ps1” as argument

Remember you has to set the execution policy to allow this script to run. (set-executionpolicy -executionpolicy remotesigned)

Update:

For PowerShell 1.0 and filter on file Attribute:

# Written by  Atle Vatland @ Cegal AS
# Remember to change path,attribute and fileextension.
# When tested OK – remove  WHATIF from Remove-item and the files will be deleted.
# Schedule a task.
# Save this script as “c:\scripts\filename.ps1”
# In schedule task select program/script to run : “C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe”
# and use : -command “c:\scripts\filename.ps1” as argument
# Remember you has to set the execution policy to allow this script to run. (set-executionpolicy -executionpolicy remotesigned)
 

$Now = Get-Date
$LastWrite = $Now.AddDays(-14)
$Files = get-childitem -Path “E:\filepath\*” -include *.ext |Where {$_.LastWriteTime -le $LastWrite}
$Today= ” ———================== Files deleted ” + $Now + “====================——————–”
$Today | Out-File -filepath c:\scripts\deletedfiles.log -Append
foreach ($File in $Files)

{
$FI=get-item $File
 if($FI.Attribute -notlike “*Archive*”){
  $File | ft -HideTableHeaders | out-file -filepath c:\scripts\deletedfiles.log -Append;remove-item $File -whatif
 }
}