This is old. It still works, but it’s old and I have a much better version I’ll be sharing at some point.
We migrated our environment to Office 365 last year and it’s been a bit of a challenge to say the least. After they upgraded our tenant to Exchange 2013 however, the online GUI gives a good amount of management ability but still lacks in a couple areas. One being with individual calendar permissions and the other being able to grant/remove Full Access to a mailbox as well as opting to Auto-Map the mailbox or not. You can do this all through Powershell but to make things easier, I wrote a basic GUI to manage such tasks. The code is available below but you can download the script here.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 |
######################################################## ############ Exchange Online Permissions ############### ############ Jeff Irvine 11-24-14 ############### ############ techmological.com ############### ######################################################## [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | Out-Null #Add-Type -AssemblyName System.Windows.Forms $Form = New-Object system.Windows.Forms.Form $Form.Text = "Manage Mailbox permissions" $Form.ControlBox = $False $Form.Width = 800 $Form.Height = 750 $Form.MaximizeBox = $False $Form.WindowState = "Normal" # Maximized, Minimized, Normal $Form.SizeGripStyle = "Hide" # Auto, Hide, Show $Form.StartPosition = "CenterScreen" # CenterScreen, Manual, WindowsDefaultLocation, WindowsDefaultBounds, CenterParent # Create the tabcontrol $tabcontrol = New-Object windows.Forms.TabControl $tabpage_perm = New-Object windows.Forms.TabPage $tabpage_adv = New-Object windows.Forms.TabPage $tabcontrol.Location = New-Object system.Drawing.Size(10,20) $tabcontrol.width = 765 $tabcontrol.Height = 680 #Set TabPages $tabpage_perm.Text = "Calendar Permissions" $tabpage_adv.Text = "Full Access Permissions" #Check Windows Management Framework version Function WSManStackVersionTest { $WMFVer = $PSVersionTable.WSManStackVersion.Major if ($WMFVer -lt 3) { $WrongVer = "Incorrect version of Windows Management Framework detected. 3.0 or higher is required." $wshell = New-Object -ComObject Wscript.Shell $wshell.Popup($WrongVer,0,"Incorrect Version",0 + 16) exit } } Function WSManStackVersion { $WMFVer = $PSVersionTable.WSManStackVersion.Major if ($WMFVer -lt 3) { [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | Out-Null $WMFVerForm = New-Object system.Windows.Forms.Form $WMFVerForm.Text = "Incorrect version" $WMFVerForm.ControlBox = $false $WMFVerForm.Width = 400 $WMFVerForm.Height = 200 $WMFVerForm.MaximizeBox = $false $WMFVerForm.SizeGripStyle = "Hide" $WMFVerForm.StartPosition = "CenterScreen" $WMFVerForm_Label = New-Object System.Windows.Forms.Label $WMFVerForm_Label.Location = New-Object System.Drawing.Size(10,20) $WMFVerForm_Label.Width = 370 $WMFVerForm_Label.Height = 50 $WMFVerForm_Label.Text = "Incorrect version of Windows Management Framework detected. 3.0 or higher is required!" $WMFVerForm.Controls.Add($WMFVerForm_Label) $WMFVerForm_Button = New-Object System.Windows.Forms.Button $WMFVerForm_Button.Location = New-Object System.Drawing.Size(75,100) $WMFVerForm_Button.Size = New-Object System.Drawing.Size(150,25) $WMFVerForm_Button.Text = "Download from Microsoft" $WMFVerForm_Button.Add_Click({[System.Diagnostics.Process]::Start("http://www.microsoft.com/en-us/download/details.aspx?id=40855"); $WMFVerForm.close()}) $WMFVerForm.Controls.Add($WMFVerForm_Button) $WMFVerForm_Close = New-Object System.Windows.Forms.Button $WMFVerForm_Close.Location = New-Object System.Drawing.Size(240,100) $WMFVerForm_Close.Size = New-Object System.Drawing.Size(70,25) $WMFVerForm_Close.Text = "Cancel" $WMFVerForm_Close.Add_Click({$WMFVerForm.close()}) $WMFVerForm.Controls.Add($WMFVerForm_Close) $WMFVerForm.ShowDialog() exit } } #Connect to Exchange Online Function LoadExchangeOnline { $Error.Clear() $URL = "https://outlook.office365.com/powershell-liveid/?proxymethod=rps" $cred = Get-Credential -Message "Enter your Office 365 admin credentials" $EXOSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri $URL -Credential $cred -Authentication Basic -AllowRedirection -Name "Exchange Online" Import-PSSession $EXOSession trap { $a = new-object -comobject wscript.shell $intAnswer = $a.popup("Connecting to Exchange Online failed. Try again?",0,"Failed",5 + 48) If ($intAnswer -eq 4) { LoadExchangeOnline } else { Exit } #Button Types # #Value Description #0 Show OK button. #1 Show OK and Cancel buttons. #2 Show Abort, Retry, and Ignore buttons. #3 Show Yes, No, and Cancel buttons. #4 Show Yes and No buttons. #5 Show Retry and Cancel buttons. } } #Disconnects the Exchange Online Session Function Disconnect-EXOnline { Remove-PSSession -Name "Exchange Online" } #Tests for the availability of the Exchange Online cmdlets Function TestConnection { $Connected="Connected to Exchange Online!" $NotConnected="You are not connected to Exchange Online!" if (Get-Command | Where-Object {$_.Name -eq "Get-MailboxFolder"}) { $ConnectStatus.Text = $Connected $ConnectStatus.ForeColor = "Green" $ConnectStatus.Location = New-Object System.Drawing.Size(310,5) } else { $ConnectStatus.Text = $NotConnected $ConnectStatus.ForeColor = "Red" $ConnectStatus.Location = New-Object System.Drawing.Size(280,5) } } #Displays Calendar permissions only Function SearchMailbox { $Error.Clear() $userEmail=$searchBox_perm.text $outputBox_perm.Text="Searching..." $Result = Get-MailboxFolderPermission -Identity ${userEmail}:\Calendar | Out-String $outputBox_perm.Text=$Result $searchErrorLabel_perm.Text=$Error #$wshell = New-Object -ComObject Wscript.Shell #$wshell.Popup($Error,0,"Done",0x0) } #Displays Full Access permissions for a Mailbox Function SearchFullAccessMailbox { $Error.Clear() $userEmail_adv=$searchBox_adv.text $outputBox_adv.Text="Searching..." $Result_adv = Get-MailboxPermission -Identity ${userEmail_adv} | where {($_.AccessRights -eq "FullAccess") -and ($_.IsInherited -eq $false)} | select User, AccessRights | Out-String $outputBox_adv.Text=$Result_adv $searchErrorLabel_adv.Text=$Error #$wshell = New-Object -ComObject Wscript.Shell #$wshell.Popup($Error,0,"Done",0x0) } #Removes Calendar permissions only Function RemoveUser { $Error.Clear() $rUser=$rUserBox_perm.Text $ruserCalendar_perm=$rCalUserBox_perm.Text $removeStatus_perm = Remove-MailboxFolderPermission -Identity ${ruserCalendar_perm}:\Calendar -User $rUser -confirm: $False | Out-String $removeOutBox_perm.Text="Completed!" $removeOutBox_perm.ForeColor = "Green" $removeErrorLabel_perm.Text=$Error #$wshell = New-Object -ComObject Wscript.Shell #$wshell.Popup($Error,0,"Done",0x0) } #Removes Full Access permissions from a Mailbox Function RemoveFullAccessUser { $Error.Clear() $rUser=$rUserBox_adv.Text $ruserCalendar_adv=$rCalUserBox_adv.Text $removeStatus_adv = Remove-MailboxPermission -Identity ${ruserCalendar_adv} -User $rUser -AccessRights FullAccess -InheritanceType All -confirm: $False | Out-String $removeOutBox_adv.Text="Completed!" $removeOutBox_adv.ForeColor = "Green" $removeErrorLabel_adv.Text=$Error #$wshell = New-Object -ComObject Wscript.Shell #$wshell.Popup($Error,0,"Done",0x0) } #Adds Calendar permissions Function AddUser { if ($limitedDetailsButton_perm.Checked -eq $true) {$rights="LimitedDetails"} if ($reviewerButton_perm.Checked -eq $true) {$rights="Reviewer"} if ($publishingAuthorButton_perm.Checked -eq $true) {$rights="PublishingAuthor"} $Error.Clear() $aUser=$aUserBox_perm.Text $auserCalendar=$aCalUserBox_perm.Text $addStatus_perm = Add-MailboxFolderPermission -Identity ${auserCalendar}:\Calendar -User $aUser -AccessRights $rights -confirm: $False | Out-String $addOutBox_perm.Text=$addStatus_perm $addErrorLabel_perm.Text=$Error #$wshell = New-Object -ComObject Wscript.Shell #$wshell.Popup($Error,0,"Done",0x0) } #Adds Full Access permissions to Mailbox Function AddFullAccessUser { $Error.Clear() $aMBUser=$aMBUserBox_adv.Text $aFAUser=$aUserBox_adv.Text if ($autoMapBox.Checked -eq $true) { Add-MailboxPermission -Identity ${aMBUser} -User $aFAUser -AccessRights FullAccess -InheritanceType All -AutoMapping $true -confirm: $False } else { Add-MailboxPermission -Identity ${aMBUser} -User $aFAUser -AccessRights FullAccess -InheritanceType All -AutoMapping $false -confirm: $False } $addOutBox_adv.Text = "Completed!" $addOutBox_adv.ForeColor = "Green" $addErrorLabel_adv.Text=$Error } $Form.Controls.Add($tabcontrol) $tabcontrol.tabpages.add($tabpage_perm) $tabcontrol.tabpages.add($tabpage_adv) #----------End top section------------------------------------------------------------------ #################################################################### #################################################################### #----------Begin Calendar permission search section $topLabel_perm = New-Object System.Windows.Forms.Label $topLabel_perm.Location = New-Object System.Drawing.Size(260,20) $topLabel_perm.Text = "List permissions added to a specified Calendar" $topLabel_perm.AutoSize = $True $tabpage_perm.Controls.Add($topLabel_perm) $ConnectStatus = New-Object System.Windows.Forms.Label $ConnectStatus.Size = New-Object System.Drawing.Size(300,50) $Form.Controls.Add($ConnectStatus) #SearchGroupBox1 $SearchgroupBox_perm = New-Object System.Windows.Forms.GroupBox $SearchgroupBox_perm.Location = New-Object System.Drawing.Size(200,50) $SearchgroupBox_perm.Size = New-Object System.Drawing.Size(360,50) $SearchgroupBox_perm.Text = "Mailbox to search" $tabpage_perm.Controls.Add($SearchgroupBox_perm) $searchBox_perm = New-Object System.Windows.Forms.TextBox $searchBox_perm.Location = New-Object System.Drawing.Size(10,20) $searchBox_perm.Size = New-Object System.Drawing.Size(250,25) $SearchgroupBox_perm.Controls.Add($searchBox_perm) $searchBtn_perm = New-Object System.Windows.Forms.Button $searchBtn_perm.Location = New-Object System.Drawing.Size(280,16) $searchBtn_perm.Size = New-Object System.Drawing.Size(70,25) $searchBtn_perm.Text = "Search" $searchBtn_perm.Add_Click({SearchMailbox}) $SearchgroupBox_perm.Controls.Add($searchBtn_perm) #-----------RESULTS------------ $outputBox_perm = New-Object System.Windows.Forms.TextBox $outputBox_perm.Location = New-Object System.Drawing.Size(10,120) $outputBox_perm.Size = New-Object System.Drawing.Size(740,150) $outputBox_perm.Font = New-Object System.Drawing.Font("Consolas",8,[System.Drawing.FontStyle]::Regular) $outputBox_perm.MultiLine = $True $outputBox_perm.ScrollBars = "Vertical" $outputBox_perm.ReadOnly = $True $tabpage_perm.Controls.Add($outputBox_perm) $searchErrorLabel_perm = New-Object System.Windows.Forms.Label $searchErrorLabel_perm.Location = New-Object System.Drawing.Size(10,275) $searchErrorLabel_perm.Size = New-Object System.Drawing.Size(300,50) $searchErrorLabel_perm.ForeColor = "Red" $tabpage_perm.Controls.Add($searchErrorLabel_perm) #Clear button $clearBtn_perm = New-Object System.Windows.Forms.Button $clearBtn_perm.Location = New-Object System.Drawing.Size(600,275) $clearBtn_perm.Size = New-Object System.Drawing.Size(70,25) $clearBtn_perm.Text = "Clear" $clearBtn_perm.Add_Click({$searchBox_perm.Text=$null, $outputBox_perm.Text=$null, $searchErrorLabel_perm.Text=$null}) $tabpage_perm.Controls.Add($clearBtn_perm) #Exit button $exitBtn_perm = New-Object System.Windows.Forms.Button $exitBtn_perm.Location = New-Object System.Drawing.Size(680,275) $exitBtn_perm.Size = New-Object System.Drawing.Size(70,25) $exitBtn_perm.Text = "Exit" $exitBtn_perm.Add_Click({Disconnect-EXOnline $Form.close()}) $tabpage_perm.Controls.Add($exitBtn_perm) #----------------End Search section #----------------BEGIN Remove Calendar permissions section------------- $removeGroupBox_perm = New-Object System.Windows.Forms.GroupBox $removeGroupBox_perm.Location = New-Object System.Drawing.Size(10,350) $removeGroupBox_perm.Size = New-Object System.Drawing.Size(300,300) $removeGroupBox_perm.Text = "Remove user permissions from Calendar" $tabpage_perm.Controls.Add($removeGroupBox_perm) $rUserLabel_perm = New-Object System.Windows.Forms.Label $rUserLabel_perm.Location = New-Object System.Drawing.Size(10,20) $rUserLabel_perm.Size = New-Object System.Drawing.Size(280,20) $rUserLabel_perm.Text = "Remove the following user:" $removeGroupBox_perm.Controls.Add($rUserLabel_perm) $rUserBox_perm = New-Object System.Windows.Forms.TextBox $rUserBox_perm.Location = New-Object System.Drawing.Size(10,40) $rUserBox_perm.Size = New-Object System.Drawing.Size(280,20) $removeGroupBox_perm.Controls.Add($rUserBox_perm) $rCalUserLabel_perm = New-Object System.Windows.Forms.Label $rCalUserLabel_perm.Location = New-Object System.Drawing.Size(10,70) $rCalUserLabel_perm.Size = New-Object System.Drawing.Size(280,20) $rCalUserLabel_perm.Text = "from this Calendar:" $removeGroupBox_perm.Controls.Add($rCalUserLabel_perm) $rCalUserBox_perm = New-Object System.Windows.Forms.TextBox $rCalUserBox_perm.Location = New-Object System.Drawing.Size(10,90) $rCalUserBox_perm.Size = New-Object System.Drawing.Size(280,20) $removeGroupBox_perm.Controls.Add($rCalUserBox_perm) #Clear button $rClearBtn_perm = New-Object System.Windows.Forms.Button $rClearBtn_perm.Location = New-Object System.Drawing.Size(140,120) $rClearBtn_perm.Size = New-Object System.Drawing.Size(70,25) $rClearBtn_perm.Text = "Clear" $rClearBtn_perm.Add_Click({$rUserBox_perm.Text=$null, $rCalUserBox_perm.Text=$null, $removeOutBox_perm.Text=$null, $removeErrorLabel_perm.Text=$null}) $removeGroupBox_perm.Controls.Add($rClearBtn_perm) #Remove button $removeBtn_perm = New-Object System.Windows.Forms.Button $removeBtn_perm.Location = New-Object System.Drawing.Size(220,120) $removeBtn_perm.Size = New-Object System.Drawing.Size(70,25) $removeBtn_perm.Text = "Remove" $removeBtn_perm.Add_Click({RemoveUser}) $removeGroupBox_perm.Controls.Add($removeBtn_perm) #-----------Removal RESULTS------------ $removeResultsLabel_perm = New-Object System.Windows.Forms.Label $removeResultsLabel_perm.Location = New-Object System.Drawing.Size(10,150) $removeResultsLabel_perm.Size = New-Object System.Drawing.Size(280,20) $removeResultsLabel_perm.Text = "Results:" $removeGroupBox_perm.Controls.Add($removeResultsLabel_perm) $removeOutBox_perm = New-Object System.Windows.Forms.Label $removeOutBox_perm.Location = New-Object System.Drawing.Size(10,170) $removeOutBox_perm.Size = New-Object System.Drawing.Size(280,50) $removeOutBox_perm.Font = New-Object System.Drawing.Font("Consolas",8,[System.Drawing.FontStyle]::Regular) $removeGroupBox_perm.Controls.Add($removeOutBox_perm) $removeErrorLabel_perm = New-Object System.Windows.Forms.Label $removeErrorLabel_perm.Location = New-Object System.Drawing.Size(10,235) $removeErrorLabel_perm.Size = New-Object System.Drawing.Size(280,50) $removeErrorLabel_perm.ForeColor = "Red" $removeGroupBox_perm.Controls.Add($removeErrorLabel_perm) #-----------End Removal section #-----------BEGIN Add Calendar permissions section------------- $addGroupBox_perm = New-Object System.Windows.Forms.GroupBox $addGroupBox_perm.Location = New-Object System.Drawing.Size(330,350) $addGroupBox_perm.Size = New-Object System.Drawing.Size(420,300) $addGroupBox_perm.Text = "Add user permissions to Calendar" $tabpage_perm.Controls.Add($addGroupBox_perm) $aUserLabel_perm = New-Object System.Windows.Forms.Label $aUserLabel_perm.Location = New-Object System.Drawing.Size(10,20) $aUserLabel_perm.Size = New-Object System.Drawing.Size(260,20) $aUserLabel_perm.Text = "Add the following user:" $addGroupBox_perm.Controls.Add($aUserLabel_perm) $aUserBox_perm = New-Object System.Windows.Forms.TextBox $aUserBox_perm.Location = New-Object System.Drawing.Size(10,40) $aUserBox_perm.Size = New-Object System.Drawing.Size(260,20) $addGroupBox_perm.Controls.Add($aUserBox_perm) $aCalUserLabel_perm = New-Object System.Windows.Forms.Label $aCalUserLabel_perm.Location = New-Object System.Drawing.Size(10,70) $aCalUserLabel_perm.Size = New-Object System.Drawing.Size(260,20) $aCalUserLabel_perm.Text = "to this Calendar:" $addGroupBox_perm.Controls.Add($aCalUserLabel_perm) $aCalUserBox_perm = New-Object System.Windows.Forms.TextBox $aCalUserBox_perm.Location = New-Object System.Drawing.Size(10,90) $aCalUserBox_perm.Size = New-Object System.Drawing.Size(260,20) $addGroupBox_perm.Controls.Add($aCalUserBox_perm) $limitedDetailsButton_perm = New-Object Windows.Forms.radiobutton $limitedDetailsButton_perm.Text = "Limited Details" $limitedDetailsButton_perm.height = 20 $limitedDetailsButton_perm.width = 120 $limitedDetailsButton_perm.Top = 40 $limitedDetailsButton_perm.Left = 290 $addGroupBox_perm.Controls.Add($limitedDetailsButton_perm) $reviewerButton_perm = New-Object Windows.Forms.radiobutton $reviewerButton_perm.Text = "Reviewer" $reviewerButton_perm.height = 20 $reviewerButton_perm.width = 120 $reviewerButton_perm.Top = 60 $reviewerButton_perm.Left = 290 $addGroupBox_perm.Controls.Add($reviewerButton_perm) $publishingauthorButton_perm = New-Object Windows.Forms.radiobutton $publishingauthorButton_perm.Text = "Publishing Author" $publishingauthorButton_perm.height = 20 $publishingauthorButton_perm.width = 120 $publishingauthorButton_perm.Top = 80 $publishingauthorButton_perm.Left = 290 $addGroupBox_perm.Controls.Add($publishingauthorButton_perm) #Clear button $aClearBtn_perm = New-Object System.Windows.Forms.Button $aClearBtn_perm.Location = New-Object System.Drawing.Size(260,120) $aClearBtn_perm.Size = New-Object System.Drawing.Size(70,25) $aClearBtn_perm.Text = "Clear" $aClearBtn_perm.Add_Click({$aUserBox_perm.Text=$null, $aCalUserBox_perm.Text=$null, $addOutBox_perm.Text=$null, $addErrorLabel_perm.Text=$null}) $addGroupBox_perm.Controls.Add($aClearBtn_perm) #Remove button $addBtn_perm = New-Object System.Windows.Forms.Button $addBtn_perm.Location = New-Object System.Drawing.Size(340,120) $addBtn_perm.Size = New-Object System.Drawing.Size(70,25) $addBtn_perm.Text = "Add" $addBtn_perm.Add_Click({AddUser}) $addGroupBox_perm.Controls.Add($addBtn_perm) #-----------Add RESULTS------------ $addResultsLabel_perm = New-Object System.Windows.Forms.Label $addResultsLabel_perm.Location = New-Object System.Drawing.Size(10,150) $addResultsLabel_perm.Size = New-Object System.Drawing.Size(260,20) $addResultsLabel_perm.Text = "Results:" $addGroupBox_perm.Controls.Add($addResultsLabel_perm) $addOutBox_perm = New-Object System.Windows.Forms.Label $addOutBox_perm.Location = New-Object System.Drawing.Size(10,170) $addOutBox_perm.Size = New-Object System.Drawing.Size(400,60) $addOutBox_perm.Font = New-Object System.Drawing.Font("Consolas",8,[System.Drawing.FontStyle]::Regular) $addGroupBox_perm.Controls.Add($addOutBox_perm) $addErrorLabel_perm = New-Object System.Windows.Forms.Label $addErrorLabel_perm.Location = New-Object System.Drawing.Size(10,235) $addErrorLabel_perm.Size = New-Object System.Drawing.Size(400,50) $addErrorLabel_perm.ForeColor = "Red" $addGroupBox_perm.Controls.Add($addErrorLabel_perm) #-------------End Calendar Permissions Tab----------------------------------------------------------------------------- ################################################################## ################################################################## #-------------Begin Advanced Tab (Full Access)------------------------------------------------------------------------------ $topLabel_adv = New-Object System.Windows.Forms.Label $topLabel_adv.Location = New-Object System.Drawing.Size(250,20) $topLabel_adv.Text = "List Full Access permissions added to a specified Mailbox" $topLabel_adv.AutoSize = $True $tabpage_adv.Controls.Add($topLabel_adv) #SearchGroupBox_adv $SearchgroupBox_adv = New-Object System.Windows.Forms.GroupBox $SearchgroupBox_adv.Location = New-Object System.Drawing.Size(200,50) $SearchgroupBox_adv.Size = New-Object System.Drawing.Size(360,50) $SearchgroupBox_adv.Text = "Mailbox to search" $tabpage_adv.Controls.Add($SearchgroupBox_adv) $searchBox_adv = New-Object System.Windows.Forms.TextBox $searchBox_adv.Location = New-Object System.Drawing.Size(10,20) $searchBox_adv.Size = New-Object System.Drawing.Size(250,25) $SearchgroupBox_adv.Controls.Add($searchBox_adv) $searchBtn_adv = New-Object System.Windows.Forms.Button $searchBtn_adv.Location = New-Object System.Drawing.Size(280,16) $searchBtn_adv.Size = New-Object System.Drawing.Size(70,25) $searchBtn_adv.Text = "Search" $searchBtn_adv.Add_Click({SearchFullAccessMailbox}) $SearchgroupBox_adv.Controls.Add($searchBtn_adv) #-----------RESULTS------------ $outputBox_adv = New-Object System.Windows.Forms.TextBox $outputBox_adv.Location = New-Object System.Drawing.Size(10,120) $outputBox_adv.Size = New-Object System.Drawing.Size(740,150) $outputBox_adv.Font = New-Object System.Drawing.Font("Consolas",8,[System.Drawing.FontStyle]::Regular) $outputBox_adv.MultiLine = $True $outputBox_adv.ScrollBars = "Vertical" $outputBox_adv.ReadOnly = $True $tabpage_adv.Controls.Add($outputBox_adv) $searchErrorLabel_adv = New-Object System.Windows.Forms.Label $searchErrorLabel_adv.Location = New-Object System.Drawing.Size(10,275) $searchErrorLabel_adv.Size = New-Object System.Drawing.Size(300,50) $searchErrorLabel_adv.ForeColor = "Red" $tabpage_adv.Controls.Add($searchErrorLabel_adv) #Clear button $clearBtn_adv = New-Object System.Windows.Forms.Button $clearBtn_adv.Location = New-Object System.Drawing.Size(600,275) $clearBtn_adv.Size = New-Object System.Drawing.Size(70,25) $clearBtn_adv.Text = "Clear" $clearBtn_adv.Add_Click({$searchBox_adv.Text=$null, $outputBox_adv.Text=$null, $searchErrorLabel_adv.Text=$null}) $tabpage_adv.Controls.Add($clearBtn_adv) #Exit button $exitBtn_adv = New-Object System.Windows.Forms.Button $exitBtn_adv.Location = New-Object System.Drawing.Size(680,275) $exitBtn_adv.Size = New-Object System.Drawing.Size(70,25) $exitBtn_adv.Text = "Exit" $exitBtn_adv.Add_Click({Disconnect-EXOnline $Form.close()}) $tabpage_adv.Controls.Add($exitBtn_adv) #----------------BEGIN Remove Full Access section------------- $removeGroupBox_adv = New-Object System.Windows.Forms.GroupBox $removeGroupBox_adv.Location = New-Object System.Drawing.Size(10,350) $removeGroupBox_adv.Size = New-Object System.Drawing.Size(300,300) $removeGroupBox_adv.Text = "Remove Full Access permissions from Mailbox" $tabpage_adv.Controls.Add($removeGroupBox_adv) $rUserLabel_adv = New-Object System.Windows.Forms.Label $rUserLabel_adv.Location = New-Object System.Drawing.Size(10,20) $rUserLabel_adv.Size = New-Object System.Drawing.Size(280,20) $rUserLabel_adv.Text = "Remove the following user:" $removeGroupBox_adv.Controls.Add($rUserLabel_adv) $rUserBox_adv = New-Object System.Windows.Forms.TextBox $rUserBox_adv.Location = New-Object System.Drawing.Size(10,40) $rUserBox_adv.Size = New-Object System.Drawing.Size(280,20) $removeGroupBox_adv.Controls.Add($rUserBox_adv) $rCalUserLabel_adv = New-Object System.Windows.Forms.Label $rCalUserLabel_adv.Location = New-Object System.Drawing.Size(10,70) $rCalUserLabel_adv.Size = New-Object System.Drawing.Size(280,20) $rCalUserLabel_adv.Text = "from this Mailbox:" $removeGroupBox_adv.Controls.Add($rCalUserLabel_adv) $rCalUserBox_adv = New-Object System.Windows.Forms.TextBox $rCalUserBox_adv.Location = New-Object System.Drawing.Size(10,90) $rCalUserBox_adv.Size = New-Object System.Drawing.Size(280,20) $removeGroupBox_adv.Controls.Add($rCalUserBox_adv) #Clear button $rClearBtn_adv = New-Object System.Windows.Forms.Button $rClearBtn_adv.Location = New-Object System.Drawing.Size(140,120) $rClearBtn_adv.Size = New-Object System.Drawing.Size(70,25) $rClearBtn_adv.Text = "Clear" $rClearBtn_adv.Add_Click({$rUserBox_adv.Text=$null, $rCalUserBox_adv.Text=$null, $removeOutBox_adv.Text=$null, $removeErrorLabel_adv.Text=$null}) $removeGroupBox_adv.Controls.Add($rClearBtn_adv) #Remove button $removeBtn_adv = New-Object System.Windows.Forms.Button $removeBtn_adv.Location = New-Object System.Drawing.Size(220,120) $removeBtn_adv.Size = New-Object System.Drawing.Size(70,25) $removeBtn_adv.Text = "Remove" $removeBtn_adv.Add_Click({RemoveFullAccessUser}) $removeGroupBox_adv.Controls.Add($removeBtn_adv) #-----------Removal RESULTS------------ $removeResultsLabel_adv = New-Object System.Windows.Forms.Label $removeResultsLabel_adv.Location = New-Object System.Drawing.Size(10,150) $removeResultsLabel_adv.Size = New-Object System.Drawing.Size(280,20) $removeResultsLabel_adv.Text = "Results:" $removeGroupBox_adv.Controls.Add($removeResultsLabel_adv) $removeOutBox_adv = New-Object System.Windows.Forms.Label $removeOutBox_adv.Location = New-Object System.Drawing.Size(10,170) $removeOutBox_adv.Size = New-Object System.Drawing.Size(280,50) $removeOutBox_adv.Font = New-Object System.Drawing.Font("Consolas",8,[System.Drawing.FontStyle]::Regular) $removeGroupBox_adv.Controls.Add($removeOutBox_adv) $removeErrorLabel_adv = New-Object System.Windows.Forms.Label $removeErrorLabel_adv.Location = New-Object System.Drawing.Size(10,235) $removeErrorLabel_adv.Size = New-Object System.Drawing.Size(280,50) $removeErrorLabel_adv.ForeColor = "Red" $removeGroupBox_adv.Controls.Add($removeErrorLabel_adv) #-----------End Removal section #-----------Begin Add Full Access Section---------------------- $addGroupBox_adv = New-Object System.Windows.Forms.GroupBox $addGroupBox_adv.Location = New-Object System.Drawing.Size(330,350) $addGroupBox_adv.Size = New-Object System.Drawing.Size(420,300) $addGroupBox_adv.Text = "Add Full Access permissions to Mailbox" $tabpage_adv.Controls.Add($addGroupBox_adv) $aUserLabel_adv = New-Object System.Windows.Forms.Label $aUserLabel_adv.Location = New-Object System.Drawing.Size(10,20) $aUserLabel_adv.Size = New-Object System.Drawing.Size(260,20) $aUserLabel_adv.Text = "Add the following user:" $addGroupBox_adv.Controls.Add($aUserLabel_adv) $aUserBox_adv = New-Object System.Windows.Forms.TextBox $aUserBox_adv.Location = New-Object System.Drawing.Size(10,40) $aUserBox_adv.Size = New-Object System.Drawing.Size(260,20) $addGroupBox_adv.Controls.Add($aUserBox_adv) $aMBUserLabel_adv = New-Object System.Windows.Forms.Label $aMBUserLabel_adv.Location = New-Object System.Drawing.Size(10,70) $aMBUserLabel_adv.Size = New-Object System.Drawing.Size(260,20) $aMBUserLabel_adv.Text = "to this Mailbox:" $addGroupBox_adv.Controls.Add($aMBUserLabel_adv) $aMBUserBox_adv = New-Object System.Windows.Forms.TextBox $aMBUserBox_adv.Location = New-Object System.Drawing.Size(10,90) $aMBUserBox_adv.Size = New-Object System.Drawing.Size(260,20) $addGroupBox_adv.Controls.Add($aMBUserBox_adv) $autoMapBox = New-Object System.Windows.Forms.CheckBox $autoMapBox.Location = New-Object System.Drawing.Size(290,40) $autoMapBox.Size = New-Object System.Drawing.Size(120,20) $autoMapBox.Text = "Auto-Map Mailbox" $addGroupBox_adv.Controls.Add($autoMapBox) #Clear button $aClearBtn_adv = New-Object System.Windows.Forms.Button $aClearBtn_adv.Location = New-Object System.Drawing.Size(260,120) $aClearBtn_adv.Size = New-Object System.Drawing.Size(70,25) $aClearBtn_adv.Text = "Clear" $aClearBtn_adv.Add_Click({$aUserBox_adv.Text=$null, $aMBUserBox_adv.Text=$null, $addOutBox_adv.Text=$null, $addErrorLabel_adv.Text=$null, $autoMapBox=$null}) $addGroupBox_adv.Controls.Add($aClearBtn_adv) #Remove button $addBtn_adv = New-Object System.Windows.Forms.Button $addBtn_adv.Location = New-Object System.Drawing.Size(340,120) $addBtn_adv.Size = New-Object System.Drawing.Size(70,25) $addBtn_adv.Text = "Add" $addBtn_adv.Add_Click({AddFullAccessUser}) $addGroupBox_adv.Controls.Add($addBtn_adv) #-----------Add RESULTS------------ $addResultsLabel_adv = New-Object System.Windows.Forms.Label $addResultsLabel_adv.Location = New-Object System.Drawing.Size(10,150) $addResultsLabel_adv.Size = New-Object System.Drawing.Size(260,20) $addResultsLabel_adv.Text = "Results:" $addGroupBox_adv.Controls.Add($addResultsLabel_adv) $addOutBox_adv = New-Object System.Windows.Forms.Label $addOutBox_adv.Location = New-Object System.Drawing.Size(10,170) $addOutBox_adv.Size = New-Object System.Drawing.Size(400,50) $addOutBox_adv.Font = New-Object System.Drawing.Font("Consolas",8,[System.Drawing.FontStyle]::Regular) $addGroupBox_adv.Controls.Add($addOutBox_adv) $addErrorLabel_adv = New-Object System.Windows.Forms.Label $addErrorLabel_adv.Location = New-Object System.Drawing.Size(10,240) $addErrorLabel_adv.Size = New-Object System.Drawing.Size(400,50) $addErrorLabel_adv.ForeColor = "Red" $addGroupBox_adv.Controls.Add($addErrorLabel_adv) WSManStackVersion LoadExchangeOnline TestConnection $Form.ShowDialog() |
Awesome tool. Can you also add:
Contributor: Create items and files only. The contents of the folder do not appear. (Does not apply to delegates.)
Reviewer: Read items and files only.
Non-Editing Author: Full read details. Create items. Delete own items. Folder visible.
Publishing Editor: Create, read, modify, and delete all items and files, and create sub-folders. (Does not apply to delegates.)
Editor: Create, read, modify, and delete all items and files.
Publishing Author: Create and read items and files, create sub-folders, and modify and delete items and files you create. (Does not apply to delegates.)
Author: Create and read items and files, and modify and delete items and files you create.