Created
November 10, 2015 14:37
-
-
Save torgro/ae158ae650bd69fd2940 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $users = Get-ADGroupMember G_Email_Archive_2013 | Select-Object -ExpandProperty name | |
| foreach ($user in $users) | |
| { | |
| # Extract Mailbox GUID and pipe to variable $GUID | |
| $GUID = Get-Mailbox $user | select ExchangeGUID | |
| $customAttrib3 = Get-Mailbox -Identity $user -CustomAttribute3 -ErrorAction SilentlyContinue | |
| if($customAttrib3) | |
| { | |
| #dersom CustomAttrib3 har verdi, så kan vi gjøre noe her | |
| } | |
| else | |
| { | |
| #customattrib3 er tom, sett verdi | |
| set-mailbox $user -CustomAttribute3 "iXOS-EXLK:/{$($GUID.ExchangeGuid)}" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment