HOWTO : Creating new Active Directory forest with Powershell

I’ve seen many howtos, manuals how to install Active Directory domain, but they were always GUI based, as example I’ll put just 2 links, one is Technet and second is Petri website. So in this post I’d like to present how to install and configure basic AD forest using Powershell, it requires just a few input data and 2 powershell commands.

Continue reading

Getting information about storage in VMWare script

Probably many people had to face such task before me. I had to get information about storage paths in VMWare including the ESX cluster name, hostname, HBA, etc.
I could of course look for a script which was already written, but probably in the same time I was able to write my own script, which was more challanging for me. I’m using PowerCLI cmdlets, so I need at least VMware.VimAutomation.Core pssnapin. So here goes the script. Continue reading

Powershell, not only Microsoft …

PowerCLII reckon, that Powershell is one of the best Mictosoft products. It came alive when Vista/Windows Server 2008 (codename Longhorn – who remembers this 🙂 ) were released. I’m great Powershell fan, it allows to manage many Microsoft products, but not only. Once, I had to change few options in VMWare environment: “Memory/CPU Hotplug” and “Check and upgrade Tools during power cycling” as on screen below

I could do that manually, but changing manually settings in over 5 virtual machines is simply waste of time.  Continue reading

HOWTO : Find all users in Active Directory who haven’t logged in longer than 90 days

powershell-icon-152-191890Here comes another howto. I was asked few times to find users that haven’t logged to the domain for a defined amount of time, that I decided write few words how to handle it. The easiest way to achieve that is use of “Saved Queries” in Active Directory Users and Computers console. To do that you simply right-click on the “Saved Queries”, choose New->Query

AD0

Then you simply type the name of the query, you can also define specific OU for that and click define query. In the common queries, in the bottom you can choose to find users who has not logged on for some amount of time, counted in days.

ad2

It’s the easiest way to find the users … However I would like to have a list in let say CSV file. Here comes the powershell … again. Continue reading

HOWTO : Start, stop, suspend multiple suspended/saved virtual machines

This post will be for a junior administrator or maybe advanced user I should say. I’m Windows administrator and I’m preparing, testing my solutions in virtual labs.
I’m using Hyper-V, because it’s free, now if you have a Windows 8.1, but Professional or better, it’s built feature – so goodbye VMWare player, Worstation and so on.
Many times my labs contain multiple virtual machines, that means I have to start, stop, suspend,save them. Clicking on each machine to perform this simple actions is pretty annoying, so what to do to start them all, in my case most of my machines are in the suspended or saved state. And again with help comes, the one, the only, the mighty – Powershell. Continue reading

HOWTO : Bulk group name change in the Active Directory by adding a prefix using powershell

During my work I faced many scripting challenges, the one I describe now is very simple and this post will be really short, but dear Reader it can help you to solve some similar cases. So in my case issue was  to change all Active Directory group names in one organizational unit by adding the prefix. Continue reading