Monthly Archives: April 2016

Escape special characters inside folder/file name variable

array=(`find /path/ -mindepth 2 -maxdepth 2 -type d -print | sed -e ‘s;[^/]*/;;g’ |  sed ‘s/&/\\&/’`) ( sed ‘s/&/\\&/’  replaces & with \& in the folder/file name )

Posted in Linux | Tagged , | Leave a comment

Exchange – remove address from all groups and hide it from GAL

Filename:  script.ps1 $email = (read-host “email”) $GG = Get-DistributionGroup $RG = $GG  | where {(Get-DistributionGroupMember $_ | foreach {$_.PrimarySmtpAddress}) -contains “$email”} foreach( $dg in $RG ){ Remove-DistributionGroupMember $dg -Member $email } get-mailbox -Identity $email | Set-Mailbox -HiddenFromAddressListsEnabled $true  

Posted in Exchange | Leave a comment