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.
On August 19, 2017
0 Comment
43 Views

The GlobalFunctions PowerShell module has been updated to support writing of log messages to the PowerShell output pipeline.

When writing to the PowerShell output pipeline, the severity level is not written to the pipeline. In most cases you will use this option for debugging purposes.

Example

# Import module first
Import-Module -Name GlobalFunctions

# Create an instance of the logger
$ScriptDir = Split-Path -Path $script:MyInvocation.MyCommand.Path
$ScriptName = $MyInvocation.MyCommand.Name
$logger = New-Logger -ScriptRoot $ScriptDir -ScriptName $ScriptName -LogFileRetention 14 

# Write an informational message to the log file only
$logger.Write('Some informational message')

# Write an informational message to the log file only
$logger.Write('Some message to log and console',0,$true)

# Write a warning level message to log file and the message only to PowerShell output pipeline
$logger.Write('Some warning message',2,$true)

Note

Remember to add the severity level when writing to console.

 

Read more about the GlobalFunctions module here.

You can get the source code here:

Read More »

PowerShellDescription

This script deletes user from the NoSpamProxy NoSpamProxyAddressSynchronization database table [Usermanagement].[User] table that have not been removed by the NoSpamProxy Active Directory synchronization job.

The script was developed due to a process flaw in how Active Directory accounts are handled as part of a leaver process. So this script does not fix a software bug, but a process glitch.

Due to the Active Directory account process the accounts still exist in Active Directory and are synchronized to the NoSpamProxyAddressSynchronization database.

When executed without the -Delete parameter all identified users are wirtten the log file only.

Requirements

Examples

# EXAMPLE 1
# Check for Active Directory existance of all users stored in NoSpamProxy database. Do NOT delete any users from the database.

.\Remove-NspUsers.ps1 


# EXAMPLE 2
# Delete users from NoSpamProxy database hosted on SQL instance MYNSPSERVER\SQLEXPRESS that do NOT exist in Active Directory.

.\Remove-NspUsers.ps1 -Delete -SqlServerInstance MYNSPSERVER\SQLEXPRESS

 

Version History

  • 1.0, Initial community release

Links

Follow

 

 

Read More »

Exchange Server 2013Exchange Server 2016Description

This scripts creates a new room mailbox and security two groups for full mailbox access and and for send-as delegation. The security groups are created using a configurable naming convention. If required by your Active Directory team, you can add group prefixes or department abbreviations as well.

The script uses a Xml configuration file to simplify changes for variables unique for your environment.

High level steps executes by the script:

  1. Create a new room mailbox
  2. Create a new mail enabled security group for full access delegation
  3. Assign full access security group for full access to the room mailbox
  4. Create a new mail enabled security group for send-as delegation
  5. Assign send-as permissions to send-as security group
  6. Set calendar processing to AutoAccept, if required
  7. Set resource capacity, if rewuired

 

Examples

Xml settings file

<?xml version="1.0"?>
<Settings>
	<GroupSettings>
		<Prefix>pre_</Prefix>
		<SendAsSuffix>_SA</SendAsSuffix>
		<FullAccessSuffix>_FA</FullAccessSuffix>
		<CalendarBookingSuffix>_CB</CalendarBookingSuffix>
		<TargetOU>mcsmemail.de/IT/Groups/Mail/Rooms</TargetOU>
		<Domain>mcsmemail.de</Domain>
		<Seperator>-</Seperator>
	</GroupSettings>
	<AccountSettings>
		<TargetOU>mcsmemail.de/IT/Mail/RoomMailboxes</TargetOU>
	</AccountSettings>
	<GeneralSettings>
		<Sleep>10</Sleep>
	</GeneralSettings>
</Settings>

Note

The calendar booking security group feature is currently not available. But will be available in an upcoming release.

The following example creates a room mailbox for an Conference Room with empty security groups.

.\New-RoomMailbox.ps1 
  -RoomMailboxName "MB - Conference Room" 
  -RoomMailboxDisplayName "Board Conference Room" 
  -RoomMailboxAlias "MB-ConferenceRoom" 
  -RoomMailboxSmtpAddress "ConferenceRoom@mcsmemail.de" 
  -DepartmentPrefix "C"

You can simplify the use of the script by using a paramterized helper script named Create-RoomMailbox.ps1.

The following Create-RoomMailbox.ps1 script simplifies the process of creating a team mailbox even more.

$roomMailboxName = 'MB-Conference Room'
$roomMailboxDisplayName = 'Board Conference Room'
$roomMailboxAlias = 'MB-ConferenceRoom'
$roomMailboxSmtpAddress = 'ConferenceRoom@mcsmemail.de'
$departmentPrefix = 'C'
$groupFullAccessMembers = @('JohnDoe','JaneDoe')  # Empty = @()
$groupSendAsMember = @()
$groupCalendarBooking = @()
$RoomCapacity = 0
$RoomList = 'AllRoomsHQ'


.\New-RoomMailbox.ps1 
  -RoomMailboxName $roomMailboxName 
  -RoomMailboxDisplayName $roomMailboxDisplayName 
  -RoomMailboxAlias $roomMailboxAlias 
  -RoomMailboxSmtpAddress $roomMailboxSmtpAddress 
  -DepartmentPrefix $departmentPrefix 
  -GroupFullAccessMembers $groupFullAccessMembers 
  -GroupSendAsMember $groupSendAsMember 
  -RoomCapacity $RoomCapacity 
  -AutoAccept 
  -RoomList $RoomList

Version History

  • 1.0, Initial community release

Links

Follow

 

 

Read More »

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 »