Browsed by
Author: Salomon

Get GUID Remotely

Get GUID Remotely

Recently I had to pull the GUID of a server remotely at work, I didn’t quite know how to do this off the top of my head. I found a few websites that suggested the following commands: Get-WmiObject Win32_ComputerSystemProduct | Select-Object -ExpandProperty UUID Get-WmiObject Win32_ComputerSystemProduct -ComputerName HOSTNAME | Select-Object -ExpandProperty UUID Both work, but I wanted to make a small powershell script where it would prompt me for the hostname and get it. $hostname = Read-Host ‘What is the hostname’…

Read More Read More

Graduate Study

Graduate Study

Not long ago, I finished the last class in the graduate program I was taking at Boston University. I wanted to provide a brief review of the program that I took. I started the program in September of 2013, the admission process was overall pretty straight forward. So long as you have good grades, a strong statement of purpose, and your transcripts ready, it seemed very easy to make this dream a reality. The classes were moderately difficult in my…

Read More Read More

Marrying a Kuwaiti Women as a Non-Kuwaiti Man (1/2)

Marrying a Kuwaiti Women as a Non-Kuwaiti Man (1/2)

Marriage in Kuwait can be a difficult task to accomplish, leaving aside the family issues here and the normal process of “no system” to do things, people at government offices that speak English, but don’t when you need help. Some background on our situation, I have been married to my wife for about two years now in the US, but have never been legally married in Kuwait, despite the fact that I have worked here on and off during the…

Read More Read More

Error Installing Gems

Error Installing Gems

I spun up a new instance on Amazon AWS to learn some ruby for one of my classes online and notice I kept getting the below error: [ec2-user@ip-xx-xx-xx-xx ~]$ sudo gem install Fetching: xxxxxxxxxxxxxxxxxxxx (100%) Successfully xxxxxxxxxxx Fetching: multi_json-1.10.1.gem (100%) Successfully installed multi_json-1.10.1 Fetching: rubyzip-1.1.6.gem (100%) Successfully installed rubyzip-1.1.6 Fetching: ffi-1.9.3.gem (100%) Building native extensions. This could take a while… ERROR: Error installing xxxxx: ERROR: Failed to build gem native extension. /usr/bin/ruby2.0 extconf.rb mkmf.rb can’t find header files for ruby…

Read More Read More

Tutorial: Installing Debian

Tutorial: Installing Debian

Installing Debian is a pretty straight forward process, it can be confusing at first, but this tutorial should help make it easy. This tutorial will be used as a base for a few other upcoming tutorials. This tutorial assumes you have the requisite knowledge on how to configure a virtual machine and download the Network Installation ISO file from Debian. They can be found here. The above should be the first screen you see when you boot up Debian. You…

Read More Read More

Batch: Add New Registry Key Remotely

Batch: Add New Registry Key Remotely

As a systems administrator sometimes I find myself in a situation where I need to make a registry change across a few computers, or even a few hundred. I was googleing for a while this week trying to figure this out and saw some very complex solutions, but found a few sites to include TechNet that lead me into this much simpler solution: @echo off FOR /f %%F IN (feedme.txt) DO ( REG ADD \\%%F\HKLM\SYSTEM\example\example /v TestValue /t REG_DWORD /d…

Read More Read More

PowerShell: Extension Attributes Server 2012

PowerShell: Extension Attributes Server 2012

A few days ago I wrote up a small post on modifying extension attributes for computer objects in Active Directory. I recently set up a lab with Server 2012 and found that extensionattribute1 is now msDS-cloudExtensionAttribute1, and if you just drop in msDS-cloudExtensionAttribute1 without quotes it has issues… This gave me a small headache, after reading this link I found that simply putting quotes around it, fixed it. The following code should work better in a server 2012 enviornment. import-module activedirectory…

Read More Read More

PowerShell: Import-Module Active Directory Cmdlet

PowerShell: Import-Module Active Directory Cmdlet

For those looking to query or do something within Active Directory in a PowerShell script, one of the most common mishaps I see at work is people forgetting to import the model. Often times everything else is fine, no syntax errors, etc. A simple fix for that is: import-module activedirectory The error generally looks something like this: PS C:\Users\userone> New-ADComputer -Name test The term ‘New-ADComputer’ is not recognized as the name of a cmdlet, function, script file, or operable program….

Read More Read More

PowerShell: Create Computers from Names in a List

PowerShell: Create Computers from Names in a List

Sometimes I find the need to create 10-20 computers for my AD lab at home, to do this in PowerShell you can run the following command: Get-Content computers.txt | ForEach-Object { New-ADComputer -Name $_ } If you want to create the computer objects in an OU other than “Computers”, lets say you want to prestage a number of computer objects for a new department, you could do this: Get-Content computers.txt | ForEach-Object { New-ADComputer -Name $_ -Path “Specify Path”}

PowerShell: Modify Extension Attributes on a List of Hosts

PowerShell: Modify Extension Attributes on a List of Hosts

Some of you may find this useful, I ran into this problem where I needed to set the value of an extension attribute on a number of hosts from a list. The following script should take care of that. At the end, it will let you know that the host is finished, it will output an error if one occurs. import-module activedirectory $machines = Get-Content “C:\PATH TO LIST\feedme.txt” foreach($machinename in $machines) { Set-ADComputer $machinename -add @{extensionattribute10 = “VALUE IN THE…

Read More Read More