Sometimes you need to find all the computers on a domain that are running a certain particular service. By using Active Directory, supplying your canonical domain name, and define an output file, you can easily create a list of computers running a service.
First, start PowerShell as administrator, and import active-directory powershell components with the following command:
Then, open PowerShell ISE and copy in the following into a new .ps1 script:
If a computer is on your network, but RDP is not enabled, you can create a group policy to enable it and then restart the computer. Or instead, you can use psexec to remotely enable RDP.
Below are a couple one-line scripts to enable RDP on a remote computer from a different computer on the same domain. Keep in mind you need to be an administrator and you will only enable RDP for yourself, not an entire security group.
Download the pstools to your computer from here and unzip them into a folder named pstools at the root of your c: drive.
Open the command prompt as administrator.
Change directory into c:\pstools then run the command:
PowerShell – copy a list of files to a list of multiple computers
Here is a simple PowerShell script I found (linked below) that can easily copy a list of files to a list of computers. If you want to copy more than one file to a lot of computers on your network, this simple script should work ok. It’s better to use a network share and use a UNC path to denote where the file source and destinations.
All versions of Windows since Windows Vista should be able to access a GUID drive. Because OS X is able to partition a GUID partition, we want to partition our large external hard drives with this compatible partition table. So, any modern computer since 2006 should be compatible. GUID doesn’t suffer from the restriction of a maximum partition size of 2TB, so if we have a hard drive larger than 2TB, we won’t be required to build multiple partitions with MBR.
Here’s a good quote for other important features regarding GUID (GPT stands for GUID Partition Table).
“On an MBR disk, the partitioning and boot data is stored in one place. If this data is overwritten or corrupted, you’re in trouble. In contrast, GPT stores multiple copies of this data across the disk, so it’s much more robust and can recover if the data is corrupted. GPT also stores cyclic redundancy check (CRC) values to check that its data is intact — if the data is corrupted, GPT can notice the problem and attempt to recover the damaged data from another location on the disk. MBR had no way of knowing if its data was corrupted — you’d only see there was a problem when the boot process failed or your drive’s partitions vanished.”
exFAT was released in 2006 as well, but Microsoft added backwards-compatibility to previous Windows versions from before Vista. The main benefit to it is that it doesn’t have the file size restrictions of FAT32, so individual files with exFAT can be larger than 4GB each. It probably isn’t super important for smaller files, but it could be a necessity for people working on larger files like videos or disk images.
Below is a step-by-step procedure for formatting a large External USB drive which can be used by both a Mac and a PC. This setup will utilize the newest, most fault-tolerant partition tables, and allows for the largest volume and file size capabilities. In my case I am formatting an 8TB Seagate Backup Plus+ USB 3.0 external HDD hard drive.
First, plug a new USB drive into a Mac:
The Mac will automatically prompt if you want to use the drive as a Time Machine backup Disk – click “Don’t Use”
Open Disk Utility
On the left side of Disk Utility, under External, you should see your drive listed.
Select the “highest-level” of the drive, not the partitions located underneath. In my case, Seagate Backup+ Desk Media.
At the top of Disk Utility, click the “Erase” button.
Name your disk, such as “JC-External”.
Under “Format” drop-down menu, select “ExFAT”
Under “Scheme” drop-down menu, select “GUID Partition Map”
Once the drive has been erased, again, Time Machine will prompt to use as a backup disk – select “Don’t Use”
Your drive should now be listed under Devices in the Finder.
Control-click or right-click on the device in the Finder, and click “Get Info”. You can see that indeed it created an 8TB ExFAT Volume, but the Sharing and Permissions cannot be modified. Permissions can only be set if the drive is formatted with “OS X Extended”. Also, notice that the Created/Modified dates may not be accurate, however, files and folders contained in the drive will display accurate modified dates/times.
One thing to note, is after initially formatting the drive on a Mac, and then attaching the external drive to a Windows 10 PC, the drive may not immediately display with a drive letter by default in the Windows File Explorer. Go into Windows 10 Disk Management and find the drive listed in the discovered drives, but you may find that a drive letter is not associated with the volume.
To fix this, in Disk Management, right-click on the large/unidentified new data volume and click “Change Drive Letter and Paths…”. Next, click the Add.. button, assign a drive letter (D:) and then OK. You should now find your external drive listed in Windows Explorer and see the files and folders you copied into it while it had been connected to your Mac.
Raspberry Pi 3 Model B 32GB Initial Setup and Configuration
So my first Raspberry Pi 3 Model B 32GB just arrived which is part of a “Canakit” on Amazon which can be found here. Below is a general setup and config step by step guide to get you started with your own Pi. I may follow up this post with the progress of my pie-in-the-sky project to build a miniature hyperloop “pod” and track, controlled by a stand-alone Raspberry Pi. But before I get into powering my Pi with an electrified rail, we need to get the Pi setup and configured.
Unbox, connect peripherals & power on (I swear, every video and tutorial spends too much time on this topic.) But I will say that the little machine is very quick and responsive, and I’m really happy with it’s performance so far!
Initial power up. The Red LED powers on, and my monitor stays black, hmm, it’s not booting… Oh duh, it will help if I insert the included 32GB MicroSD. Important to note is the SD card does not click-eject or click-insert but is friction-based receptacle.
Ok 2nd power up – it’s alive! Boots to the desktop and looks great – except the resolution. I used the Wifi config to get connected to my WAP easy. But it’s strange that I can’t ping anything. A quick search found this post, and the command:
sudo chmod u+s /bin/ping
With that command I can now ping out and about.
Now I can go online with the default web-browser (Web 3.8.2) and find a fix for my monitor’s resolution. To set a raspberry pi 3 monitor resolution, follow the instructions in this post – which told me to first check my monitor’s capabilities with the commands:
tvservice -d edid
and then seeing that I do have a DMT monitor (group 2) and an hdmi mode 82, I edited /boot/config.txt with the new editor named Geany. I started geany with sudo so I could edit the protected file with the command:
Which brings up the Geany file editor running as sudo, and then I could open and browse to the File System > /boot/ directory where I could edit the file config.txt to include the following lines:
After a restart my monitor’s resolution is correct.
So now to make sure my OS is up to date. By default the version I installed is
Linux raspberrypi 4.4.9-v7+ #884 SMP Fri May 6 17:28:59 BST 2016 armv7l GNU/Linux
So it is time to run an update. It’s so nice that the distro is debian-based and the familiar apt package management system is installed. No dist-upgrade necessary.
sudo apt-get update
sudo apt-get upgrade
I’ll be following up soon with more findings and initial configuration, but for now I’ve got enough to be able to branch out and explore the world of Raspberry Pi!
If you’ve been tasked with the domain migration of a number of OS X El Capitan and Mavericks iMacs or MacBook Pro or Mac Air workstations, you may need to retain the user profiles. Normally, when unbinding, and then binding to a new domain, your user’s settings will be lost. You may be tempted to use Migration Assistant, but this usually requires copying the entire profile somewhere else which can take a long time and use a lot of disk space.
With this list of steps, you can use commands, scripting, and setting permissions and ownership of the user directories to perform the domain migration in-place.
Below is the sequence of commands and workflow step by step to migrate an OS X mac to a different domain. The key is to delete the sqlindex files, and prepare the user account for it’s new permissions. Please note the guide may not make sense at first while reading, but it will allow you to migrate your macs so that the users keep their same profile. Let me know if this guide helps you in your domain migration and if you find any better solutions.
Login as admin user and list users
Terminal -> ls -alh /Users/
move domain User folders to .old
sudo mv /Users/johndoe /Users/johndoe.old
Preferences->Accounts->Login Options->Network account server -> Directory utility ->Active directory->Unbind
Delete sqlindex files found in ls /var/db/dslocal/nodes/Default/
This video demonstrates how to use Open Broadcaster Software for capturing your desktop into a record-able video. OBS is free software that you can also use to record your gaming sessions to never miss that moment during your computer game. Here is a good post on Reddit.com describing how to set up OBS for capturing your game with a 20 second “buffer” so you can show your frags on youtube or convert them to a gif. But for now, below I put together a tutorial on how to setup OBS to record your desktop screen and audio to make videos like the one here:
This video shows you how to setup a user account for your kid/child without creating an email address. Windows 10 wants you to use an email address to create a user account. When you try to setup an account, it asks you to use an existing email and if not, it tries to force you to sign up for an outlook.com account. This video shows you how to bypass the Windows User account setup and use Computer Management to create a normal/local user account on the computer for your kids.
If you’re thinking about which cloud service to use for a startup business, Microsoft just upped the ante with BizSpark.
Microsoft BizSpark https://www.microsoft.com/bizspark#start-two is really an amazing deal for business start-ups. If you wish you could get Microsoft software for free or for a huge discount check out their offer. BizSpark offers the following services and software for free for three years:
BizSpark gives startups 3 years of free stuff – software, services, tech support, and Azure cloud. Your startup qualifies if it is less than 5 years old, is privately held, and earns less than $1M annually. And at the end of your 3 years, you keep all the software you’ve downloaded – at no cost.
To expand on this service what you get with the Microsoft Bizspark details are the following:
Get up to $750 per month of FREE Azure cloud services for 3 years; that’s $150 per month each for up to 5 developers.
This potentially is a $27000 value!
Membership puts all Microsoft development and test software at your fingertips, including Azure, Windows, and Office 365 – for free. Plus, enjoy access to hundreds of free training classes, technical content, and 4 break-fix phone support incidents to help you on your journey.
It’s pretty amazing that BizSpark, in addition, also offers up to $120,000 worth of Azure credit.
Makes me want to go out and start a new business – hmm, maybe jasoncoltrin.com would qualify?
If for example, a new faculty member does not have the original files for an old moodle course, and the files uploaded to moodle the last semester are corrupt, you still can extract the files from a backup of the course with a tool I found here: DownloadAll
In order to extract all files from a course backup mbz file, please follow the guide below. Even if the files that were uploaded and are corrupt, and cannot be viewed/downloaded in moodle, you may be able to download the originals, repair the files, and then re-upload to moodle again:
Go into the course where files are located (may be in an old location, even though current/copied course is valid with same corrupt files)
Backup the course without user data. An mbz file will be generated. Copy this file to a Windows computer eg. c:\Users\jcoltrin\Desktop\moodlebackups\coursename.mbz
Copy the linked jar script to the same folder
Make sure 7zip is installed. Extract all the files in the mbz file to a directory with the same name just under the location of the mbz file. The script will not work unless you first extract all the files! For example, your folder structure will now look like this:
… This step may take a little bit of cut/paste as the mbz file has to be extracted twice with 7zip.
Run the DownloadAll.jar script with the command java -jar DownloadAll.jar (PS C:\Users\jcoltrin\Desktop\moodlebackups> java -jar DownloadAll.jar)
You’ll be prompted to enter the full path to the mbz file: “Enter the full path location to the Moodle’s backup (.mbz) file, e.g. C:/Users/Moodle/Backup/backup-moodle2-course-592-nu.mbz” – so in this case, I used: C:\Users\jcoltrin\Desktop\moodlebackups\backup-moodle2-course-269-1509-bus302-va-20160114-1028-nu.mbz
Output should return the names of the files that are recovered and start extracting (files even though errors occur):
IOError :java.util.zip.ZipException: error in opening zip file
b720c6266753b54e5c5af614274bfcfe to C:\Users\jcoltrin\Desktop\moodlebackups\backup-moodle2-course-269-1509-bus302-va-201
60114-1028-nu\Legal StructureLawsuits .pdf
e36df971bd7780defd8802ba119d4e80 to C:\Users\jcoltrin\Desktop\moodlebackups\backup-moodle2-course-269-1509-bus302-va-201
7. Once files have completed Extracting, gather the files and distribute as necessary.
8. In this case, many of the files that were corrupt in moodle had contained spaces in the filenames. I find that files uploaded to moodle work best with filenames that do not contain spaces or special characters. Also it’s smart to test opening each file in moodle first, to make sure repairs and download actions for each file work correctly.