Shutting down PC’s remotely with Powershell

powershell

Hello. Let’s say you have a large sum of computers in your organization that are connected to a domain and some of those computers could be turned off for the night (library, computer class, etc.), because after using them not everyone turns them off and they are kept powered on through the night. That bothers me because ~50 computers are wasting energy! and so I came up with a powershell script that powers off the selected computers at a schedule, in my case I set it to run at 19:00 every day.
After letting it run for a couple of weeks, I think it seems to be working pretty well… You have to configure it though, by adding computer names with their full domain name and their MAC addresses in the array and that’s it. Log file is created at the location you specify (C:\ now) with computers that were shut down.
Script can be found in my project folder here.

Set out-of-office programmatically in O365 with powershell

powershell

Part of our employee synchronization from employee database to our AD is setting an out-of-office message in Office365 when the user gets disabled (to send a notice that the user no longer works here to whoever sends that person an email), and removing the message when that same person comes back to work. For this, I made a powershell script (damn, I love powershell) that lists all disabled users in our AD and goes through everyone checking if it has a message set up, if not then it sets one.

Script can be found here, in my projects folder.

Assign licenses to O365 users programmatically

powershell

Just recently we migrated from our own mail server to Office365, because cloud is computing is the god damn future! 1tb of onedrive space and 50gb mailbox is more than enough to host your work-related porn collection :)
Azure is all set up to synchronize our AD users with Office365, however once a user is created newly into the AD, the mailbox gets created for that user, but it doesn’t set the license and location of the user, until the license is assigned, users can’t login to the mailbox. I hate repetitive work, so I came up with a powershell script (I love powershell!) that checks for users that doesn’t have license assigned and assigns them one, also adds the location.
The script at the end also disables the new “clutter” feature, which is complete garbage IMO. Most of the legitimate letters go into clutter and users complain to us that letters do not reach them. Microsoft declares that this new super-awesome feature helps people save up to 82 minutes checking their mail… I guess that’s correct when you don’t see any emails :D

The script can be found here.

Separating AD users into groups

powershell

In our AD we have many users, all of them are unified in one general mailgroup “visi”. One day I was tasked to split users into english and lithuanian groups, so that emails in my language wouldn’t bother those who can’t read them :P
It was easy with my newly acquired Powershell skill, and we were dividing people into groups by their departments, so I knew the english speaking departments, all I had to do was list out all the people and add them to “visilt” and “visien” groups according by their departments.
Read more

Synchronizing Exchange calendars with the web

ExchangeLogo

Hello. Today I’m writing about a new tool that I come up with, after not finding this, lemme say – basic, functionality in Microsoft’s Exchange Server 2010. What was needed was very simple – to synchronize the schedule from a database/web backend of some sort to the exchange calendar and it turns out Exchange doesn’t have this or I didn’t find it and I looked EVERYWHERE.
Everyone uses Outlook 2010 with Exchange, and Outlook has the ability to keep track of internet/shared calendars like Google Calendar does, but it turns out that it’s an outlook only feature, meaning that if you added this calendar in outlook, all the appointments would appear, but wouldn’t be sent to Exchange. And I guess there is a way of adding appointments for all or a group of people by hand, but it’s not what I want.
Having that in mind I set out to search for a 3rd party solution, however I didn’t expect to find anything, and I didn’t… only option left was to write a custom solution.
Read more

Building Bluetooth retro phone handset

bluetooth-phone

The other day I finished assembling this thing. I’ve been seeing these “retro bluetooth handsets” on the market for a long time and I love old things, but those are quite expensive, depending on the brand, price on ebay ranges from 20-40$ which is… too much for a toy like this.
I had made one before from not-so-old office phone. The quality of it was crappy, on some phones it was ok, on some it wasn’t… overall crap and I didn’t use it that much. But just recently I somehow regained interest in making a better version and here’s how I did it.
Read more

Improved CD Lamp

improved-cd-lamp

Hello again :) the other day I finished assembling an improved version of a CD lamp which I made before. I’ve been collecting cd’s to be thrown out for like a year and I collected quite a stack. Had few left from my previous attempt, it was ok, but not good. That previous article I wrote in Lithuanian language, can’t remember why, it was probably easier for me at that time :D
Anyway, the new version I made is more than a meter high and uses RGB LED strip. I figured it’s not going to be used to light up a room, so I made it as a decoration instead and I think I got it really good… still not perfect, but… that’ll do pig :) I didn’t count how many CD’s I got stacked, but there should be around 680 of them… so apparently it takes 680 CD’s to have a 62cm tower.
The whole cost of this was about 55€. The most costly part was the LED RGB strip – 14€.
Read more

My backup procedure

keep-calm-and-call-for-backup

Oh hello again… man, lately I have no time to keep my blog updated, but I’m glad I can write a post occasionally at least.
This time I’d like to write about how I do backups and a way I automated half of it. It might not be the most efficient way or “the right way”, but as with anything – it works for me, so shut up! :P (j/k, you can bitch in the comments).
Anyway, I have several places to grab backups from and one place to store them – I don’t use mainstream cloud services (maybe I should…?), instead I store those onto my external drive. Google drive gives free 15GB to store stuff, in the future I might use that instead of my external, but the place doesn’t matter, it’s HOW I store those backups that matters.
Read more

Sumos vertimas žodžiais Word’e

office_95_logo

Toks dalykas reikalingas buhalterijai, ruošiant dokumentus Word’e. Deja, sprendimų daug nėra Word’ui, galima rasti įvairių dalykų Excel’iui tik. Gerai paieškojus galima rasti failą Sum2Txt.dot, kuris yra MS Office makro programa, ir ji veikė puikiai tiek su senu ofisu, tiek su nauju. Tačiau problema iškilo kai litai pasikeitė į eurus – aišku, anokia čia ir problema, tiesiog pakeiti žodį vieną ir viskas. Tačiau aš būdamas programuotoju, viską stengiuosi automatizuoti (tegul kompiuteris dirba už mane… :P) todėl nusprendžiau panagrinėti tą failą, ir atradau kaip galima lengvai pakeisti kodą. Taip pat duosiu ir parsisiųsti jau paruoštą programą.
Read more

Susipažinimas su IPDS sistemomis

SnortLogo

Neseniai teko rašyti tokį apibendrinantį referatą, man tema teko IPDS (Intrusion detection and prevention) sistemos. Nieko giliai nenagrinėjau, tik apibendrintai parašiau, kadangi tik to ir reikėjo. Tie kas nori lysti giliai, tikrai ras straipsnių apie tai anglų kalba, gale nurodysiu keletą šaltinių. Tad papostinsiu tą straipsnį čia, gal kam bus įdomu…
Read more