[Quicks]Useful commands when migrating to a new DC

Howdy, friends!

One of my task recently was to migrate to a new DC ‘cuz the old one is totally broken. So I had to export somehow all the users, OUs and SG from the domain controller which was so damaged that I wasn’t able to list the roles installed. That’s why I had to use PowerShell in which I’m newbie. So .. the struggle was real and I decided to share my research and knowledge related to this topic!

As I understood, the best way to export users is CSV file because this is the easiest way to import them directly to the new DC with their old profile configurations.

Get-ADUser -Filter * -Properties * | Select-Object -Property Name,SamAccountName,Description,EmailAddress,LastLogonDate,Manager,
Title,Department,whenCreated,Enabled,Organization | Sort-Object
-Property Name | ConvertTo-CSV

With this command I am telling to PowerShell to export in a CSV file all users from the Active Directory with the following parameters: Name (Rosen Slavchev), SamAccountName (rslavchev or r.slavchev or whatever your sys admin decided to be), Description (“This is test account for our ERP system and ..”), Email (rslavchev@domain.com), LastLogonDate (the format is: 10:11:12 10.11.12 y), Manager (your manager’ name set in the AD), Title (Systems Engineer), Department (Technical), whenCreated (same format as LastLogonDate), Enabled (will list only ENABLED accounts from the AD), Organization.

After all of this you can open your .csv in Excel and you will be surprised with the good result.

Another command is exporting all Organizational Unites using LDIFDE tool. The command is:

ldifde -f c:\ExportOU.ldf -s domain.local -d “dc=emeneye,dc=co,dc=local” -p subtree -r “(objectcategory=organizationalUnit)” -l “cn,objectclass,ou”

In my case I used local DC but it can be public! The format here is different. I suggest opening with editor like Notepad ++ for best review.

Analog command to this but again in .csv is:

Get-ADOrganizationalUnit -filter * | Select Name, DistinguishedName | export-csv c:\AD_OU_Tree.csv -NoTypeInformation

I hope that this was helpful for PowerShell newbies like me. Do not hesitate to ask me anything regarding this.

[Quicks] PowerShell How-To find all disabled users in Active Directory

Hello folks!

I found something extremely useful while I was doing a research for another topic. Back in the days I tried couple of times to review all AD users, including deleted. I had a lot of headaches regarding this task. Now I want to share with you couple of PowerShell commands.

Get-ADUser -Filter {Enabled -eq $false} | FT samAccountName

With this command you will find all disabled users inside your AD.


Get-ADUser -Filter {Enabled -eq $false} | FT samAccountName, GivenName, Surname

This is the same as the command above but with extra parameters (GivenName, Surname). So this will output the samAccountName, first name, and last name of the disabled users.


Get-ADUser -Filter {Enabled -eq $false} 

If you want no formatting whatsoever and have AD spit a bunch of information back at you, try running just the Get-ADUser part with the filter applied.


Search-ADAccount -AccountDisabled

This can be used to find out the disabled users AND computers.

Apple event – summarized

Same year, same date but NOT the same products. Thing that most smartphone users cannot understand. As usual, Apple killed ’em all. But as always, there were tons of information that can be said in a shorter way. I will skip the watch and the TV because I am not much of a fan of these two products. I like simple and “original” watches and I don’t really watch TV.

Let’s start with the iPad


iPad Pro should have been the main device tonight, not the new iPhone. With all my respect to the iPhone but .. iPad literally moved the tech to a whole new level. I saw things that I have never seen before. And nowadays this is rare!

A little bit of tech specification:

iPad pro has 12.9” display which makes it the biggest iPad so far. The weight of the device is about 0.700 kg (1.5 pounds) and is 6.9 mm thick. It has a new sound system – 4 speakers with a lot of promises regarding the sound power. And of course the processor – the new A9X:

1.8X faster than desktop
A9X 2x faster than A8X
first iPad 22x times slower than Pro
360x more GPU permormance
10 hours battery life

..which is simply outstanding!

 

The new iPhone 6S


 

The same design as iPhone 6. Which is not a surprise for you people, right? S models are always the same so we all get used to it. But there is a new color, girlish – pink or as Apple says “rose gold” (wtf?!). But we are not here to talk about the design and color. Because the design is not the best. We all remember the perfect 4S, right? The last of Steve Jobs touch.Magnificent! The way how the camera pops-up really annoys me, sorry. And what is wrong with the edges? I really liked the old design, that’s why im still using iPhone 5.

The best feature, I think, is the new 3D touch technology. I will try to explain it (somehow, lol). Basically, it recognizes the force you create over the display and you can create new touch gestures. So, it depends whether you press hard or light. If you press hard enough you can have a preview of your email, for example and when your remove your finger it just disappers, which is good and useful for me.

Yeah, the annoying camera is better now. 12 MP + 4k video. Which is good but not for the 16GB owners. They’ve also released a new Live Photos shooting option that essentially creates short, animated photos of every picture you take.


The new iOS will be available next week, September 16th. iOS brings new stuff like using two applications at the same time by dividing the screen into two parts. In my opinion, really useful, especially for business.

All we have to do now is to wait until iOS 9 release and test all this stuff.