de-DEen-GB
 
rss

Just can't get enough of IT

This blog is about mostly anything in IT. But the primary focuses are Microsoft Technologies like Exchange, Office 365, Azure and Cloud Security.

Exchange Server 2013Exchange Server 2016Description

This script searches for OOF rules created by users using the Outlook rule-tab in the OOF assistant and deletes exisiting OOF rules.

In preparation to configure compliant Out-Of-Office (OFF) settings for users, any existing OOF rule needs to be deleted. The script will use either an exisiting Exchange Server EWS library or the Managed EWS library installed using the default file path.

This is the first of two scripts for the complete solution. Find the second script here.

The script access the mailbox rules using Exchange Web Services. Therefore the account executing the script either needs to have ApplicationImpersonation rights or full access to the user mailbox.

Requirements

Examples

# EXAMPLE 1
# Find any existing OOF rule and write results to log file
Remove-OOFRule 

# EXAMPLE 2
# Find and delete any existing OOF rules in all user mailboxes and write delete actions to log file
Remove-OOFRule -Delete

# EXAMPLE 3
# Find and delete any existing OOF rules for user SomeUser@varunagroup.de and write delete actions to log file
Remove-OOFRule -Mailbox SomeUser@varunagroup.de -Delete

Version History

  • 1.0, Initial community release

Links

Additional Credits

Rhoderick Milne (https://blogs.technet.microsoft.com/rmilne)

Follow

 

 

Read More »

Exchange Server 2013Exchange Server 2016Description

This script sets the mailbox ExternalOofOptions to 'External' for members of a given security group.

ExternalOofOptions for users that are NOT a member of the security group will be set to 'InternalOnly'. If required the script will set the ExternalAudience to None and will delete an existing OOF message.

Controlling the ExternalOofOptions and ExternalAudience settings has been implemented to follow dedicated company compliance rules.

This is the second of two scripts for the complete solution. Find the first script here.

Requirements

Examples

# EXAMPLE
# Run script with default settings
.\Set-ExternalOOF.ps1

Version History

  • 1.0, Initial community release

Links

Follow

 

Read More »

The PowerShell script to Set mailbox quotas at database or mailbox level the simple way has been updated to Version 1.4.

The code has been refactored to functions and has received some PowerShell hygiene patters.

Please report any issues directly at Github.

If you like the script, please rate the script at TechNet Gallery.

Enjoy!

 

 

Read More »
On April 10, 2017
0 Comment
394 Views

 

Exchange Server 2013 Exchange Server 2016 The PowerShell script to purge Exchange Server and IIS log files has been updated to version 2.0.

Release 2.0 allows for copying of files that will be deleted to be copied to a central file repository. The script will create a folder per server and the full log file folder structure will be preserved.

The next release will contain an option to compress the copied log files.

Added code:

function Copy-LogFiles {
  [CmdletBinding()]
  param(
    [string]$SourceServer,
    [string]$SourcePath,
    $FilesToMove
  )

  if($SourceServer -ne '') { 

    # path per SERVER for zipped archives
    $ServerRepositoryPath = Join-Path -Path $RepositoryRootPath -ChildPath $SourceServer

    # subfolder used as target for copying source folders and files
    $ServerRepositoryLogsPath = Join-Path -Path $ServerRepositoryPath -ChildPath $LogSubfolderName

    $ServerRepositoryPath = Join-Path -Path $RepositoryRootPath -ChildPath $SourceServer

    if(!(Test-Path -Path $ServerRepositoryPath)) {
      # Create new target directory for server, if does not exist
      $null = New-Item -Path $ServerRepositoryPath -ItemType Directory -Force -Confirm:$false
    }

    foreach ($File in $FilesToMove) {
      # target directory
      $targetDir = $File.DirectoryName.Replace($TargetServerFolder, $ServerRepositoryLogsPath)

      # target file path
      $targetFile = $File.FullName.Replace($TargetServerFolder, $ServerRepositoryLogsPath)
      
      # create target directory, if not exists
      if(!(Test-Path -Path $targetDir)) {$null = mkdir -Path $targetDir}

      # copy file to target
      $null = Copy-Item -Path $File.FullName -Destination $targetFile -Recurse -Force -Confirm:$false -ErrorAction SilentlyContinue

    }-Force   
    
    if($ZipArchive) {
      # zip copied log files
      #
      <# NOT FULLY TESTED YET 
      $Archive = Join-Path -Path $ServerRepositoryPath -ChildPath $ArchiveFileName
      $logger.Write(('Zip copied files to {0}' -f $ArchiveFileName))

      if(Test-Path -Path $Archive) {Remove-Item $Archive -Force -Confirm:$false}

      Add-Type -AssemblyName 'System.IO.Compression.FileSystem'
      [IO.Compression.ZipFile]::CreateFromDirectory($ServerRepositoryLogsPath,$Archive)

      #>
    } 
  }  
}

Note

Links

Social

 

 

Read More »

The PowerShell module GlobalFunctions got updated to Version 2.0. This module is used by some of my PowerShell scripts which utilize centralized logging. 

The new release contains the first functions required for some upcoming scripts for managing on-boarding process for joiners and the off-boarding process for leavers for companies utilizing Office 365.

Changes

  • File encoding switch from UTF8 to Unicode
  • New functions
    • Format-SpecialCharactersUpperCase
    • New-RandomPassword

Notes

The New-RandomPassword functions is based on Simon Wahlin's script published here: https://gallery.technet.microsoft.com/scriptcenter/Generate-a-random-and-5c879ed5

Links

 

 

 

 

Read More »