Skip to main content

Posts

Showing posts from March, 2016

Outlook VBA get address book names

How to get Outlook address book names via VBA? Outlook has the option to create multiple address books. Of course, it's for a good reason, to organize address books. Well, why need to organize? I guess the reason will depend on every individual whether it's a thing to practice or a thing to be ignored. Outlook address book can be set to manage contacts. For example, you can have an address book just for Personal use which includes friends and family. You can set the address book for vendors and another address book for customers only and of course contacts within the organization. Organizing is a skill if not an attitude to make work easier and manageable. VBA code below will get all the address book names on Outlook, and once the address book is known you can expand the code to get contacts for each specific address book by supplying the address book name. ====================================== Sub getfoldercontact_addressbook_names...

PowerShell set Access rights or ACL

Setting access rights to shared folders and files is very important to control the security of the folders. If there is no proper design for the security of shared folders, missing files and folders is expected to happen since users can accidentally or either purposely delete or modify the folders and files. NTFS permissions can be messy if not properly plan or design. Shared folder structure  on how to organize or set the folders is necessary so permissions can easily be applied. To manage hundreds or thousands of files and folders is quite scary if it has to be done manually. PowerShell scripting can do the heavy task to automate settings of access rights to files and folders. Below is a simple script that can modify or set the folder security settings. Delete and modify permission setting has to be carefully implemented. Set "Auditing" to enabled in order to trace back whoever delete or messed up with the file. Access to individual files or f...

PowerShell send csv content via email

A simple PowerShell code snippet to send contents of a csv file to an email. It can be used to send a reminder with the contents type on the csv file.  The code below can also be used to send reminders to customer or promotion emails which only need text files. Or got logs on a server or applications, but the code below will need to be modified to follow the format of the logs. The code below requires PS 5.0. Tweak the code to suit CSV format; format used below is for demo purposes. From what I observed PowerShell reads the code from the last column with contents to the first column of the excel sheet. The code below uses this CSV format. Highlighted text below is column headers in the CSV file, which is defined as an array on PowerShell script. Tox Subjectx Bodyx user1_tech@myemail.com PC Reminder Turn off PC @ 5PM user2_tech@myemail.com Server Reminder Reboot Server @ 12:30am From above contents of ...