Author Archives: C.D.

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

Expanding a LVM root partition to fill remaining drive space

Expanding a LVM root partition to fill remaining drive space 09 Dec 2009 When I deploy new servers through VMWare ESX, I usually copy an existing base that I have already setup. I keep the base image VMDK size small … Continue reading

Posted in Linux | Tagged | Leave a comment

Convert URL text to clickable hyperlink in Excel

1. Select the range of url text that you want to convert to clickable hyperlinks. 2. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window. 3. Click Insert > Module, and paste the … Continue reading

Posted in Windows | Tagged | Leave a comment

Resize KVM guest disk space then resize PV LV

Increase KVM virtual machine guest’s disk space from the command line if you initially set insufficient amount of disk space: Shutdown the VM Move the current image mv mykvm.img mykvm.img.bak Create a new image qemu-img create -f raw addon.raw 30G … Continue reading

Posted in Linux | Tagged , | Leave a comment

Linux Emergency Reboot / Shutdown

echo 1 > /proc/sys/kernel/sysrq echo b > /proc/sysrq-trigger The first line is for enabling SysRq, and the second one is for rebooting. More info HERE. echo 0 > /proc/sysrq-trigger if you need to shutdown instead of rebooting

Posted in Linux | Leave a comment

Force CentOS 6 to Re-Detect Network Devices

Edit the interface that “doesn’t seem to be present”: vi /etc/sysconfig/network-scripts/ifcfg-eth0 and remove the HWADDR line. Remove the old 70-persistnet-net.rules file: rm  /etc/udev/rules.d/70-persistent-net.rules Removing this file will force udev to probe for network interfaces at boot and create a new … Continue reading

Posted in Linux | Leave a comment

Exchange – Add mailbox permissions to Domain Admins

Add-MailboxPermission -Identity alice.cooper -User “Domain Admins” -AccessRights Fullaccess -InheritanceType all

Posted in Exchange | Leave a comment

Exchange – Check Email forwarding using Powershell

Get-Mailbox -Filter {ForwardingAddress -ne $null} | ft Name,ForwardingAddress,DeliverToMailboxAndForward -Autosize | Export-CSV e:\Email_forwarding_output.csv

Posted in Exchange | Leave a comment

Reset password in Active Directory using PowerShell

  You must have the cmdlets ( part of the ActiveDirectory module for PowerShell v2 ) For Windows 7, you need to install the latest RSAT (Remote Server Admin Tools) and then add the Windows Feature for the PowerShell AD … Continue reading

Posted in Exchange | Leave a comment