Virtual Geek

Tales from real IT system administrators world and non-production environment

Stuffs from real IT system ADMINISTRATORS world and my LAB

Active Directory Powershell: Aduser A value for the attribute was not in the acceptable range of values

August 21, 2017 08:02PM

While writing and testing script Active Directory Powershell: Create bulk users from CSV file, Simulating single user creation I came across an error. This error says.

New-ADUser : A value for the attribute was not in the acceptable range of values
At line:1 char:1
+ New-ADUser -Name TestUser -PasswordNotRequired $true -path 'ou=new,dc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~…

Read more

Active Directory Powershell: Create bulk users from CSV file

August 19, 2017 11:00PM

Creating bulk multiple user accounts on Active Directory Users and Computers mmc console is very boring and tough task also it is most of the time consuming and error prone tend to be lots of mistakes. If same task is done using automation it will be interesting and happen in less time. Active directory Powershell is best way to automate the task of importing users from excel file. 

Download …

Read more

Different ways to bypass Powershell execution policy :.ps1 cannot be loaded because running scripts is disabled

August 19, 2017 03:12PM

By default PowerShell scripts ps1 extension files are restricted to execute on windows system (For windows 2016 it is by default remotesigned), Generally whenever you run ps1 file you will see below error on Powershell console. This is not the authentication issue instead no one can execute ps1 files even administrator. To run script first need to make changes on OS, even if there is single line i…

Read more

VMWare Powercli: Time Configuration (NTP - Network Time Protocol) on multiple Esxi server

August 16, 2017 05:01PM

This blog is related to my earlier blog vSphere ESXi security best practices: Time configuration - (NTP) Network Time Protocol, This is Powercli part of same article. Login into vCenter server, For more details check VMWARE VSPHERE POWERCLI INSTALLATION AND CONFIGURATION STEP BY STEP.

To add ntpserver on esxi server run below command, For adding multiple NTP addresses, run same command with d…

Read more

vSphere ESXi security best practices: Time configuration - (NTP) Network Time Protocol

August 15, 2017 02:09PM

By default NTP - Network time protocol service is disabled on esxi server. ESXi servers always should be configured with NTP for below reasons.

Logs: Very first good reason is logs (events, /var/log). If your Esxi is not synchronized with Time server correctly, Details in logs will show incorrect dates and there will be hard time in finding or troubleshooting issues.
Snapshot creation: If your…

Read more

Powershell one liner: Create multiple user accounts

August 9, 2017 10:44PM

I had an opportunity to teach PowerShell Active Directory basics to some of my junior subordinate, Where I wanted them to show few test cases on creating multiple active directory user accounts, After building active directory from scratch, As this was the demo example lab, accounts created  running below one liner, I can create n number of user accounts in one shot, without wasting any time. Once…

Read more

Powershell: Change DNS IP addresses remotely on multiple computers using CIM & WMI

August 2, 2017 08:05PM

Although I had written this script around 4 years back I have again revised it to work it in more better way with status report on console. I used this script again after long time to change/update DNS ip addresses on remote Windows servers, after introducing my new upgraded DNS servers. Same task I performed but this time  to replace DNS ips on an average 6000 remote windows servers. As it can b…

Read more


July 26, 2017 09:22AM

This is another best security guideline to always join Esxi server into domin, most preferable is Active Directory domain controller, One of the advantage is I can use domain-wide authentication with Domain joined ESXi, Means I don't have to use or share root or any local username to login, Creating local username and maintaining it will be tedious job on Esxi, Users can login with there own eleva…

Read more


July 25, 2017 09:14AM

Logging into SSH required in some of the common troubleshooting scenario or fetching information: ie  checking logs, telnet, ping, esxtop etc, Although subject title of this blog is mentioned Powercli, but I am showing all ways to enable SSH service on esxi including GUI as well, By default SSH server service is disabled on ESXi, VMware recommends the same for security best practices reason. For m…

Read more


July 20, 2017 08:45AM

View older posts »